Commit 9012254c authored by Alexander Larsson's avatar Alexander Larsson Committed by Alexander Larsson

Doh! Mixed up x and y.

2001-01-17    <alexl@redhat.com>

	* gdk/linux-fb/gdkdrawable-fb2.c (gdk_shadow_fb_draw_arc):
	Doh! Mixed up x and y.

	* gdk/linux-fb/gdkglobals-fb.c:
	Removed gdk_fb_pointer_grab_window_events,
	added _gdk_fb_pointer_grab_owner_events and
	_gdk_fb_keyboard_grab_owner_events.

	* gdk/linux-fb/gdkmain-fb.c (gdk_fb_pointer_grab):
	Set all button mask if GDK_BUTTON_MOTION_MASK set. Send
	crossing events before grabbing. Set _gdk_fb_pointer_grab_owner_events.
	(gdk_fb_pointer_ungrab): Unset _gdk_fb_pointer_grab_owner_events
	Send crossing events after ungrab finished.
	(gdk_keyboard_grab): Set ..._owner_events
	(type_masks): Move out of function.
	(gdk_fb_other_event_window, gdk_fb_pointer_event_window,
	gdk_fb_keyboard_event_window): New functions, return the
	window an event should be targeted at. Handles grabs and
	event propagation. Can return NULL.
	(gdk_event_make): Remove event_mask checking. Now always
	returns an event.

	* gdk/linux-fb/gdkkeyboard-fb.c:
	* gdk/linux-fb/gdkproperty-fb.c:
	* gdk/linux-fb/gdkselection-fb.c:
	Use new event_window/gdk_event_make() behaviour.

	* gdk/linux-fb/gdkmouse-fb.c:
	Use new event_window/gdk_event_make() behaviour.
	Only send motion events if in the same window.
	If grabbed, use cursor from window if sibling of grabbed
	window, and cursor from grabbed window otherwise.

	* gdk/linux-fb/gdkprivate-fb.h:
	Update gdk_fb_window_send_crossing_events, gdk_event_make
	and grab varaible declarations. Add gdk_fb_*_event_window().

	* gdk/linux-fb/gdkwindow-fb.c:
	Use new event_window/gdk_event_make() behaviour.
	Keep correct track of focus window.
	(gdk_window_set_events): Set all specific button motion masks
	if GDK_BUTTON_MOTION_MASK set.

	* gtk/gtkdnd.c (gtk_drag_update):
	Free info->last_event if gdk_drag_motion returned FALSE.
