summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKjell Ericson <kjell@haxx.se>2002-10-16 08:44:43 +0000
committerKjell Ericson <kjell@haxx.se>2002-10-16 08:44:43 +0000
commitfae212043b3b417880c451ab4e13f73af6f01332 (patch)
tree2d4ca72c3c2de3df295e2dfa4d1663c01b574dc2
parentc54ff705a0039ffac847c5d4f7e0cc76aae33d4b (diff)
Using expose-event instead of resizerequest-event in order to be able to
zoom the window. Note that when you shrink the window, you must make it a bit larger again in order to get it redrawn. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@2676 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--uisimulator/x11/screenhack.c28
1 files changed, 10 insertions, 18 deletions
diff --git a/uisimulator/x11/screenhack.c b/uisimulator/x11/screenhack.c
index 6ff864ec59..28bfcdc19e 100644
--- a/uisimulator/x11/screenhack.c
+++ b/uisimulator/x11/screenhack.c
@@ -210,25 +210,17 @@ int screenhack_handle_event(Display *dpy, XEvent *event, bool *release)
*release = TRUE;
}
break;
- case ResizeRequest:
- screen_resized(event->xresizerequest.width,
- event->xresizerequest.height);
- screen_redraw();
- fprintf(stderr, "WINDOW RESIZED to width %d height %d\n",
- event->xresizerequest.width, event->xresizerequest.height);
+ case Expose:
+ {
+ int x=event->xexpose.width+event->xexpose.x;
+ int y=event->xexpose.height+event->xexpose.y;
+ screen_resized(x, y);
+ screen_redraw();
+ fprintf(stderr, "WINDOW RESIZED to width %d height %d\n",
+ x, y);
+ }
break;
default:
-/* fprintf(stderr, "EVENT: %d (see /usr/include/X11/X.h)\n",
- event->xany.type);
-*/
- break;
- case Expose:
- screen_redraw();
- /*
- fprintf(stderr, "EXPOSE: x: %d y: %d width: %d height: %d\n",
- event->xexpose.x, event->xexpose.y,
- event->xexpose.width, event->xexpose.height);
- */
break;
case ButtonPress:
fprintf(stderr, "BUTTON PRESSED: x: %d y:%d\n",event->xbutton.x,event->xbutton.y);
@@ -433,7 +425,7 @@ int main (int argc, char **argv)
XGetWindowAttributes (dpy, window, &xgwa);
XSelectInput (dpy, window,
xgwa.your_event_mask | KeyPressMask | KeyRelease |
- ButtonPressMask | ResizeRedirectMask | ExposureMask);
+ ButtonPressMask | ExposureMask);
XChangeProperty (dpy, window, XA_WM_PROTOCOLS, XA_ATOM, 32,
PropModeReplace,
(unsigned char *) &XA_WM_DELETE_WINDOW, 1);