Author: olivier Date: 2008-05-07 21:56:47 +0000 (Wed, 07 May 2008) New Revision: 26935
Modified: xfwm4/trunk/src/client.c xfwm4/trunk/src/client.h xfwm4/trunk/src/events.c xfwm4/trunk/src/keyboard.c xfwm4/trunk/src/placement.c Log: Switch to synchronous key grab Modified: xfwm4/trunk/src/client.c =================================================================== --- xfwm4/trunk/src/client.c 2008-05-07 06:15:25 UTC (rev 26934) +++ xfwm4/trunk/src/client.c 2008-05-07 21:56:47 UTC (rev 26935) @@ -240,8 +240,8 @@ } if (mask & UPDATE_GRAVITY) { - clientGravitate (c, REMOVE); - clientGravitate (c, APPLY); + clientCoordGravitate (c, REMOVE, &c->x, &c->y); + clientCoordGravitate (c, APPLY, &c->x, &c->y); setNetFrameExtents (screen_info->display_info, c->window, frameTop (c), @@ -429,21 +429,6 @@ *y = *y + (dy * mode); } -void -clientGravitate (Client * c, int mode) -{ - int x, y; - - g_return_if_fail (c != NULL); - TRACE ("entering clientGravitate"); - - x = c->x; - y = c->y; - clientCoordGravitate (c, mode, &x, &y); - c->x = x; - c->y = y; -} - static void clientComputeWidth (Client * c, int *w) { @@ -1931,12 +1916,9 @@ /* Once we know the type of window, we can initialize window position */ if (!FLAG_TEST (c->xfwm_flags, XFWM_FLAG_SESSION_MANAGED)) { - if ((attr.map_state != IsUnmapped)) + clientCoordGravitate (c, APPLY, &c->x, &c->y); + if ((attr.map_state == IsUnmapped)) { - clientGravitate (c, APPLY); - } - else - { clientInitPosition (c); } } @@ -2146,7 +2128,7 @@ gdk_error_trap_push (); clientUngrabButtons (c); XUnmapWindow (display_info->dpy, c->frame); - clientGravitate (c, REMOVE); + clientCoordGravitate (c, REMOVE, &c->x, &c->y); XSelectInput (display_info->dpy, c->window, NoEventMask); reparented = XCheckTypedWindowEvent (display_info->dpy, c->window, ReparentNotify, &ev); Modified: xfwm4/trunk/src/client.h =================================================================== --- xfwm4/trunk/src/client.h 2008-05-07 06:15:25 UTC (rev 26934) +++ xfwm4/trunk/src/client.h 2008-05-07 21:56:47 UTC (rev 26935) @@ -323,8 +323,6 @@ int, int *, int *); -void clientGravitate (Client *, - int); void clientConfigure (Client *, XWindowChanges *, unsigned long, Modified: xfwm4/trunk/src/events.c =================================================================== --- xfwm4/trunk/src/events.c 2008-05-07 06:15:25 UTC (rev 26934) +++ xfwm4/trunk/src/events.c 2008-05-07 21:56:47 UTC (rev 26935) @@ -342,16 +342,16 @@ TRACE ("entering handleKeyEvent"); - status = EVENT_FILTER_PASS; ev_screen_info = myDisplayGetScreenFromRoot (display_info, ev->root); if (!ev_screen_info) { /* Release queued events */ - XAllowEvents (display_info->dpy, AsyncKeyboard, ev->time); + XAllowEvents (display_info->dpy, SyncKeyboard, ev->time); - return status; + return EVENT_FILTER_PASS; } + status = EVENT_FILTER_PASS; c = clientGetFocus (); if (c) { @@ -564,7 +564,7 @@ } /* Release queued events */ - XAllowEvents (display_info->dpy, AsyncKeyboard, myDisplayGetCurrentTime (display_info)); + XAllowEvents (display_info->dpy, SyncKeyboard, myDisplayGetCurrentTime (display_info)); return status; } @@ -1378,6 +1378,7 @@ ev->value_mask &= ~(CWSibling | CWStackMode); } clientCoordGravitate (c, APPLY, &wc.x, &wc.y); + if (FLAG_TEST (c->flags, CLIENT_FLAG_FULLSCREEN)) { GdkRectangle rect; Modified: xfwm4/trunk/src/keyboard.c =================================================================== --- xfwm4/trunk/src/keyboard.c 2008-05-07 06:15:25 UTC (rev 26934) +++ xfwm4/trunk/src/keyboard.c 2008-05-07 21:56:47 UTC (rev 26935) @@ -175,35 +175,35 @@ status |= XGrabKey (dpy, key->keycode, key->modifier, w, - TRUE, GrabModeAsync, GrabModeAsync); + TRUE, GrabModeAsync, GrabModeSync); status |= XGrabKey (dpy, key->keycode, key->modifier | ScrollLockMask, w, - TRUE, GrabModeAsync, GrabModeAsync); + TRUE, GrabModeAsync, GrabModeSync); status |= XGrabKey (dpy, key->keycode, key->modifier | NumLockMask, w, - TRUE, GrabModeAsync, GrabModeAsync); + TRUE, GrabModeAsync, GrabModeSync); status |= XGrabKey (dpy, key->keycode, key->modifier | LockMask, w, - TRUE, GrabModeAsync, GrabModeAsync); + TRUE, GrabModeAsync, GrabModeSync); status |= XGrabKey (dpy, key->keycode, key->modifier | ScrollLockMask | NumLockMask, w, - TRUE, GrabModeAsync, GrabModeAsync); + TRUE, GrabModeAsync, GrabModeSync); status |= XGrabKey (dpy, key->keycode, key->modifier | ScrollLockMask | LockMask, w, - TRUE, GrabModeAsync, GrabModeAsync); + TRUE, GrabModeAsync, GrabModeSync); status |= XGrabKey (dpy, key->keycode, key->modifier | LockMask | NumLockMask, w, - TRUE, GrabModeAsync, GrabModeAsync); + TRUE, GrabModeAsync, GrabModeSync); status |= XGrabKey (dpy, key->keycode, key->modifier | ScrollLockMask | LockMask | NumLockMask, w, - TRUE, GrabModeAsync, GrabModeAsync); + TRUE, GrabModeAsync, GrabModeSync); } } Modified: xfwm4/trunk/src/placement.c =================================================================== --- xfwm4/trunk/src/placement.c 2008-05-07 06:15:25 UTC (rev 26934) +++ xfwm4/trunk/src/placement.c 2008-05-07 21:56:47 UTC (rev 26935) @@ -640,8 +640,6 @@ g_return_if_fail (c != NULL); TRACE ("entering clientInitPosition"); - clientGravitate (c, APPLY); - screen_info = c->screen_info; msx = 0; msy = 0; _______________________________________________ Xfce4-commits mailing list Xfce4-commits@xfce.org http://foo-projects.org/mailman/listinfo/xfce4-commits