parent 2d28a303
2001-01-17 <alexl@redhat.com>
* gdk/linux-fb/gdkdrawable-fb2.c (gdk_shadow_fb_draw_arc):
Doh! Mixed up x and y.
* gdk/linux-fb/gdkglobals-fb.c:
Removed gdk_fb_pointer_grab_window_events,
added _gdk_fb_pointer_grab_owner_events and
_gdk_fb_keyboard_grab_owner_events.
* gdk/linux-fb/gdkmain-fb.c (gdk_fb_pointer_grab):
Set all button mask if GDK_BUTTON_MOTION_MASK set. Send
crossing events before grabbing. Set _gdk_fb_pointer_grab_owner_events.
(gdk_fb_pointer_ungrab): Unset _gdk_fb_pointer_grab_owner_events
Send crossing events after ungrab finished.
(gdk_keyboard_grab): Set ..._owner_events
(type_masks): Move out of function.
(gdk_fb_other_event_window, gdk_fb_pointer_event_window,
gdk_fb_keyboard_event_window): New functions, return the
window an event should be targeted at. Handles grabs and
event propagation. Can return NULL.
(gdk_event_make): Remove event_mask checking. Now always
returns an event.
* gdk/linux-fb/gdkkeyboard-fb.c:
* gdk/linux-fb/gdkproperty-fb.c:
* gdk/linux-fb/gdkselection-fb.c:
Use new event_window/gdk_event_make() behaviour.
* gdk/linux-fb/gdkmouse-fb.c:
Use new event_window/gdk_event_make() behaviour.
Only send motion events if in the same window.
If grabbed, use cursor from window if sibling of grabbed
window, and cursor from grabbed window otherwise.
* gdk/linux-fb/gdkprivate-fb.h:
Update gdk_fb_window_send_crossing_events, gdk_event_make
and grab varaible declarations. Add gdk_fb_*_event_window().
* gdk/linux-fb/gdkwindow-fb.c:
Use new event_window/gdk_event_make() behaviour.
Keep correct track of focus window.
(gdk_window_set_events): Set all specific button motion masks
if GDK_BUTTON_MOTION_MASK set.
* gtk/gtkdnd.c (gtk_drag_update):
Free info->last_event if gdk_drag_motion returned FALSE.
Tue Jan 16 13:13:13 GMT 2001 Tony Gale <gale@gtk.org>
* docs/faq/gtk-faq.sgml: FAQ update:
......
2001-01-17 <alexl@redhat.com>
* gdk/linux-fb/gdkdrawable-fb2.c (gdk_shadow_fb_draw_arc):
Doh! Mixed up x and y.
* gdk/linux-fb/gdkglobals-fb.c:
Removed gdk_fb_pointer_grab_window_events,
added _gdk_fb_pointer_grab_owner_events and
_gdk_fb_keyboard_grab_owner_events.
* gdk/linux-fb/gdkmain-fb.c (gdk_fb_pointer_grab):
Set all button mask if GDK_BUTTON_MOTION_MASK set. Send
crossing events before grabbing. Set _gdk_fb_pointer_grab_owner_events.
(gdk_fb_pointer_ungrab): Unset _gdk_fb_pointer_grab_owner_events
Send crossing events after ungrab finished.
(gdk_keyboard_grab): Set ..._owner_events
(type_masks): Move out of function.
(gdk_fb_other_event_window, gdk_fb_pointer_event_window,
gdk_fb_keyboard_event_window): New functions, return the
window an event should be targeted at. Handles grabs and
event propagation. Can return NULL.
(gdk_event_make): Remove event_mask checking. Now always
returns an event.
* gdk/linux-fb/gdkkeyboard-fb.c:
* gdk/linux-fb/gdkproperty-fb.c:
* gdk/linux-fb/gdkselection-fb.c:
Use new event_window/gdk_event_make() behaviour.
* gdk/linux-fb/gdkmouse-fb.c:
Use new event_window/gdk_event_make() behaviour.
Only send motion events if in the same window.
If grabbed, use cursor from window if sibling of grabbed
window, and cursor from grabbed window otherwise.
* gdk/linux-fb/gdkprivate-fb.h:
Update gdk_fb_window_send_crossing_events, gdk_event_make
and grab varaible declarations. Add gdk_fb_*_event_window().
* gdk/linux-fb/gdkwindow-fb.c:
Use new event_window/gdk_event_make() behaviour.
Keep correct track of focus window.
(gdk_window_set_events): Set all specific button motion masks
if GDK_BUTTON_MOTION_MASK set.
* gtk/gtkdnd.c (gtk_drag_update):
Free info->last_event if gdk_drag_motion returned FALSE.
Tue Jan 16 13:13:13 GMT 2001 Tony Gale <gale@gtk.org>
* docs/faq/gtk-faq.sgml: FAQ update:
......
2001-01-17 <alexl@redhat.com>
* gdk/linux-fb/gdkdrawable-fb2.c (gdk_shadow_fb_draw_arc):
Doh! Mixed up x and y.
* gdk/linux-fb/gdkglobals-fb.c:
Removed gdk_fb_pointer_grab_window_events,
added _gdk_fb_pointer_grab_owner_events and
_gdk_fb_keyboard_grab_owner_events.
* gdk/linux-fb/gdkmain-fb.c (gdk_fb_pointer_grab):
Set all button mask if GDK_BUTTON_MOTION_MASK set. Send
crossing events before grabbing. Set _gdk_fb_pointer_grab_owner_events.
(gdk_fb_pointer_ungrab): Unset _gdk_fb_pointer_grab_owner_events
Send crossing events after ungrab finished.
(gdk_keyboard_grab): Set ..._owner_events
(type_masks): Move out of function.
(gdk_fb_other_event_window, gdk_fb_pointer_event_window,
gdk_fb_keyboard_event_window): New functions, return the
window an event should be targeted at. Handles grabs and
event propagation. Can return NULL.
(gdk_event_make): Remove event_mask checking. Now always
returns an event.
* gdk/linux-fb/gdkkeyboard-fb.c:
* gdk/linux-fb/gdkproperty-fb.c:
* gdk/linux-fb/gdkselection-fb.c:
Use new event_window/gdk_event_make() behaviour.
* gdk/linux-fb/gdkmouse-fb.c:
Use new event_window/gdk_event_make() behaviour.
Only send motion events if in the same window.
If grabbed, use cursor from window if sibling of grabbed
window, and cursor from grabbed window otherwise.
* gdk/linux-fb/gdkprivate-fb.h:
Update gdk_fb_window_send_crossing_events, gdk_event_make
and grab varaible declarations. Add gdk_fb_*_event_window().
* gdk/linux-fb/gdkwindow-fb.c:
Use new event_window/gdk_event_make() behaviour.
Keep correct track of focus window.
(gdk_window_set_events): Set all specific button motion masks
if GDK_BUTTON_MOTION_MASK set.
* gtk/gtkdnd.c (gtk_drag_update):
Free info->last_event if gdk_drag_motion returned FALSE.
Tue Jan 16 13:13:13 GMT 2001 Tony Gale <gale@gtk.org>
* docs/faq/gtk-faq.sgml: FAQ update:
......
2001-01-17 <alexl@redhat.com>
* gdk/linux-fb/gdkdrawable-fb2.c (gdk_shadow_fb_draw_arc):
Doh! Mixed up x and y.
* gdk/linux-fb/gdkglobals-fb.c:
Removed gdk_fb_pointer_grab_window_events,
added _gdk_fb_pointer_grab_owner_events and
_gdk_fb_keyboard_grab_owner_events.
* gdk/linux-fb/gdkmain-fb.c (gdk_fb_pointer_grab):
Set all button mask if GDK_BUTTON_MOTION_MASK set. Send
crossing events before grabbing. Set _gdk_fb_pointer_grab_owner_events.
(gdk_fb_pointer_ungrab): Unset _gdk_fb_pointer_grab_owner_events
Send crossing events after ungrab finished.
(gdk_keyboard_grab): Set ..._owner_events
(type_masks): Move out of function.
(gdk_fb_other_event_window, gdk_fb_pointer_event_window,
gdk_fb_keyboard_event_window): New functions, return the
window an event should be targeted at. Handles grabs and
event propagation. Can return NULL.
(gdk_event_make): Remove event_mask checking. Now always
returns an event.
* gdk/linux-fb/gdkkeyboard-fb.c:
* gdk/linux-fb/gdkproperty-fb.c:
* gdk/linux-fb/gdkselection-fb.c:
Use new event_window/gdk_event_make() behaviour.
* gdk/linux-fb/gdkmouse-fb.c:
Use new event_window/gdk_event_make() behaviour.
Only send motion events if in the same window.
If grabbed, use cursor from window if sibling of grabbed
window, and cursor from grabbed window otherwise.
* gdk/linux-fb/gdkprivate-fb.h:
Update gdk_fb_window_send_crossing_events, gdk_event_make
and grab varaible declarations. Add gdk_fb_*_event_window().
* gdk/linux-fb/gdkwindow-fb.c:
Use new event_window/gdk_event_make() behaviour.
Keep correct track of focus window.
(gdk_window_set_events): Set all specific button motion masks
if GDK_BUTTON_MOTION_MASK set.
* gtk/gtkdnd.c (gtk_drag_update):
Free info->last_event if gdk_drag_motion returned FALSE.
Tue Jan 16 13:13:13 GMT 2001 Tony Gale <gale@gtk.org>
* docs/faq/gtk-faq.sgml: FAQ update:
......
2001-01-17 <alexl@redhat.com>
* gdk/linux-fb/gdkdrawable-fb2.c (gdk_shadow_fb_draw_arc):
Doh! Mixed up x and y.
* gdk/linux-fb/gdkglobals-fb.c:
Removed gdk_fb_pointer_grab_window_events,
added _gdk_fb_pointer_grab_owner_events and
_gdk_fb_keyboard_grab_owner_events.
* gdk/linux-fb/gdkmain-fb.c (gdk_fb_pointer_grab):
Set all button mask if GDK_BUTTON_MOTION_MASK set. Send
crossing events before grabbing. Set _gdk_fb_pointer_grab_owner_events.
(gdk_fb_pointer_ungrab): Unset _gdk_fb_pointer_grab_owner_events
Send crossing events after ungrab finished.
(gdk_keyboard_grab): Set ..._owner_events
(type_masks): Move out of function.
(gdk_fb_other_event_window, gdk_fb_pointer_event_window,
gdk_fb_keyboard_event_window): New functions, return the
window an event should be targeted at. Handles grabs and
event propagation. Can return NULL.
(gdk_event_make): Remove event_mask checking. Now always
returns an event.
* gdk/linux-fb/gdkkeyboard-fb.c:
* gdk/linux-fb/gdkproperty-fb.c:
* gdk/linux-fb/gdkselection-fb.c:
Use new event_window/gdk_event_make() behaviour.
* gdk/linux-fb/gdkmouse-fb.c:
Use new event_window/gdk_event_make() behaviour.
Only send motion events if in the same window.
If grabbed, use cursor from window if sibling of grabbed
window, and cursor from grabbed window otherwise.
* gdk/linux-fb/gdkprivate-fb.h:
Update gdk_fb_window_send_crossing_events, gdk_event_make
and grab varaible declarations. Add gdk_fb_*_event_window().
* gdk/linux-fb/gdkwindow-fb.c:
Use new event_window/gdk_event_make() behaviour.
Keep correct track of focus window.
(gdk_window_set_events): Set all specific button motion masks
if GDK_BUTTON_MOTION_MASK set.
* gtk/gtkdnd.c (gtk_drag_update):
Free info->last_event if gdk_drag_motion returned FALSE.
Tue Jan 16 13:13:13 GMT 2001 Tony Gale <gale@gtk.org>
* docs/faq/gtk-faq.sgml: FAQ update:
......
2001-01-17 <alexl@redhat.com>
* gdk/linux-fb/gdkdrawable-fb2.c (gdk_shadow_fb_draw_arc):
Doh! Mixed up x and y.
* gdk/linux-fb/gdkglobals-fb.c:
Removed gdk_fb_pointer_grab_window_events,
added _gdk_fb_pointer_grab_owner_events and
_gdk_fb_keyboard_grab_owner_events.
* gdk/linux-fb/gdkmain-fb.c (gdk_fb_pointer_grab):
Set all button mask if GDK_BUTTON_MOTION_MASK set. Send
crossing events before grabbing. Set _gdk_fb_pointer_grab_owner_events.
(gdk_fb_pointer_ungrab): Unset _gdk_fb_pointer_grab_owner_events
Send crossing events after ungrab finished.
(gdk_keyboard_grab): Set ..._owner_events
(type_masks): Move out of function.
(gdk_fb_other_event_window, gdk_fb_pointer_event_window,
gdk_fb_keyboard_event_window): New functions, return the
window an event should be targeted at. Handles grabs and
event propagation. Can return NULL.
(gdk_event_make): Remove event_mask checking. Now always
returns an event.
* gdk/linux-fb/gdkkeyboard-fb.c:
* gdk/linux-fb/gdkproperty-fb.c:
* gdk/linux-fb/gdkselection-fb.c:
Use new event_window/gdk_event_make() behaviour.
* gdk/linux-fb/gdkmouse-fb.c:
Use new event_window/gdk_event_make() behaviour.
Only send motion events if in the same window.
If grabbed, use cursor from window if sibling of grabbed
window, and cursor from grabbed window otherwise.
* gdk/linux-fb/gdkprivate-fb.h:
Update gdk_fb_window_send_crossing_events, gdk_event_make
and grab varaible declarations. Add gdk_fb_*_event_window().
* gdk/linux-fb/gdkwindow-fb.c:
Use new event_window/gdk_event_make() behaviour.
Keep correct track of focus window.
(gdk_window_set_events): Set all specific button motion masks
if GDK_BUTTON_MOTION_MASK set.
* gtk/gtkdnd.c (gtk_drag_update):
Free info->last_event if gdk_drag_motion returned FALSE.
Tue Jan 16 13:13:13 GMT 2001 Tony Gale <gale@gtk.org>
* docs/faq/gtk-faq.sgml: FAQ update:
......
2001-01-17 <alexl@redhat.com>
* gdk/linux-fb/gdkdrawable-fb2.c (gdk_shadow_fb_draw_arc):
Doh! Mixed up x and y.
* gdk/linux-fb/gdkglobals-fb.c:
Removed gdk_fb_pointer_grab_window_events,
added _gdk_fb_pointer_grab_owner_events and
_gdk_fb_keyboard_grab_owner_events.
* gdk/linux-fb/gdkmain-fb.c (gdk_fb_pointer_grab):
Set all button mask if GDK_BUTTON_MOTION_MASK set. Send
crossing events before grabbing. Set _gdk_fb_pointer_grab_owner_events.
(gdk_fb_pointer_ungrab): Unset _gdk_fb_pointer_grab_owner_events
Send crossing events after ungrab finished.
(gdk_keyboard_grab): Set ..._owner_events
(type_masks): Move out of function.
(gdk_fb_other_event_window, gdk_fb_pointer_event_window,
gdk_fb_keyboard_event_window): New functions, return the
window an event should be targeted at. Handles grabs and
event propagation. Can return NULL.
(gdk_event_make): Remove event_mask checking. Now always
returns an event.
* gdk/linux-fb/gdkkeyboard-fb.c:
* gdk/linux-fb/gdkproperty-fb.c:
* gdk/linux-fb/gdkselection-fb.c:
Use new event_window/gdk_event_make() behaviour.
* gdk/linux-fb/gdkmouse-fb.c:
Use new event_window/gdk_event_make() behaviour.
Only send motion events if in the same window.
If grabbed, use cursor from window if sibling of grabbed
window, and cursor from grabbed window otherwise.
* gdk/linux-fb/gdkprivate-fb.h:
Update gdk_fb_window_send_crossing_events, gdk_event_make
and grab varaible declarations. Add gdk_fb_*_event_window().
* gdk/linux-fb/gdkwindow-fb.c:
Use new event_window/gdk_event_make() behaviour.
Keep correct track of focus window.
(gdk_window_set_events): Set all specific button motion masks
if GDK_BUTTON_MOTION_MASK set.
* gtk/gtkdnd.c (gtk_drag_update):
Free info->last_event if gdk_drag_motion returned FALSE.
Tue Jan 16 13:13:13 GMT 2001 Tony Gale <gale@gtk.org>
* docs/faq/gtk-faq.sgml: FAQ update:
......
......@@ -1249,9 +1249,9 @@ gdk_shadow_fb_draw_arc (GdkDrawable *drawable,
gint extra_width;
minx = x + private->abs_x;
miny = x + private->abs_y;
miny = y + private->abs_y;
maxx = x + width + private->abs_x;
maxy = y + height + private->abs_x;
maxy = y + height + private->abs_y;
if (!filled)
{
......
......@@ -33,7 +33,9 @@
const gchar *gdk_progclass = "none";
gboolean gdk_null_window_warnings = TRUE;
GdkWindow *_gdk_fb_pointer_grab_window, *_gdk_fb_pointer_grab_window_events, *_gdk_fb_keyboard_grab_window, *_gdk_fb_pointer_grab_confine = NULL;
GdkWindow *_gdk_fb_pointer_grab_window, *_gdk_fb_keyboard_grab_window, *_gdk_fb_pointer_grab_confine = NULL;
gboolean _gdk_fb_pointer_grab_owner_events;
gboolean _gdk_fb_keyboard_grab_owner_events;
GdkEventMask _gdk_fb_pointer_grab_events, _gdk_fb_keyboard_grab_events;
GdkFBWindow *gdk_root_window = NULL;
......
......@@ -371,12 +371,14 @@ gdk_fb_handle_key (guint hw_keycode,
gdk_fb_redraw_all ();
}
win = gdk_fb_window_find_focus ();
event = gdk_event_make (win,
key_up ? GDK_KEY_RELEASE : GDK_KEY_PRESS,
TRUE);
if (event)
win = gdk_fb_keyboard_event_window (gdk_fb_window_find_focus (),
key_up ? GDK_KEY_RELEASE : GDK_KEY_PRESS);
if (win)
{
event = gdk_event_make (win,
key_up ? GDK_KEY_RELEASE : GDK_KEY_PRESS,
TRUE);
event->key.state = modifier_state;
event->key.keyval = keyval;
event->key.string = string;
......
......@@ -743,21 +743,30 @@ gdk_fb_pointer_grab (GdkWindow * window,
gdk_pointer_ungrab (time);
}
gdk_fb_window_send_crossing_events (NULL,
window,
GDK_CROSSING_GRAB);
if (event_mask & GDK_BUTTON_MOTION_MASK)
event_mask |=
GDK_BUTTON1_MOTION_MASK |
GDK_BUTTON2_MOTION_MASK |
GDK_BUTTON3_MOTION_MASK;
_gdk_fb_pointer_implicit_grab = implicit_grab;
_gdk_fb_pointer_grab_window = gdk_window_ref (window);
_gdk_fb_pointer_grab_window_events = owner_events ? NULL : _gdk_fb_pointer_grab_window;
_gdk_fb_pointer_grab_owner_events = owner_events;
_gdk_fb_pointer_grab_confine = confine_to ? gdk_window_ref (confine_to) : NULL;
_gdk_fb_pointer_grab_events = event_mask;
_gdk_fb_pointer_grab_cursor = cursor ? gdk_cursor_ref (cursor) : NULL;
if (cursor)
gdk_fb_cursor_reset ();
gdk_fb_window_send_crossing_events (window,
GDK_CROSSING_GRAB);
return GDK_GRAB_SUCCESS;
}
......@@ -787,6 +796,7 @@ gdk_fb_pointer_ungrab (guint32 time, gboolean implicit_grab)
{
gboolean have_grab_cursor = _gdk_fb_pointer_grab_cursor && 1;
GdkWindow *mousewin;
GdkWindow *old_grab_window;
if (!_gdk_fb_pointer_grab_window)
return;
......@@ -805,16 +815,19 @@ gdk_fb_pointer_ungrab (guint32 time, gboolean implicit_grab)
if (have_grab_cursor)
gdk_fb_cursor_reset ();
mousewin = gdk_window_at_pointer (NULL, NULL);
gdk_fb_window_send_crossing_events (mousewin,
GDK_CROSSING_UNGRAB);
old_grab_window = _gdk_fb_pointer_grab_window;
if (_gdk_fb_pointer_grab_window)
gdk_window_unref (_gdk_fb_pointer_grab_window);
_gdk_fb_pointer_grab_window = NULL;
_gdk_fb_pointer_grab_window_events = NULL;
_gdk_fb_pointer_implicit_grab = FALSE;
mousewin = gdk_window_at_pointer (NULL, NULL);
gdk_fb_window_send_crossing_events (old_grab_window,
mousewin,
GDK_CROSSING_UNGRAB);
if (old_grab_window)
gdk_window_unref (old_grab_window);
}
/*
......@@ -869,8 +882,8 @@ gdk_keyboard_grab (GdkWindow * window,
if (_gdk_fb_pointer_grab_window)
gdk_keyboard_ungrab (time);
if (!owner_events)
_gdk_fb_keyboard_grab_window = gdk_window_ref (window);
_gdk_fb_keyboard_grab_window = gdk_window_ref (window);
_gdk_fb_keyboard_grab_owner_events = owner_events;
return GDK_GRAB_SUCCESS;
}
......@@ -1074,150 +1087,259 @@ gdk_beep (void)
}
/* utils */
GdkEvent *
gdk_event_make (GdkWindow *window,
GdkEventType type,
gboolean append_to_queue)
{
static const guint type_masks[] = {
GDK_SUBSTRUCTURE_MASK, /* GDK_DELETE = 0, */
GDK_STRUCTURE_MASK, /* GDK_DESTROY = 1, */
GDK_EXPOSURE_MASK, /* GDK_EXPOSE = 2, */
GDK_POINTER_MOTION_MASK, /* GDK_MOTION_NOTIFY = 3, */
GDK_BUTTON_PRESS_MASK, /* GDK_BUTTON_PRESS = 4, */
GDK_BUTTON_PRESS_MASK, /* GDK_2BUTTON_PRESS = 5, */
GDK_BUTTON_PRESS_MASK, /* GDK_3BUTTON_PRESS = 6, */
GDK_BUTTON_RELEASE_MASK, /* GDK_BUTTON_RELEASE = 7, */
GDK_KEY_PRESS_MASK, /* GDK_KEY_PRESS = 8, */
GDK_KEY_RELEASE_MASK, /* GDK_KEY_RELEASE = 9, */
GDK_ENTER_NOTIFY_MASK, /* GDK_ENTER_NOTIFY = 10, */
GDK_LEAVE_NOTIFY_MASK, /* GDK_LEAVE_NOTIFY = 11, */
GDK_FOCUS_CHANGE_MASK, /* GDK_FOCUS_CHANGE = 12, */
GDK_STRUCTURE_MASK, /* GDK_CONFIGURE = 13, */
GDK_VISIBILITY_NOTIFY_MASK, /* GDK_MAP = 14, */
GDK_VISIBILITY_NOTIFY_MASK, /* GDK_UNMAP = 15, */
GDK_PROPERTY_CHANGE_MASK, /* GDK_PROPERTY_NOTIFY = 16, */
GDK_PROPERTY_CHANGE_MASK, /* GDK_SELECTION_CLEAR = 17, */
GDK_PROPERTY_CHANGE_MASK, /* GDK_SELECTION_REQUEST = 18, */
GDK_PROPERTY_CHANGE_MASK, /* GDK_SELECTION_NOTIFY = 19, */
GDK_PROXIMITY_IN_MASK, /* GDK_PROXIMITY_IN = 20, */
GDK_PROXIMITY_OUT_MASK, /* GDK_PROXIMITY_OUT = 21, */
GDK_ALL_EVENTS_MASK, /* GDK_DRAG_ENTER = 22, */
GDK_ALL_EVENTS_MASK, /* GDK_DRAG_LEAVE = 23, */
GDK_ALL_EVENTS_MASK, /* GDK_DRAG_MOTION = 24, */
GDK_ALL_EVENTS_MASK, /* GDK_DRAG_STATUS = 25, */
GDK_ALL_EVENTS_MASK, /* GDK_DROP_START = 26, */
GDK_ALL_EVENTS_MASK, /* GDK_DROP_FINISHED = 27, */
GDK_ALL_EVENTS_MASK, /* GDK_CLIENT_EVENT = 28, */
GDK_VISIBILITY_NOTIFY_MASK, /* GDK_VISIBILITY_NOTIFY = 29, */
GDK_EXPOSURE_MASK, /* GDK_NO_EXPOSE = 30, */
GDK_SCROLL_MASK /* GDK_SCROLL = 31 */
};
guint evmask;
evmask = GDK_WINDOW_IMPL_FBDATA(window)->event_mask;
static const guint type_masks[] = {
GDK_SUBSTRUCTURE_MASK, /* GDK_DELETE = 0, */
GDK_STRUCTURE_MASK, /* GDK_DESTROY = 1, */
GDK_EXPOSURE_MASK, /* GDK_EXPOSE = 2, */
GDK_POINTER_MOTION_MASK, /* GDK_MOTION_NOTIFY = 3, */
GDK_BUTTON_PRESS_MASK, /* GDK_BUTTON_PRESS = 4, */
GDK_BUTTON_PRESS_MASK, /* GDK_2BUTTON_PRESS = 5, */
GDK_BUTTON_PRESS_MASK, /* GDK_3BUTTON_PRESS = 6, */
GDK_BUTTON_RELEASE_MASK, /* GDK_BUTTON_RELEASE = 7, */
GDK_KEY_PRESS_MASK, /* GDK_KEY_PRESS = 8, */
GDK_KEY_RELEASE_MASK, /* GDK_KEY_RELEASE = 9, */
GDK_ENTER_NOTIFY_MASK, /* GDK_ENTER_NOTIFY = 10, */
GDK_LEAVE_NOTIFY_MASK, /* GDK_LEAVE_NOTIFY = 11, */
GDK_FOCUS_CHANGE_MASK, /* GDK_FOCUS_CHANGE = 12, */
GDK_STRUCTURE_MASK, /* GDK_CONFIGURE = 13, */
GDK_VISIBILITY_NOTIFY_MASK, /* GDK_MAP = 14, */
GDK_VISIBILITY_NOTIFY_MASK, /* GDK_UNMAP = 15, */
GDK_PROPERTY_CHANGE_MASK, /* GDK_PROPERTY_NOTIFY = 16, */
GDK_PROPERTY_CHANGE_MASK, /* GDK_SELECTION_CLEAR = 17, */
GDK_PROPERTY_CHANGE_MASK, /* GDK_SELECTION_REQUEST = 18, */
GDK_PROPERTY_CHANGE_MASK, /* GDK_SELECTION_NOTIFY = 19, */
GDK_PROXIMITY_IN_MASK, /* GDK_PROXIMITY_IN = 20, */
GDK_PROXIMITY_OUT_MASK, /* GDK_PROXIMITY_OUT = 21, */
GDK_ALL_EVENTS_MASK, /* GDK_DRAG_ENTER = 22, */
GDK_ALL_EVENTS_MASK, /* GDK_DRAG_LEAVE = 23, */
GDK_ALL_EVENTS_MASK, /* GDK_DRAG_MOTION = 24, */
GDK_ALL_EVENTS_MASK, /* GDK_DRAG_STATUS = 25, */
GDK_ALL_EVENTS_MASK, /* GDK_DROP_START = 26, */
GDK_ALL_EVENTS_MASK, /* GDK_DROP_FINISHED = 27, */
GDK_ALL_EVENTS_MASK, /* GDK_CLIENT_EVENT = 28, */
GDK_VISIBILITY_NOTIFY_MASK, /* GDK_VISIBILITY_NOTIFY = 29, */
GDK_EXPOSURE_MASK, /* GDK_NO_EXPOSE = 30, */
GDK_SCROLL_MASK /* GDK_SCROLL = 31 */
};
/* Bad hack to make sure that things work semi-properly with owner_events */
if (_gdk_fb_pointer_grab_window)
evmask |= _gdk_fb_pointer_grab_events;
if (_gdk_fb_keyboard_grab_window)
evmask |= _gdk_fb_keyboard_grab_events;
GdkWindow *
gdk_fb_other_event_window (GdkWindow *window,
GdkEventType type)
{
guint32 evmask;
GdkWindow *w;
if (evmask & GDK_BUTTON_MOTION_MASK)
w = window;
while (w != gdk_parent_root)
{
evmask |= GDK_BUTTON1_MOTION_MASK|GDK_BUTTON2_MOTION_MASK|GDK_BUTTON3_MOTION_MASK;
/* Huge hack, so that we don't propagate events to GtkWindow->frame */
if ((w != window) &&
(GDK_WINDOW_P (w)->window_type != GDK_WINDOW_CHILD) &&
(g_object_get_data (G_OBJECT (w), "gdk-window-child-handler")))
break;
evmask = GDK_WINDOW_IMPL_FBDATA(window)->event_mask;
if (evmask & type_masks[type])
return w;
w = gdk_window_get_parent (w);
}
return NULL;
}
if (evmask & (GDK_BUTTON1_MOTION_MASK|GDK_BUTTON2_MOTION_MASK|GDK_BUTTON3_MOTION_MASK))
GdkWindow *
gdk_fb_pointer_event_window (GdkWindow *window,
GdkEventType type)
{
guint evmask;
GdkModifierType mask;
GdkWindow *w;
gdk_fb_mouse_get_info (NULL, NULL, &mask);
if (_gdk_fb_pointer_grab_window &&
!_gdk_fb_pointer_grab_owner_events)
{
GdkModifierType mask;
evmask = _gdk_fb_pointer_grab_events;
gdk_fb_mouse_get_info (NULL, NULL, &mask);
if (evmask & (GDK_BUTTON1_MOTION_MASK | GDK_BUTTON2_MOTION_MASK | GDK_BUTTON3_MOTION_MASK))
{
if (((mask & GDK_BUTTON1_MASK) && (evmask & GDK_BUTTON1_MOTION_MASK)) ||
((mask & GDK_BUTTON2_MASK) && (evmask & GDK_BUTTON2_MOTION_MASK)) ||
((mask & GDK_BUTTON3_MASK) && (evmask & GDK_BUTTON3_MOTION_MASK)))
evmask |= GDK_POINTER_MOTION_MASK;
}
if (((mask & GDK_BUTTON1_MASK) && (evmask & GDK_BUTTON1_MOTION_MASK)) ||
((mask & GDK_BUTTON2_MASK) && (evmask & GDK_BUTTON2_MOTION_MASK)) ||
((mask & GDK_BUTTON3_MASK) && (evmask & GDK_BUTTON3_MOTION_MASK)))
evmask |= GDK_POINTER_MOTION_MASK;
if (evmask & type_masks[type])