mirror of
https://github.com/brl/mutter.git
synced 2025-02-16 13:24:09 +00:00
Remove grab_start_serial, which we expect to be an ancient attempt to
2007-04-08 Elijah Newren <newren gmail com> Remove grab_start_serial, which we expect to be an ancient attempt to workaround sloppy/mouse focus bugs that have since been correctly fixed. May fix some race conditions. May cause nasty bugs in sloppy/mouse focus modes. We'll find out soon enough... See #304430. * src/display.c (event_callback): remove event->xany.serial >= display->grab_start_serial in several event callback handlers * src/display.[ch] (struct _MetaDisplay, meta_display_begin_grab_op): * src/keybindings.c (do_choose_window, handle_workspace_switch): * src/frames.c (meta_frames_button_press_event): * src/core.[ch] (meta_core_begin_grab_op): * src/window.c (meta_window_client_message, meta_window_begin_grab_op): don't require an event_serial to be passed to meta_display_begin_grab_op () and don't record it anymore. * src/ui.c (struct _EventFunc, filter_func, meta_ui_get_last_event_serial) * src/core.h (meta_ui_get_last_event_serial): remove meta_ui_get_last_event_serial() function (don't ask me why it was declared in core.h) and the last_even_serial field of _EventFunc svn path=/trunk/; revision=3182
This commit is contained in:
parent
addf369006
commit
ebfbef86a0
27
ChangeLog
27
ChangeLog
@ -1,3 +1,30 @@
|
|||||||
|
2007-04-08 Elijah Newren <newren gmail com>
|
||||||
|
|
||||||
|
Remove grab_start_serial, which we expect to be an ancient attempt
|
||||||
|
to workaround sloppy/mouse focus bugs that have since been
|
||||||
|
correctly fixed. May fix some race conditions. May cause nasty
|
||||||
|
bugs in sloppy/mouse focus modes. We'll find out soon enough...
|
||||||
|
See #304430.
|
||||||
|
|
||||||
|
* src/display.c (event_callback):
|
||||||
|
remove event->xany.serial >= display->grab_start_serial in several
|
||||||
|
event callback handlers
|
||||||
|
|
||||||
|
* src/display.[ch] (struct _MetaDisplay, meta_display_begin_grab_op):
|
||||||
|
* src/keybindings.c (do_choose_window, handle_workspace_switch):
|
||||||
|
* src/frames.c (meta_frames_button_press_event):
|
||||||
|
* src/core.[ch] (meta_core_begin_grab_op):
|
||||||
|
* src/window.c (meta_window_client_message, meta_window_begin_grab_op):
|
||||||
|
don't require an event_serial to be passed to
|
||||||
|
meta_display_begin_grab_op () and don't record it anymore.
|
||||||
|
|
||||||
|
* src/ui.c (struct _EventFunc, filter_func,
|
||||||
|
meta_ui_get_last_event_serial)
|
||||||
|
* src/core.h (meta_ui_get_last_event_serial):
|
||||||
|
remove meta_ui_get_last_event_serial() function (don't ask me why
|
||||||
|
it was declared in core.h) and the last_even_serial field of
|
||||||
|
_EventFunc
|
||||||
|
|
||||||
2007-04-08 Elijah Newren <newren gmail com>
|
2007-04-08 Elijah Newren <newren gmail com>
|
||||||
|
|
||||||
Fix move/resize events in relation to combinations of
|
Fix move/resize events in relation to combinations of
|
||||||
|
@ -630,7 +630,6 @@ meta_core_begin_grab_op (Display *xdisplay,
|
|||||||
MetaGrabOp op,
|
MetaGrabOp op,
|
||||||
gboolean pointer_already_grabbed,
|
gboolean pointer_already_grabbed,
|
||||||
gboolean frame_action,
|
gboolean frame_action,
|
||||||
int event_serial,
|
|
||||||
int button,
|
int button,
|
||||||
gulong modmask,
|
gulong modmask,
|
||||||
guint32 timestamp,
|
guint32 timestamp,
|
||||||
@ -649,7 +648,6 @@ meta_core_begin_grab_op (Display *xdisplay,
|
|||||||
return meta_display_begin_grab_op (display, screen, window,
|
return meta_display_begin_grab_op (display, screen, window,
|
||||||
op, pointer_already_grabbed,
|
op, pointer_already_grabbed,
|
||||||
frame_action,
|
frame_action,
|
||||||
event_serial,
|
|
||||||
button, modmask,
|
button, modmask,
|
||||||
timestamp, root_x, root_y);
|
timestamp, root_x, root_y);
|
||||||
}
|
}
|
||||||
|
@ -151,7 +151,6 @@ gboolean meta_core_begin_grab_op (Display *xdisplay,
|
|||||||
MetaGrabOp op,
|
MetaGrabOp op,
|
||||||
gboolean pointer_already_grabbed,
|
gboolean pointer_already_grabbed,
|
||||||
gboolean frame_action,
|
gboolean frame_action,
|
||||||
int event_serial,
|
|
||||||
int button,
|
int button,
|
||||||
gulong modmask,
|
gulong modmask,
|
||||||
guint32 timestamp,
|
guint32 timestamp,
|
||||||
@ -182,8 +181,6 @@ void meta_core_get_screen_size (Display *xdisplay,
|
|||||||
*/
|
*/
|
||||||
void meta_core_increment_event_serial (Display *display);
|
void meta_core_increment_event_serial (Display *display);
|
||||||
|
|
||||||
int meta_ui_get_last_event_serial (Display *xdisplay);
|
|
||||||
|
|
||||||
void meta_invalidate_default_icons (void);
|
void meta_invalidate_default_icons (void);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -1570,7 +1570,6 @@ event_callback (XEvent *event,
|
|||||||
|
|
||||||
if (display->grab_op != META_GRAB_OP_NONE &&
|
if (display->grab_op != META_GRAB_OP_NONE &&
|
||||||
display->grab_window != NULL &&
|
display->grab_window != NULL &&
|
||||||
event->xany.serial >= display->grab_start_serial &&
|
|
||||||
grab_op_is_mouse (display->grab_op))
|
grab_op_is_mouse (display->grab_op))
|
||||||
meta_window_handle_mouse_grab_op_event (display->grab_window, event);
|
meta_window_handle_mouse_grab_op_event (display->grab_window, event);
|
||||||
}
|
}
|
||||||
@ -1656,7 +1655,6 @@ event_callback (XEvent *event,
|
|||||||
if ((window &&
|
if ((window &&
|
||||||
grab_op_is_mouse (display->grab_op) &&
|
grab_op_is_mouse (display->grab_op) &&
|
||||||
display->grab_button != (int) event->xbutton.button &&
|
display->grab_button != (int) event->xbutton.button &&
|
||||||
event->xany.serial >= display->grab_start_serial &&
|
|
||||||
display->grab_window == window) ||
|
display->grab_window == window) ||
|
||||||
grab_op_is_keyboard (display->grab_op))
|
grab_op_is_keyboard (display->grab_op))
|
||||||
{
|
{
|
||||||
@ -1776,7 +1774,6 @@ event_callback (XEvent *event,
|
|||||||
op,
|
op,
|
||||||
TRUE,
|
TRUE,
|
||||||
FALSE,
|
FALSE,
|
||||||
event->xbutton.serial,
|
|
||||||
event->xbutton.button,
|
event->xbutton.button,
|
||||||
0,
|
0,
|
||||||
event->xbutton.time,
|
event->xbutton.time,
|
||||||
@ -1834,7 +1831,6 @@ event_callback (XEvent *event,
|
|||||||
META_GRAB_OP_MOVING,
|
META_GRAB_OP_MOVING,
|
||||||
TRUE,
|
TRUE,
|
||||||
FALSE,
|
FALSE,
|
||||||
event->xbutton.serial,
|
|
||||||
event->xbutton.button,
|
event->xbutton.button,
|
||||||
0,
|
0,
|
||||||
event->xbutton.time,
|
event->xbutton.time,
|
||||||
@ -1845,19 +1841,16 @@ event_callback (XEvent *event,
|
|||||||
break;
|
break;
|
||||||
case ButtonRelease:
|
case ButtonRelease:
|
||||||
if (display->grab_window == window &&
|
if (display->grab_window == window &&
|
||||||
event->xany.serial >= display->grab_start_serial &&
|
|
||||||
grab_op_is_mouse (display->grab_op))
|
grab_op_is_mouse (display->grab_op))
|
||||||
meta_window_handle_mouse_grab_op_event (window, event);
|
meta_window_handle_mouse_grab_op_event (window, event);
|
||||||
break;
|
break;
|
||||||
case MotionNotify:
|
case MotionNotify:
|
||||||
if (display->grab_window == window &&
|
if (display->grab_window == window &&
|
||||||
event->xany.serial >= display->grab_start_serial &&
|
|
||||||
grab_op_is_mouse (display->grab_op))
|
grab_op_is_mouse (display->grab_op))
|
||||||
meta_window_handle_mouse_grab_op_event (window, event);
|
meta_window_handle_mouse_grab_op_event (window, event);
|
||||||
break;
|
break;
|
||||||
case EnterNotify:
|
case EnterNotify:
|
||||||
if (display->grab_window == window &&
|
if (display->grab_window == window &&
|
||||||
event->xany.serial >= display->grab_start_serial &&
|
|
||||||
grab_op_is_mouse (display->grab_op))
|
grab_op_is_mouse (display->grab_op))
|
||||||
{
|
{
|
||||||
meta_window_handle_mouse_grab_op_event (window, event);
|
meta_window_handle_mouse_grab_op_event (window, event);
|
||||||
@ -1951,7 +1944,6 @@ event_callback (XEvent *event,
|
|||||||
break;
|
break;
|
||||||
case LeaveNotify:
|
case LeaveNotify:
|
||||||
if (display->grab_window == window &&
|
if (display->grab_window == window &&
|
||||||
event->xany.serial >= display->grab_start_serial &&
|
|
||||||
grab_op_is_mouse (display->grab_op))
|
grab_op_is_mouse (display->grab_op))
|
||||||
meta_window_handle_mouse_grab_op_event (window, event);
|
meta_window_handle_mouse_grab_op_event (window, event);
|
||||||
else if (window != NULL)
|
else if (window != NULL)
|
||||||
@ -3305,7 +3297,6 @@ meta_display_begin_grab_op (MetaDisplay *display,
|
|||||||
MetaGrabOp op,
|
MetaGrabOp op,
|
||||||
gboolean pointer_already_grabbed,
|
gboolean pointer_already_grabbed,
|
||||||
gboolean frame_action,
|
gboolean frame_action,
|
||||||
int event_serial,
|
|
||||||
int button,
|
int button,
|
||||||
gulong modmask,
|
gulong modmask,
|
||||||
guint32 timestamp,
|
guint32 timestamp,
|
||||||
@ -3350,12 +3341,6 @@ meta_display_begin_grab_op (MetaDisplay *display,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* We'll ignore any events < this serial. */
|
|
||||||
if (pointer_already_grabbed)
|
|
||||||
display->grab_start_serial = event_serial;
|
|
||||||
else
|
|
||||||
display->grab_start_serial = XNextRequest (display->xdisplay);
|
|
||||||
|
|
||||||
/* FIXME:
|
/* FIXME:
|
||||||
* If we have no MetaWindow we do our best
|
* If we have no MetaWindow we do our best
|
||||||
* and try to do the grab on the RootWindow.
|
* and try to do the grab on the RootWindow.
|
||||||
|
@ -254,7 +254,6 @@ struct _MetaDisplay
|
|||||||
MetaScreen *grab_screen;
|
MetaScreen *grab_screen;
|
||||||
MetaWindow *grab_window;
|
MetaWindow *grab_window;
|
||||||
Window grab_xwindow;
|
Window grab_xwindow;
|
||||||
gulong grab_start_serial;
|
|
||||||
int grab_button;
|
int grab_button;
|
||||||
int grab_anchor_root_x;
|
int grab_anchor_root_x;
|
||||||
int grab_anchor_root_y;
|
int grab_anchor_root_y;
|
||||||
@ -450,7 +449,6 @@ gboolean meta_display_begin_grab_op (MetaDisplay *display,
|
|||||||
MetaGrabOp op,
|
MetaGrabOp op,
|
||||||
gboolean pointer_already_grabbed,
|
gboolean pointer_already_grabbed,
|
||||||
gboolean frame_action,
|
gboolean frame_action,
|
||||||
int event_serial,
|
|
||||||
int button,
|
int button,
|
||||||
gulong modmask,
|
gulong modmask,
|
||||||
guint32 timestamp,
|
guint32 timestamp,
|
||||||
|
@ -1406,7 +1406,6 @@ meta_frames_button_press_event (GtkWidget *widget,
|
|||||||
op,
|
op,
|
||||||
TRUE,
|
TRUE,
|
||||||
TRUE,
|
TRUE,
|
||||||
meta_ui_get_last_event_serial (gdk_display),
|
|
||||||
event->button,
|
event->button,
|
||||||
0,
|
0,
|
||||||
event->time,
|
event->time,
|
||||||
@ -1497,7 +1496,6 @@ meta_frames_button_press_event (GtkWidget *widget,
|
|||||||
op,
|
op,
|
||||||
TRUE,
|
TRUE,
|
||||||
TRUE,
|
TRUE,
|
||||||
meta_ui_get_last_event_serial (gdk_display),
|
|
||||||
event->button,
|
event->button,
|
||||||
0,
|
0,
|
||||||
event->time,
|
event->time,
|
||||||
@ -1518,7 +1516,6 @@ meta_frames_button_press_event (GtkWidget *widget,
|
|||||||
META_GRAB_OP_MOVING,
|
META_GRAB_OP_MOVING,
|
||||||
TRUE,
|
TRUE,
|
||||||
TRUE,
|
TRUE,
|
||||||
meta_ui_get_last_event_serial (gdk_display),
|
|
||||||
event->button,
|
event->button,
|
||||||
0,
|
0,
|
||||||
event->time,
|
event->time,
|
||||||
|
@ -3332,7 +3332,6 @@ do_choose_window (MetaDisplay *display,
|
|||||||
cycle_op_from_tab_type (type),
|
cycle_op_from_tab_type (type),
|
||||||
FALSE,
|
FALSE,
|
||||||
FALSE,
|
FALSE,
|
||||||
event->xkey.serial,
|
|
||||||
0,
|
0,
|
||||||
binding->mask,
|
binding->mask,
|
||||||
event->xkey.time,
|
event->xkey.time,
|
||||||
@ -3768,7 +3767,6 @@ handle_workspace_switch (MetaDisplay *display,
|
|||||||
META_GRAB_OP_KEYBOARD_WORKSPACE_SWITCHING,
|
META_GRAB_OP_KEYBOARD_WORKSPACE_SWITCHING,
|
||||||
FALSE,
|
FALSE,
|
||||||
FALSE,
|
FALSE,
|
||||||
event->xkey.serial,
|
|
||||||
0,
|
0,
|
||||||
grab_mask,
|
grab_mask,
|
||||||
event->xkey.time,
|
event->xkey.time,
|
||||||
|
19
src/ui.c
19
src/ui.c
@ -71,7 +71,6 @@ struct _EventFunc
|
|||||||
{
|
{
|
||||||
MetaEventFunc func;
|
MetaEventFunc func;
|
||||||
gpointer data;
|
gpointer data;
|
||||||
int last_event_serial;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
static EventFunc *ef = NULL;
|
static EventFunc *ef = NULL;
|
||||||
@ -86,16 +85,8 @@ filter_func (GdkXEvent *xevent,
|
|||||||
if ((* ef->func) (xevent, ef->data))
|
if ((* ef->func) (xevent, ef->data))
|
||||||
return GDK_FILTER_REMOVE;
|
return GDK_FILTER_REMOVE;
|
||||||
else
|
else
|
||||||
{
|
|
||||||
/* ef would be NULL here if we removed the filter function
|
|
||||||
* in response to the event.
|
|
||||||
*/
|
|
||||||
if (ef != NULL)
|
|
||||||
ef->last_event_serial = ((XEvent*)xevent)->xany.serial;
|
|
||||||
|
|
||||||
return GDK_FILTER_CONTINUE;
|
return GDK_FILTER_CONTINUE;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
void
|
void
|
||||||
meta_ui_add_event_func (Display *xdisplay,
|
meta_ui_add_event_func (Display *xdisplay,
|
||||||
@ -125,16 +116,6 @@ meta_ui_remove_event_func (Display *xdisplay,
|
|||||||
ef = NULL;
|
ef = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
|
||||||
meta_ui_get_last_event_serial (Display *xdisplay)
|
|
||||||
{
|
|
||||||
g_assert (ef != NULL);
|
|
||||||
|
|
||||||
/* This is technically broken since it's not per-display */
|
|
||||||
|
|
||||||
return ef->last_event_serial;
|
|
||||||
}
|
|
||||||
|
|
||||||
MetaUI*
|
MetaUI*
|
||||||
meta_ui_new (Display *xdisplay,
|
meta_ui_new (Display *xdisplay,
|
||||||
Screen *screen)
|
Screen *screen)
|
||||||
|
10
src/window.c
10
src/window.c
@ -4957,7 +4957,6 @@ meta_window_client_message (MetaWindow *window,
|
|||||||
op,
|
op,
|
||||||
FALSE,
|
FALSE,
|
||||||
frame_action,
|
frame_action,
|
||||||
0 /* event_serial */,
|
|
||||||
button, 0,
|
button, 0,
|
||||||
timestamp,
|
timestamp,
|
||||||
x_root,
|
x_root,
|
||||||
@ -7762,9 +7761,6 @@ meta_window_begin_grab_op (MetaWindow *window,
|
|||||||
guint32 timestamp)
|
guint32 timestamp)
|
||||||
{
|
{
|
||||||
int x, y;
|
int x, y;
|
||||||
gulong grab_start_serial;
|
|
||||||
|
|
||||||
grab_start_serial = XNextRequest (window->display->xdisplay);
|
|
||||||
|
|
||||||
warp_grab_pointer (window,
|
warp_grab_pointer (window,
|
||||||
op, &x, &y);
|
op, &x, &y);
|
||||||
@ -7775,16 +7771,10 @@ meta_window_begin_grab_op (MetaWindow *window,
|
|||||||
op,
|
op,
|
||||||
FALSE,
|
FALSE,
|
||||||
frame_action,
|
frame_action,
|
||||||
grab_start_serial /* event_serial */,
|
|
||||||
0 /* button */,
|
0 /* button */,
|
||||||
0,
|
0,
|
||||||
timestamp,
|
timestamp,
|
||||||
x, y);
|
x, y);
|
||||||
|
|
||||||
/* We override the one set in display_begin_grab_op since we
|
|
||||||
* did additional stuff as part of the grabbing process
|
|
||||||
*/
|
|
||||||
window->display->grab_start_serial = grab_start_serial;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
Loading…
x
Reference in New Issue
Block a user