[Xfce4-commits] r26363 - xfwm4/branches/xfce_4_4/src
Olivier Fourdan
olivier at xfce.org
Sat Nov 17 21:33:25 CET 2007
Author: olivier
Date: 2007-11-17 20:33:24 +0000 (Sat, 17 Nov 2007)
New Revision: 26363
Modified:
xfwm4/branches/xfce_4_4/src/client.c
Log:
Filter out grab/ungrab events so we don't end up redrawing the frame twice
Modified: xfwm4/branches/xfce_4_4/src/client.c
===================================================================
--- xfwm4/branches/xfce_4_4/src/client.c 2007-11-17 20:23:19 UTC (rev 26362)
+++ xfwm4/branches/xfce_4_4/src/client.c 2007-11-17 20:33:24 UTC (rev 26363)
@@ -121,7 +121,7 @@
};
/* Forward decl */
-static void
+static void
clientUpdateIconPix (Client * c);
Display *
@@ -348,8 +348,8 @@
if (FLAG_TEST (c->xfwm_flags, XFWM_FLAG_VISIBLE))
{
c->blink_timeout_id =
- g_timeout_add_full (G_PRIORITY_DEFAULT,
- CLIENT_BLINK_TIMEOUT,
+ g_timeout_add_full (G_PRIORITY_DEFAULT,
+ CLIENT_BLINK_TIMEOUT,
(GtkFunction) urgent_cb,
(gpointer) c, NULL);
}
@@ -1183,11 +1183,11 @@
values.events = True;
c->xsync_alarm = XSyncCreateAlarm (display_info->dpy,
- XSyncCACounter |
- XSyncCADelta |
- XSyncCAEvents |
- XSyncCATestType |
- XSyncCAValue |
+ XSyncCACounter |
+ XSyncCADelta |
+ XSyncCAEvents |
+ XSyncCATestType |
+ XSyncCAValue |
XSyncCAValueType,
&values);
return (c->xsync_alarm != None);
@@ -1258,9 +1258,9 @@
TRACE ("entering clientXSyncResetTimeout");
clientXSyncClearTimeout (c);
- c->xsync_timeout_id = g_timeout_add_full (G_PRIORITY_DEFAULT,
- CLIENT_XSYNC_TIMEOUT,
- (GtkFunction) clientXSyncTimeout,
+ c->xsync_timeout_id = g_timeout_add_full (G_PRIORITY_DEFAULT,
+ CLIENT_XSYNC_TIMEOUT,
+ (GtkFunction) clientXSyncTimeout,
(gpointer) c, NULL);
}
@@ -1634,7 +1634,7 @@
update_icon_idle_cb (gpointer data)
{
Client *c;
-
+
TRACE ("entering update_icon_idle_cb");
c = (Client *) data;
@@ -1659,7 +1659,7 @@
if (c->icon_timeout_id == 0)
{
- c->icon_timeout_id = g_idle_add_full (G_PRIORITY_DEFAULT_IDLE,
+ c->icon_timeout_id = g_idle_add_full (G_PRIORITY_DEFAULT_IDLE,
update_icon_idle_cb, c, NULL);
}
}
@@ -1925,7 +1925,7 @@
}
}
- /*
+ /*
Initialize "old" fields once the position is ensured, to avoid
initially maximized or fullscreen windows being placed offscreen
once de-maximized
@@ -2590,7 +2590,7 @@
for (index = screen_info->windows_stack; index; index = g_list_next (index))
{
Client *c = (Client *) index->data;
- if ((c->type & WINDOW_REGULAR_FOCUSABLE)
+ if ((c->type & WINDOW_REGULAR_FOCUSABLE)
&& !FLAG_TEST (c->flags, CLIENT_FLAG_ICONIFIED | CLIENT_FLAG_SKIP_TASKBAR))
{
FLAG_SET (c->xfwm_flags, XFWM_FLAG_WAS_SHOWN);
@@ -2643,7 +2643,7 @@
}
else
{
- TRACE ("Setting WM_STATE_DEMANDS_ATTENTION flag on \"%s\" (0x%lx)", c->name, c->window);
+ TRACE ("Setting WM_STATE_DEMANDS_ATTENTION flag on \"%s\" (0x%lx)", c->name, c->window);
FLAG_SET (c->flags, CLIENT_FLAG_DEMANDS_ATTENTION);
clientSetNetState (c);
}
@@ -2779,7 +2779,7 @@
wc.y = c->y;
mask |= (CWX | CWY);
}
-
+
if (FLAG_TEST (c->xfwm_flags, XFWM_FLAG_VISIBLE))
{
c->ignore_unmap++;
@@ -4064,7 +4064,7 @@
g1 = myScreenGrabKeyboard (screen_info, myDisplayGetCurrentTime (display_info));
g2 = myScreenGrabPointer (screen_info, ButtonMotionMask | ButtonReleaseMask,
- myDisplayGetCursorMove (display_info),
+ myDisplayGetCursorMove (display_info),
myDisplayGetCurrentTime (display_info));
if (!g1 || !g2)
{
@@ -4470,7 +4470,7 @@
|| (!clientCkeckTitle (c) && (frame_y < screen_info->margins [STRUTS_TOP])))
{
temp = c->y + c->height;
- c->y = CLAMP (c->y, screen_info->margins [STRUTS_TOP] + frame_top,
+ c->y = CLAMP (c->y, screen_info->margins [STRUTS_TOP] + frame_top,
MAX (disp_max_y - min_visible, screen_info->height - screen_info->margins [STRUTS_BOTTOM] - min_visible));
clientSetHeight (c, temp - c->y);
c->y = temp - c->height;
@@ -4956,32 +4956,39 @@
status = EVENT_FILTER_STOP;
pressed = TRUE;
- if (xevent->type == EnterNotify)
+ switch (xevent->type)
{
- c->button_pressed[b] = TRUE;
- frameDraw (c, FALSE);
+ case EnterNotify:
+ if ((xevent->xcrossing.mode != NotifyGrab) && (xevent->xcrossing.mode != NotifyUngrab))
+ {
+ c->button_pressed[b] = TRUE;
+ frameDraw (c, FALSE);
+ }
+ break;
+ case LeaveNotify:
+ if ((xevent->xcrossing.mode != NotifyGrab) && (xevent->xcrossing.mode != NotifyUngrab))
+ {
+ c->button_pressed[b] = FALSE;
+ frameDraw (c, FALSE);
+ }
+ break;
+ case ButtonRelease:
+ pressed = FALSE;
+ break;
+ case UnmapNotify:
+ if (xevent->xunmap.window == c->window)
+ {
+ pressed = FALSE;
+ c->button_pressed[b] = FALSE;
+ }
+ break;
+ case KeyPress:
+ case KeyRelease:
+ break;
+ default:
+ status = EVENT_FILTER_CONTINUE;
+ break;
}
- else if (xevent->type == LeaveNotify)
- {
- c->button_pressed[b] = FALSE;
- frameDraw (c, FALSE);
- }
- else if (xevent->type == ButtonRelease)
- {
- pressed = FALSE;
- }
- else if ((xevent->type == UnmapNotify) && (xevent->xunmap.window == c->window))
- {
- pressed = FALSE;
- c->button_pressed[b] = FALSE;
- }
- else if ((xevent->type == KeyPress) || (xevent->type == KeyRelease))
- {
- }
- else
- {
- status = EVENT_FILTER_CONTINUE;
- }
if (!pressed)
{
More information about the Xfce4-commits
mailing list