add an event_serial argument and use it when the pointer is already

2003-11-24  Havoc Pennington  <hp@redhat.com>

	* src/display.c (meta_display_begin_grab_op): add an event_serial
	argument and use it when the pointer is already grabbed
	automatically on the button press. May fix bug #126871
This commit is contained in:
Havoc Pennington
2003-11-24 18:09:47 +00:00
committed by Havoc Pennington
parent feefcdd892
commit 423b5f5f39
9 changed files with 45 additions and 4 deletions

View File

@@ -69,6 +69,7 @@ struct _EventFunc
{
MetaEventFunc func;
gpointer data;
int last_event_serial;
};
static GdkFilterReturn
@@ -83,7 +84,10 @@ filter_func (GdkXEvent *xevent,
if ((* ef->func) (xevent, ef->data))
return GDK_FILTER_REMOVE;
else
return GDK_FILTER_CONTINUE;
{
ef->last_event_serial = ((XEvent*)xevent)->xany.serial;
return GDK_FILTER_CONTINUE;
}
}
static EventFunc *ef = NULL;
@@ -116,6 +120,16 @@ 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)