mirror of
https://github.com/brl/mutter.git
synced 2024-11-24 17:10:40 -05: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>
|
||||
|
||||
Fix move/resize events in relation to combinations of
|
||||
|
@ -630,7 +630,6 @@ meta_core_begin_grab_op (Display *xdisplay,
|
||||
MetaGrabOp op,
|
||||
gboolean pointer_already_grabbed,
|
||||
gboolean frame_action,
|
||||
int event_serial,
|
||||
int button,
|
||||
gulong modmask,
|
||||
guint32 timestamp,
|
||||
@ -649,7 +648,6 @@ meta_core_begin_grab_op (Display *xdisplay,
|
||||
return meta_display_begin_grab_op (display, screen, window,
|
||||
op, pointer_already_grabbed,
|
||||
frame_action,
|
||||
event_serial,
|
||||
button, modmask,
|
||||
timestamp, root_x, root_y);
|
||||
}
|
||||
|
@ -151,7 +151,6 @@ gboolean meta_core_begin_grab_op (Display *xdisplay,
|
||||
MetaGrabOp op,
|
||||
gboolean pointer_already_grabbed,
|
||||
gboolean frame_action,
|
||||
int event_serial,
|
||||
int button,
|
||||
gulong modmask,
|
||||
guint32 timestamp,
|
||||
@ -182,8 +181,6 @@ void meta_core_get_screen_size (Display *xdisplay,
|
||||
*/
|
||||
void meta_core_increment_event_serial (Display *display);
|
||||
|
||||
int meta_ui_get_last_event_serial (Display *xdisplay);
|
||||
|
||||
void meta_invalidate_default_icons (void);
|
||||
|
||||
#endif
|
||||
|
@ -1570,7 +1570,6 @@ event_callback (XEvent *event,
|
||||
|
||||
if (display->grab_op != META_GRAB_OP_NONE &&
|
||||
display->grab_window != NULL &&
|
||||
event->xany.serial >= display->grab_start_serial &&
|
||||
grab_op_is_mouse (display->grab_op))
|
||||
meta_window_handle_mouse_grab_op_event (display->grab_window, event);
|
||||
}
|
||||
@ -1656,7 +1655,6 @@ event_callback (XEvent *event,
|
||||
if ((window &&
|
||||
grab_op_is_mouse (display->grab_op) &&
|
||||
display->grab_button != (int) event->xbutton.button &&
|
||||
event->xany.serial >= display->grab_start_serial &&
|
||||
display->grab_window == window) ||
|
||||
grab_op_is_keyboard (display->grab_op))
|
||||
{
|
||||
@ -1776,7 +1774,6 @@ event_callback (XEvent *event,
|
||||
op,
|
||||
TRUE,
|
||||
FALSE,
|
||||
event->xbutton.serial,
|
||||
event->xbutton.button,
|
||||
0,
|
||||
event->xbutton.time,
|
||||
@ -1834,7 +1831,6 @@ event_callback (XEvent *event,
|
||||
META_GRAB_OP_MOVING,
|
||||
TRUE,
|
||||
FALSE,
|
||||
event->xbutton.serial,
|
||||
event->xbutton.button,
|
||||
0,
|
||||
event->xbutton.time,
|
||||
@ -1845,19 +1841,16 @@ event_callback (XEvent *event,
|
||||
break;
|
||||
case ButtonRelease:
|
||||
if (display->grab_window == window &&
|
||||
event->xany.serial >= display->grab_start_serial &&
|
||||
grab_op_is_mouse (display->grab_op))
|
||||
meta_window_handle_mouse_grab_op_event (window, event);
|
||||
break;
|
||||
case MotionNotify:
|
||||
if (display->grab_window == window &&
|
||||
event->xany.serial >= display->grab_start_serial &&
|
||||
grab_op_is_mouse (display->grab_op))
|
||||
meta_window_handle_mouse_grab_op_event (window, event);
|
||||
break;
|
||||
case EnterNotify:
|
||||
if (display->grab_window == window &&
|
||||
event->xany.serial >= display->grab_start_serial &&
|
||||
grab_op_is_mouse (display->grab_op))
|
||||
{
|
||||
meta_window_handle_mouse_grab_op_event (window, event);
|
||||
@ -1951,7 +1944,6 @@ event_callback (XEvent *event,
|
||||
break;
|
||||
case LeaveNotify:
|
||||
if (display->grab_window == window &&
|
||||
event->xany.serial >= display->grab_start_serial &&
|
||||
grab_op_is_mouse (display->grab_op))
|
||||
meta_window_handle_mouse_grab_op_event (window, event);
|
||||
else if (window != NULL)
|
||||
@ -3305,7 +3297,6 @@ meta_display_begin_grab_op (MetaDisplay *display,
|
||||
MetaGrabOp op,
|
||||
gboolean pointer_already_grabbed,
|
||||
gboolean frame_action,
|
||||
int event_serial,
|
||||
int button,
|
||||
gulong modmask,
|
||||
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:
|
||||
* If we have no MetaWindow we do our best
|
||||
* and try to do the grab on the RootWindow.
|
||||
|
@ -254,7 +254,6 @@ struct _MetaDisplay
|
||||
MetaScreen *grab_screen;
|
||||
MetaWindow *grab_window;
|
||||
Window grab_xwindow;
|
||||
gulong grab_start_serial;
|
||||
int grab_button;
|
||||
int grab_anchor_root_x;
|
||||
int grab_anchor_root_y;
|
||||
@ -450,7 +449,6 @@ gboolean meta_display_begin_grab_op (MetaDisplay *display,
|
||||
MetaGrabOp op,
|
||||
gboolean pointer_already_grabbed,
|
||||
gboolean frame_action,
|
||||
int event_serial,
|
||||
int button,
|
||||
gulong modmask,
|
||||
guint32 timestamp,
|
||||
|
@ -1406,7 +1406,6 @@ meta_frames_button_press_event (GtkWidget *widget,
|
||||
op,
|
||||
TRUE,
|
||||
TRUE,
|
||||
meta_ui_get_last_event_serial (gdk_display),
|
||||
event->button,
|
||||
0,
|
||||
event->time,
|
||||
@ -1497,7 +1496,6 @@ meta_frames_button_press_event (GtkWidget *widget,
|
||||
op,
|
||||
TRUE,
|
||||
TRUE,
|
||||
meta_ui_get_last_event_serial (gdk_display),
|
||||
event->button,
|
||||
0,
|
||||
event->time,
|
||||
@ -1518,7 +1516,6 @@ meta_frames_button_press_event (GtkWidget *widget,
|
||||
META_GRAB_OP_MOVING,
|
||||
TRUE,
|
||||
TRUE,
|
||||
meta_ui_get_last_event_serial (gdk_display),
|
||||
event->button,
|
||||
0,
|
||||
event->time,
|
||||
|
@ -3332,7 +3332,6 @@ do_choose_window (MetaDisplay *display,
|
||||
cycle_op_from_tab_type (type),
|
||||
FALSE,
|
||||
FALSE,
|
||||
event->xkey.serial,
|
||||
0,
|
||||
binding->mask,
|
||||
event->xkey.time,
|
||||
@ -3768,7 +3767,6 @@ handle_workspace_switch (MetaDisplay *display,
|
||||
META_GRAB_OP_KEYBOARD_WORKSPACE_SWITCHING,
|
||||
FALSE,
|
||||
FALSE,
|
||||
event->xkey.serial,
|
||||
0,
|
||||
grab_mask,
|
||||
event->xkey.time,
|
||||
|
21
src/ui.c
21
src/ui.c
@ -71,7 +71,6 @@ struct _EventFunc
|
||||
{
|
||||
MetaEventFunc func;
|
||||
gpointer data;
|
||||
int last_event_serial;
|
||||
};
|
||||
|
||||
static EventFunc *ef = NULL;
|
||||
@ -86,15 +85,7 @@ filter_func (GdkXEvent *xevent,
|
||||
if ((* ef->func) (xevent, ef->data))
|
||||
return GDK_FILTER_REMOVE;
|
||||
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
|
||||
@ -125,16 +116,6 @@ meta_ui_remove_event_func (Display *xdisplay,
|
||||
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*
|
||||
meta_ui_new (Display *xdisplay,
|
||||
Screen *screen)
|
||||
|
10
src/window.c
10
src/window.c
@ -4957,7 +4957,6 @@ meta_window_client_message (MetaWindow *window,
|
||||
op,
|
||||
FALSE,
|
||||
frame_action,
|
||||
0 /* event_serial */,
|
||||
button, 0,
|
||||
timestamp,
|
||||
x_root,
|
||||
@ -7762,10 +7761,7 @@ meta_window_begin_grab_op (MetaWindow *window,
|
||||
guint32 timestamp)
|
||||
{
|
||||
int x, y;
|
||||
gulong grab_start_serial;
|
||||
|
||||
grab_start_serial = XNextRequest (window->display->xdisplay);
|
||||
|
||||
warp_grab_pointer (window,
|
||||
op, &x, &y);
|
||||
|
||||
@ -7775,16 +7771,10 @@ meta_window_begin_grab_op (MetaWindow *window,
|
||||
op,
|
||||
FALSE,
|
||||
frame_action,
|
||||
grab_start_serial /* event_serial */,
|
||||
0 /* button */,
|
||||
0,
|
||||
timestamp,
|
||||
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
|
||||
|
Loading…
Reference in New Issue
Block a user