summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOlivier Fourdan <fourdan.olivier@wanadoo.fr>2008-05-07 21:56:47 +0000
committerOlivier Fourdan <fourdan.olivier@wanadoo.fr>2008-05-07 21:56:47 +0000
commit0d6f758752db494190d4e78ae034c9b62e83067d (patch)
treeb6b4abf1b42a4368e1dd0deac849fc423eff7ad6
parentb26e84df760ec0077a7b201e43422034a8712917 (diff)
downloadxfwm4-0d6f758752db494190d4e78ae034c9b62e83067d.tar.gz
Switch to synchronous key grab
(Old svn revision: 26935)
-rw-r--r--src/client.c28
-rw-r--r--src/client.h2
-rw-r--r--src/events.c9
-rw-r--r--src/keyboard.c16
-rw-r--r--src/placement.c2
5 files changed, 18 insertions, 39 deletions
diff --git a/src/client.c b/src/client.c
index 1db05a7c2..299acb802 100644
--- a/src/client.c
+++ b/src/client.c
@@ -240,8 +240,8 @@ clientUpdateAllFrames (ScreenInfo *screen_info, int mask)
}
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 @@ clientCoordGravitate (Client * c, int mode, int *x, int *y)
*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,11 +1916,8 @@ clientFrame (DisplayInfo *display_info, Window w, gboolean recapture)
/* 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))
- {
- clientGravitate (c, APPLY);
- }
- else
+ clientCoordGravitate (c, APPLY, &c->x, &c->y);
+ if ((attr.map_state == IsUnmapped))
{
clientInitPosition (c);
}
@@ -2146,7 +2128,7 @@ clientUnframe (Client * c, gboolean remap)
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);
diff --git a/src/client.h b/src/client.h
index 9089b116b..85734ae8e 100644
--- a/src/client.h
+++ b/src/client.h
@@ -323,8 +323,6 @@ void clientCoordGravitate (Client *,
int,
int *,
int *);
-void clientGravitate (Client *,
- int);
void clientConfigure (Client *,
XWindowChanges *,
unsigned long,
diff --git a/src/events.c b/src/events.c
index 7821f5c7e..86137cc0a 100644
--- a/src/events.c
+++ b/src/events.c
@@ -342,16 +342,16 @@ handleKeyPress (DisplayInfo *display_info, XKeyEvent * ev)
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 @@ handleKeyPress (DisplayInfo *display_info, XKeyEvent * ev)
}
/* 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 @@ handleConfigureRequest (DisplayInfo *display_info, XConfigureRequestEvent * ev)
ev->value_mask &= ~(CWSibling | CWStackMode);
}
clientCoordGravitate (c, APPLY, &wc.x, &wc.y);
+
if (FLAG_TEST (c->flags, CLIENT_FLAG_FULLSCREEN))
{
GdkRectangle rect;
diff --git a/src/keyboard.c b/src/keyboard.c
index 95c94d26b..e16a2ab83 100644
--- a/src/keyboard.c
+++ b/src/keyboard.c
@@ -175,35 +175,35 @@ grabKey (Display * dpy, MyKey * key, Window w)
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);
}
}
diff --git a/src/placement.c b/src/placement.c
index 00c2ef1e3..7ad51188b 100644
--- a/src/placement.c
+++ b/src/placement.c
@@ -640,8 +640,6 @@ clientInitPosition (Client * c)
g_return_if_fail (c != NULL);
TRACE ("entering clientInitPosition");
- clientGravitate (c, APPLY);
-
screen_info = c->screen_info;
msx = 0;
msy = 0;