[gtk+/xi2: 1214/1239] Merge branch 'events-refactor' into xi2
- From: Carlos Garnacho <carlosg src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [gtk+/xi2: 1214/1239] Merge branch 'events-refactor' into xi2
- Date: Tue, 29 Sep 2009 10:58:59 +0000 (UTC)
commit 3081042f83d10a68190820f07095e8cfc5135b66
Merge: 4efcd88... b35bdaa...
Author: Carlos Garnacho <carlos gnome org>
Date: Tue Sep 22 01:22:24 2009 +0200
Merge branch 'events-refactor' into xi2
Conflicts:
gdk/gdkdisplay.c
gdk/gdkwindow.c
gdk/gdkwindow.h
gdk/x11/gdkdisplay-x11.c
NEWS | 94 +
autogen.sh | 17 +-
configure.in | 62 +-
demos/gtk-demo/Makefile.am | 2 +
demos/gtk-demo/clipboard.c | 4 +
demos/gtk-demo/links.c | 8 +-
demos/gtk-demo/menus.c | 35 +-
demos/gtk-demo/offscreen_window.c | 579 +++
demos/gtk-demo/offscreen_window2.c | 500 ++
docs/reference/gdk/gdk-sections.txt | 4 +
docs/reference/gdk/tmpl/cairo_interaction.sgml | 9 +
docs/reference/gdk/tmpl/keys.sgml | 5 +
docs/reference/gdk/tmpl/windows.sgml | 68 +-
docs/reference/gtk/Makefile.am | 2 +
docs/reference/gtk/gtk-docs.sgml | 1 +
docs/reference/gtk/gtk-sections.txt | 7 +
.../reference/gtk/migrating-ClientSideWindows.sgml | 70 +
docs/reference/gtk/tmpl/gtkrange.sgml | 18 +
docs/reference/gtk/tmpl/gtkwidget.sgml | 45 +
gdk-pixbuf/io-xpm.c | 2 +-
gdk-pixbuf/queryloaders.c | 15 +-
gdk/directfb/gdkdirectfb.h | 2 +
gdk/directfb/gdkwindow-directfb.c | 207 +
gdk/gdk.c | 9 +-
gdk/gdk.symbols | 8 +
gdk/gdkcairo.c | 28 +
gdk/gdkcairo.h | 2 +
gdk/gdkdisplay.c | 16 +-
gdk/gdkevents.h | 2 +
gdk/gdkgc.c | 9 +-
gdk/gdkinternals.h | 5 +
gdk/gdkkeysyms-update.pl | 71 +-
gdk/gdkkeysyms.h | 1467 ++++---
gdk/gdkoffscreenwindow.c | 17 +-
gdk/gdkprivate.h | 9 +-
gdk/gdkselection.h | 2 +-
gdk/gdkwindow.c | 909 +++-
gdk/gdkwindow.h | 9 +
gdk/gdkwindowimpl.h | 3 +
gdk/quartz/gdkevents-quartz.c | 6 +-
gdk/quartz/gdkwindow-quartz.c | 21 +-
gdk/win32/gdkwindow-win32.c | 17 +-
gdk/x11/gdkdisplay-x11.c | 48 +-
gdk/x11/gdkdrawable-x11.c | 11 +
gdk/x11/gdkdrawable-x11.h | 2 +
gdk/x11/gdkevents-x11.c | 89 +-
gdk/x11/gdkgeometry-x11.c | 21 +-
gdk/x11/gdkinput-x11.c | 4 +-
gdk/x11/gdkinput-xfree.c | 14 +-
gdk/x11/gdkinput.c | 28 +-
gdk/x11/gdkpixmap-x11.c | 2 +-
gdk/x11/gdkscreen-x11.c | 20 +-
gdk/x11/gdkscreen-x11.h | 1 +
gdk/x11/gdkwindow-x11.c | 32 +-
gdk/x11/gdkx.h | 6 +-
gtk/gtk.symbols | 7 +
gtk/gtkcellrendereraccel.c | 1 +
gtk/gtkcellrendererspin.c | 19 +
gtk/gtkcellrenderertoggle.c | 2 +-
gtk/gtkcellview.c | 2 +
gtk/gtkclist.c | 10 +-
gtk/gtkcombobox.c | 10 +
gtk/gtkcomboboxentry.c | 5 +-
gtk/gtkcustompaperunixdialog.c | 9 +-
gtk/gtkentry.c | 40 +-
gtk/gtkfilechooser.c | 3 +-
gtk/gtkfilechooserdefault.c | 1 +
gtk/gtkfilechooserdialog.c | 9 +-
gtk/gtkiconfactory.c | 481 +-
gtk/gtkimmodule.c | 10 +-
gtk/gtkimmulticontext.c | 75 +-
gtk/gtkmain.c | 10 +-
gtk/gtkmountoperation-x11.c | 4 +-
gtk/gtkprinteroptionwidget.c | 2 +-
gtk/gtkprintoperation-unix.c | 9 +-
gtk/gtkprintsettings.c | 8 +-
gtk/gtkradiobutton.c | 4 +-
gtk/gtkrange.c | 46 +
gtk/gtkrange.h | 4 +
gtk/gtkscale.c | 2 +-
gtk/gtksizegroup.c | 8 +
gtk/gtkstatusicon.c | 4 +
gtk/gtktestutils.c | 2 +
gtk/gtktextbuffer.c | 11 +-
gtk/gtktextview.c | 32 +-
gtk/gtktooltip.c | 9 +-
gtk/gtktreemodelfilter.c | 294 +-
gtk/gtktreemodelsort.c | 169 +-
gtk/gtktreeview.c | 181 +-
gtk/gtkwidget.c | 156 +-
gtk/gtkwidget.h | 15 +-
gtk/gtkwindow.c | 16 +-
gtk/tests/Makefile.am | 8 +
gtk/tests/expander.c | 94 +
gtk/tests/filtermodel.c | 2722 +++++++++++
gtk/tests/textbuffer.c | 37 +
gtk/tests/treeview.c | 56 +
gtk/updateiconcache.c | 4 +
modules/other/gail/gailbutton.c | 5 -
modules/other/gail/gailcombobox.c | 12 +-
modules/other/gail/gailscalebutton.c | 2 -
modules/printbackends/cups/gtkprintbackendcups.c | 67 +-
modules/printbackends/file/gtkprintbackendfile.c | 5 -
modules/printbackends/lpr/gtkprintbackendlpr.c | 21 +-
modules/printbackends/papi/gtkprintbackendpapi.c | 5 +-
modules/printbackends/test/gtkprintbackendtest.c | 3 -
po-properties/Makefile.in.in | 23 +-
po-properties/af.po | 92 +-
po-properties/am.po | 92 +-
po-properties/ang.po | 92 +-
po-properties/ar.po | 92 +-
po-properties/as.po | 901 ++--
po-properties/ast.po | 92 +-
po-properties/az.po | 92 +-
po-properties/az_IR.po | 92 +-
po-properties/be.po | 92 +-
po-properties/be latin po | 92 +-
po-properties/bg.po | 92 +-
po-properties/bn.po | 92 +-
po-properties/bn_IN.po | 4751 ++++++++++----------
po-properties/br.po | 92 +-
po-properties/bs.po | 92 +-
po-properties/ca.po | 92 +-
po-properties/ca valencia po | 92 +-
po-properties/crh.po | 92 +-
po-properties/cs.po | 208 +-
po-properties/cy.po | 92 +-
po-properties/da.po | 3588 ++++++++--------
po-properties/de.po | 3699 ++++++++--------
po-properties/dz.po | 92 +-
po-properties/el.po | 92 +-
po-properties/en_CA.po | 92 +-
po-properties/en_GB.po | 3612 ++++++++--------
po-properties/eo.po | 92 +-
po-properties/es.po | 92 +-
po-properties/et.po | 92 +-
po-properties/eu.po | 3808 ++++++++--------
po-properties/fa.po | 92 +-
po-properties/fi.po | 208 +-
po-properties/fr.po | 126 +-
po-properties/ga.po | 92 +-
po-properties/gl.po | 92 +-
po-properties/gu.po | 3742 ++++++++--------
po-properties/he.po | 116 +-
po-properties/hi.po | 3664 ++++++++--------
po-properties/hr.po | 92 +-
po-properties/hu.po | 228 +-
po-properties/hy.po | 92 +-
po-properties/ia.po | 92 +-
po-properties/id.po | 92 +-
po-properties/io.po | 92 +-
po-properties/is.po | 92 +-
po-properties/it.po | 92 +-
po-properties/ja.po | 649 ++--
po-properties/ka.po | 92 +-
po-properties/kn.po | 206 +-
po-properties/ko.po | 92 +-
po-properties/ku.po | 92 +-
po-properties/li.po | 92 +-
po-properties/lt.po | 3559 +++++++-------
po-properties/lv.po | 92 +-
po-properties/mai.po | 4270 +++++++++---------
po-properties/mi.po | 92 +-
po-properties/mk.po | 92 +-
po-properties/ml.po | 3805 ++++++++--------
po-properties/mn.po | 92 +-
po-properties/mr.po | 3781 ++++++++--------
po-properties/ms.po | 92 +-
po-properties/nb.po | 3519 +++++++-------
po-properties/ne.po | 92 +-
po-properties/nl.po | 92 +-
po-properties/nn.po | 92 +-
po-properties/nso.po | 92 +-
po-properties/oc.po | 92 +-
po-properties/or.po | 3988 ++++++++--------
po-properties/pa.po | 92 +-
po-properties/pl.po | 455 +-
po-properties/ps.po | 92 +-
po-properties/pt.po | 92 +-
po-properties/pt_BR.po | 92 +-
po-properties/ro.po | 209 +-
po-properties/ru.po | 92 +-
po-properties/rw.po | 92 +-
po-properties/si.po | 92 +-
po-properties/sk.po | 92 +-
po-properties/sl.po | 4842 ++++++++++----------
po-properties/sq.po | 92 +-
po-properties/sr.po | 95 +-
po-properties/sr ije po | 92 +-
po-properties/sr latin po | 95 +-
po-properties/sv.po | 92 +-
po-properties/ta.po | 3675 ++++++++--------
po-properties/te.po | 205 +-
po-properties/th.po | 92 +-
po-properties/tk.po | 92 +-
po-properties/tr.po | 92 +-
po-properties/tt.po | 92 +-
po-properties/uk.po | 3554 +++++++-------
po-properties/ur.po | 92 +-
po-properties/uz.po | 92 +-
po-properties/uz cyrillic po | 92 +-
po-properties/vi.po | 92 +-
po-properties/wa.po | 92 +-
po-properties/xh.po | 92 +-
po-properties/yi.po | 92 +-
po-properties/zh_CN.po | 3593 ++++++++--------
po-properties/zh_HK.po | 3679 ++++++++--------
po-properties/zh_TW.po | 3584 ++++++++--------
po/Makefile.in.in | 23 +-
po/af.po | 298 +-
po/am.po | 298 +-
po/ang.po | 298 +-
po/ar.po | 298 +-
po/as.po | 464 +-
po/ast.po | 2194 +++++-----
po/az.po | 298 +-
po/az_IR.po | 298 +-
po/be.po | 298 +-
po/be latin po | 298 +-
po/bg.po | 298 +-
po/bn.po | 298 +-
po/bn_IN.po | 387 +-
po/br.po | 298 +-
po/bs.po | 298 +-
po/ca.po | 298 +-
po/ca valencia po | 298 +-
po/crh.po | 298 +-
po/cs.po | 422 +-
po/cy.po | 298 +-
po/da.po | 2313 +++++-----
po/de.po | 2280 +++++-----
po/dz.po | 298 +-
po/el.po | 2690 ++++++------
po/en_CA.po | 298 +-
po/en_GB.po | 2343 +++++-----
po/eo.po | 298 +-
po/es.po | 298 +-
po/et.po | 298 +-
po/eu.po | 298 +-
po/fa.po | 298 +-
po/fi.po | 431 +-
po/fr.po | 325 +-
po/ga.po | 298 +-
po/gl.po | 298 +-
po/gu.po | 2361 +++++-----
po/he.po | 298 +-
po/hi.po | 2220 +++++-----
po/hr.po | 298 +-
po/hu.po | 435 +-
po/hy.po | 298 +-
po/ia.po | 298 +-
po/id.po | 298 +-
po/io.po | 298 +-
po/is.po | 298 +-
po/it.po | 2578 +++++------
po/ja.po | 451 +-
po/ka.po | 298 +-
po/kn.po | 440 +-
po/ko.po | 298 +-
po/ku.po | 298 +-
po/li.po | 298 +-
po/lt.po | 2343 +++++-----
po/lv.po | 298 +-
po/mai.po | 2377 +++++-----
po/mi.po | 298 +-
po/mk.po | 298 +-
po/ml.po | 2364 +++++-----
po/mn.po | 298 +-
po/mr.po | 2401 +++++-----
po/ms.po | 298 +-
po/nb.po | 2180 +++++-----
po/ne.po | 298 +-
po/nl.po | 3778 ++++++----------
po/nn.po | 298 +-
po/nso.po | 298 +-
po/oc.po | 298 +-
po/or.po | 2315 +++++-----
po/pa.po | 298 +-
po/pl.po | 3413 ++++++---------
po/ps.po | 298 +-
po/pt.po | 298 +-
po/pt_BR.po | 2176 +++++-----
po/ro.po | 2367 +++++-----
po/ru.po | 298 +-
po/rw.po | 298 +-
po/si.po | 298 +-
po/sk.po | 298 +-
po/sl.po | 2899 ++++++-------
po/sq.po | 298 +-
po/sr.po | 443 +-
po/sr ije po | 298 +-
po/sr latin po | 442 +-
po/sv.po | 298 +-
po/ta.po | 2223 +++++-----
po/te.po | 446 +-
po/th.po | 298 +-
po/tk.po | 298 +-
po/tr.po | 298 +-
po/tt.po | 298 +-
po/uk.po | 2228 +++++-----
po/ur.po | 298 +-
po/uz.po | 298 +-
po/uz cyrillic po | 298 +-
po/vi.po | 298 +-
po/wa.po | 298 +-
po/xh.po | 298 +-
po/yi.po | 298 +-
po/zh_CN.po | 2299 +++++-----
po/zh_HK.po | 2253 +++++-----
po/zh_TW.po | 2237 +++++-----
tests/Makefile.am | 3 +-
tests/testwindows.c | 45 +-
312 files changed, 88790 insertions(+), 86607 deletions(-)
---
diff --cc gdk/gdkdisplay.c
index f4eb449,d22ff00..91efc9c
--- a/gdk/gdkdisplay.c
+++ b/gdk/gdkdisplay.c
@@@ -1406,24 -1029,19 +1406,18 @@@ switch_to_pointer_grab (GdkDispla
x, y,
NULL, NULL);
}
-
+
if (pointer_window != last_grab->window)
- synthesize_crossing_events (display,
- last_grab->window, pointer_window,
- GDK_CROSSING_UNGRAB, time, serial);
-
+ synthesize_crossing_events (display, device,
+ last_grab->window, pointer_window,
+ GDK_CROSSING_UNGRAB, time, serial);
+
/* We're now ungrabbed, update the window_under_pointer */
- _gdk_display_set_window_under_pointer (display, pointer_window);
+ _gdk_display_set_window_under_pointer (display, device, pointer_window);
-
- if (last_grab->implicit_ungrab)
- generate_grab_broken_event (last_grab->window,
- device,
- TRUE,
- NULL);
}
}
-
- display->pointer_grabs = old_grabs;
+ g_hash_table_insert (display->device_grabs, device, old_grabs);
}
void
@@@ -1471,11 -1084,10 +1465,11 @@@ _gdk_display_device_grab_update (GdkDis
next_grab = NULL; /* Actually its not yet active */
}
- if (next_grab == NULL ||
- current_grab->window != next_grab->window)
+ if ((next_grab == NULL && current_grab->implicit_ungrab) ||
+ (next_grab != NULL && current_grab->window != next_grab->window))
generate_grab_broken_event (GDK_WINDOW (current_grab->window),
- FALSE, current_grab->implicit,
+ device,
+ current_grab->implicit,
next_grab? next_grab->window : NULL);
/* Remove old grab */
@@@ -1535,19 -1136,20 +1529,21 @@@ _gdk_display_has_device_grab (GdkDispla
return NULL;
}
- /* Returns true if last grab was ended */
+ /* Returns true if last grab was ended
+ * If if_child is non-NULL, end the grab only if the grabbed
+ * window is the same as if_child or a descendant of it */
gboolean
-_gdk_display_end_pointer_grab (GdkDisplay *display,
- gulong serial,
- GdkWindow *if_child,
- gboolean implicit)
+_gdk_display_end_device_grab (GdkDisplay *display,
+ GdkDevice *device,
+ gulong serial,
+ GdkWindow *if_child,
+ gboolean implicit)
{
- GdkPointerGrabInfo *grab;
+ GdkDeviceGrabInfo *grab;
GList *l;
- l = find_pointer_grab (display, serial);
-
+ l = find_device_grab (display, device, serial);
+
if (l == NULL)
return FALSE;
diff --cc gdk/gdkinternals.h
index dcb1a5a,92dc364..3199186
--- a/gdk/gdkinternals.h
+++ b/gdk/gdkinternals.h
@@@ -281,11 -274,10 +282,13 @@@ struct _GdkWindowObjec
GdkRegion *input_shape;
cairo_surface_t *cairo_surface;
+
+ GList *devices_inside;
+ GHashTable *device_events;
};
+ #define GDK_WINDOW_TYPE(d) (((GdkWindowObject*)(GDK_WINDOW (d)))->window_type)
+ #define GDK_WINDOW_DESTROYED(d) (((GdkWindowObject*)(GDK_WINDOW (d)))->destroyed)
extern GdkEventFunc _gdk_event_func; /* Callback for events */
extern gpointer _gdk_event_data;
diff --cc gdk/gdkwindow.c
index 693c510,500bf65..8831edb
--- a/gdk/gdkwindow.c
+++ b/gdk/gdkwindow.c
@@@ -327,9 -327,10 +327,11 @@@ static void do_move_region_bits_on_imp
GdkRegion *region, /* In impl window coords */
int dx, int dy);
static void gdk_window_invalidate_in_parent (GdkWindowObject *private);
- static void move_native_children (GdkWindowObject *private);
- static void update_cursor (GdkDisplay *display,
- GdkDevice *device);
+ static void move_native_children (GdkWindowObject *private);
-static void update_cursor (GdkDisplay *display);
++static void update_cursor (GdkDisplay *display,
++ GdkDevice *device);
+ static void impl_window_add_update_area (GdkWindowObject *impl_window,
+ GdkRegion *region);
static void gdk_window_region_move_free (GdkWindowRegionMove *move);
static guint signals[LAST_SIGNAL] = { 0 };
@@@ -1938,15 -1945,15 +2021,16 @@@ _gdk_window_destroy_hierarchy (GdkWindo
NULL, NULL);
}
-
+ impl_iface = GDK_WINDOW_IMPL_GET_IFACE (private->impl);
+
+#if 0
if (private->extension_events)
- GDK_WINDOW_IMPL_GET_IFACE (private->impl)->input_window_destroy (window);
+ impl_iface->input_window_destroy (window);
+#endif
if (gdk_window_has_impl (private))
- {
- GDK_WINDOW_IMPL_GET_IFACE (private->impl)->destroy (window, recursing_native, foreign_destroy);
- }
+ impl_iface->destroy (window, recursing_native,
+ foreign_destroy);
else
{
/* hide to make sure we repaint and break grabs */
@@@ -7426,26 -7587,12 +7787,29 @@@ gdk_window_set_back_pixmap (GdkWindow *
if (!GDK_WINDOW_DESTROYED (window) &&
gdk_window_has_impl (private) &&
!private->input_only)
- GDK_WINDOW_IMPL_GET_IFACE (private->impl)->set_back_pixmap (window, private->bg_pixmap);
+ {
+ impl_iface = GDK_WINDOW_IMPL_GET_IFACE (private->impl);
+ impl_iface->set_back_pixmap (window, private->bg_pixmap);
+ }
}
+static void
+update_cursor_foreach (GdkDisplay *display,
+ GdkDevice *device,
+ GdkPointerWindowInfo *pointer_info,
+ gpointer user_data)
+{
+ GdkWindow *window = user_data;
+ GdkWindowObject *private = (GdkWindowObject *) window;
+
+ if (_gdk_native_windows ||
+ private->window_type == GDK_WINDOW_ROOT ||
+ private->window_type == GDK_WINDOW_FOREIGN)
+ GDK_WINDOW_IMPL_GET_IFACE (private->impl)->set_device_cursor (window, device, private->cursor);
+ else if (_gdk_window_event_parent_of (window, pointer_info->window_under_pointer))
+ update_cursor (display, device);
+}
+
/**
* gdk_window_get_cursor:
* @window: a #GdkWindow
@@@ -8599,34 -8699,40 +8981,48 @@@ _gdk_window_event_parent_of (GdkWindow
}
static void
-update_cursor (GdkDisplay *display)
+update_cursor (GdkDisplay *display,
+ GdkDevice *device)
{
- GdkWindowObject *pointer_window, *cursor_window, *parent, *toplevel;
+ GdkWindowObject *cursor_window, *parent, *toplevel;
+ GdkWindow *pointer_window;
+ GdkWindowImplIface *impl_iface;
- GdkPointerGrabInfo *grab;
+ GdkPointerWindowInfo *pointer_info;
+ GdkDeviceGrabInfo *grab;
- pointer_window = display->pointer_info.window_under_pointer;
+ pointer_info = _gdk_display_get_pointer_info (display, device);
+ pointer_window = (GdkWindowObject *) pointer_info->window_under_pointer;
- cursor_window = pointer_window;
+ /* We ignore the serials here and just pick the last grab
+ we've sent, as that would shortly be used anyway. */
- grab = _gdk_display_get_last_pointer_grab (display);
++ grab = _gdk_display_get_last_device_grab (display, device);
+ if (/* have grab */
+ grab != NULL &&
+ /* the pointer is not in a descendant of the grab window */
+ !_gdk_window_event_parent_of (grab->window, pointer_window))
- /* use the cursor from the grab window */
- cursor_window = (GdkWindowObject *)grab->window;
++ {
++ /* use the cursor from the grab window */
++ cursor_window = (GdkWindowObject *) grab->window;
++ }
+ else
- /* otherwise use the cursor from the pointer window */
- cursor_window = (GdkWindowObject *)pointer_window;
++ {
++ /* otherwise use the cursor from the pointer window */
++ cursor_window = (GdkWindowObject *) pointer_window;
++ }
+
+ /* Find the first window with the cursor actually set, as
+ the cursor is inherited from the parent */
while (cursor_window->cursor == NULL &&
(parent = get_event_parent (cursor_window)) != NULL &&
parent->window_type != GDK_WINDOW_ROOT)
cursor_window = parent;
- /* We ignore the serials here and just pick the last grab
- we've sent, as that would shortly be used anyway. */
- grab = _gdk_display_get_last_device_grab (display, device);
- if (grab != NULL &&
- !_gdk_window_event_parent_of (grab->window, (GdkWindow *)cursor_window))
- cursor_window = (GdkWindowObject *)grab->window;
-
/* Set all cursors on toplevel, otherwise its tricky to keep track of
* which native window has what cursor set. */
- toplevel = (GdkWindowObject *)get_event_toplevel ((GdkWindow *)pointer_window);
- GDK_WINDOW_IMPL_GET_IFACE (toplevel->impl)->set_device_cursor
- ((GdkWindow *)toplevel, device, cursor_window->cursor);
- toplevel = (GdkWindowObject *)get_event_toplevel (pointer_window);
++ toplevel = (GdkWindowObject *) get_event_toplevel (pointer_window);
+ impl_iface = GDK_WINDOW_IMPL_GET_IFACE (toplevel->impl);
- impl_iface->set_cursor ((GdkWindow *)toplevel, cursor_window->cursor);
++ impl_iface->set_device_cursor ((GdkWindow *) toplevel, device,
++ cursor_window->cursor);
}
static void
@@@ -9171,54 -9234,36 +9576,64 @@@ send_crossing_event (GdkDispla
gulong serial)
{
GdkEvent *event;
- guint32 event_mask;
+ guint32 window_event_mask, type_event_mask;
- GdkPointerGrabInfo *grab;
+ GdkDeviceGrabInfo *grab;
+ GdkWindowImplIface *impl_iface;
+ gboolean block_event = FALSE;
- grab = _gdk_display_has_pointer_grab (display, serial);
+ grab = _gdk_display_has_device_grab (display, device, serial);
if (grab != NULL &&
- !grab->owner_events &&
- (GdkWindow *)window != grab->window)
- return;
+ !grab->owner_events)
+ {
+ /* !owner_event => only report events wrt grab window, ignore rest */
+ if ((GdkWindow *)window != grab->window)
+ return;
+ window_event_mask = grab->event_mask;
+ }
+ else
+ window_event_mask = window->event_mask;
if (type == GDK_LEAVE_NOTIFY)
- type_event_mask = GDK_LEAVE_NOTIFY_MASK;
+ {
- event_mask = GDK_LEAVE_NOTIFY_MASK;
++ type_event_mask = GDK_LEAVE_NOTIFY_MASK;
+ window->devices_inside = g_list_remove (window->devices_inside, device);
+
+ if (!window->support_multidevice && window->devices_inside)
+ {
+ /* Block leave events unless it's the last pointer */
+ block_event = TRUE;
+ }
+ }
else
- type_event_mask = GDK_ENTER_NOTIFY_MASK;
+ {
- event_mask = GDK_ENTER_NOTIFY_MASK;
++ type_event_mask = GDK_ENTER_NOTIFY_MASK;
+
+ if (!window->support_multidevice && window->devices_inside)
+ {
+ /* Only emit enter events for the first device */
+ block_event = TRUE;
+ }
+
+ if (gdk_device_get_device_type == GDK_DEVICE_TYPE_MASTER &&
+ device->mode != GDK_MODE_DISABLED &&
+ !g_list_find (window->devices_inside, device))
+ window->devices_inside = g_list_prepend (window->devices_inside, device);
+ }
+ if (block_event)
+ return;
+
+#if 0
if (window->extension_events != 0)
- GDK_WINDOW_IMPL_GET_IFACE (window->impl)->input_window_crossing ((GdkWindow *)window,
- type == GDK_ENTER_NOTIFY);
+ {
+ impl_iface = GDK_WINDOW_IMPL_GET_IFACE (window->impl);
- impl_iface->input_window_crossing ((GdkWindow *)window,
++ impl_iface->input_window_crossing ((GdkWindow *) window,
+ type == GDK_ENTER_NOTIFY);
+ }
+#endif
- if (window->event_mask & event_mask)
+ if (window_event_mask & type_event_mask)
{
event = _gdk_make_event ((GdkWindow *)window, type, event_in_queue, TRUE);
event->crossing.time = time_;
@@@ -9440,30 -9464,21 +9855,27 @@@ get_pointer_window (GdkDisplay *display
void
_gdk_display_set_window_under_pointer (GdkDisplay *display,
- GdkWindow *window)
+ GdkDevice *device,
+ GdkWindow *window)
{
- GdkWindowObject *private;
+ GdkPointerWindowInfo *device_info;
+
/* We don't track this if all native, and it can cause issues
with the update_cursor call below */
if (_gdk_native_windows)
return;
- private = (GdkWindowObject *)window;
-
- if (display->pointer_info.window_under_pointer)
- g_object_unref (display->pointer_info.window_under_pointer);
- display->pointer_info.window_under_pointer = window;
- if (window)
- g_object_ref (window);
+ device_info = _gdk_display_get_pointer_info (display, device);
+
+ if (device_info->window_under_pointer)
+ g_object_unref (device_info->window_under_pointer);
+ device_info->window_under_pointer = window;
if (window)
- update_cursor (display);
+ {
+ g_object_ref (window);
+ update_cursor (display, device);
+ }
_gdk_display_enable_motion_hints (display);
}
@@@ -10264,6 -10139,18 +10695,19 @@@ _gdk_windowing_got_event (GdkDisplay *d
if (!event_window)
return;
++ pointer_info = _gdk_display_get_pointer_info (display, device);
+ event_private = GDK_WINDOW_OBJECT (event_window);
+
+ #ifdef DEBUG_WINDOW_PRINTING
+ if (event->type == GDK_KEY_PRESS &&
+ (event->key.keyval == 0xa7 ||
+ event->key.keyval == 0xbd))
+ {
+ gdk_window_print_tree (event_window, 0,
+ event->key.keyval == 0xbd);
+ }
+ #endif
+
if (_gdk_native_windows)
{
if (event->type == GDK_BUTTON_PRESS &&
@@@ -10290,8 -10176,8 +10734,8 @@@
(event->button.state & GDK_ANY_BUTTON_MASK & ~(GDK_BUTTON1_MASK << (event->button.button - 1))) == 0)
{
button_release_grab->serial_end = serial;
- button_release_grab->implicit_ungrab = TRUE;
+ button_release_grab->implicit_ungrab = FALSE;
- _gdk_display_pointer_grab_update (display, serial);
+ _gdk_display_device_grab_update (display, device, serial);
}
}
@@@ -10430,8 -10299,8 +10859,8 @@@
(event->button.state & GDK_ANY_BUTTON_MASK & ~(GDK_BUTTON1_MASK << (event->button.button - 1))) == 0)
{
button_release_grab->serial_end = serial;
- button_release_grab->implicit_ungrab = TRUE;
+ button_release_grab->implicit_ungrab = FALSE;
- _gdk_display_pointer_grab_update (display, serial);
+ _gdk_display_device_grab_update (display, device, serial);
}
}
diff --cc gdk/gdkwindow.h
index 9d979da,b850275..f154c4e
--- a/gdk/gdkwindow.h
+++ b/gdk/gdkwindow.h
@@@ -331,11 -334,9 +335,12 @@@ GdkWindow* gdk_window_ne
gint attributes_mask);
void gdk_window_destroy (GdkWindow *window);
GdkWindowType gdk_window_get_window_type (GdkWindow *window);
+ gboolean gdk_window_is_destroyed (GdkWindow *window);
+
+#ifndef GDK_MULTIDEVICE_SAFE
GdkWindow* gdk_window_at_pointer (gint *win_x,
gint *win_y);
+#endif /* GDK_MULTIDEVICE_SAFE */
void gdk_window_show (GdkWindow *window);
void gdk_window_hide (GdkWindow *window);
void gdk_window_withdraw (GdkWindow *window);
diff --cc gdk/x11/gdkdisplay-x11.c
index 456f929,7b3ab52..75934ce
--- a/gdk/x11/gdkdisplay-x11.c
+++ b/gdk/x11/gdkdisplay-x11.c
@@@ -1411,10 -1393,8 +1412,9 @@@ gdk_display_open (const gchar *display_
_gdk_dnd_init (display);
for (i = 0; i < ScreenCount (display_x11->xdisplay); i++)
- gdk_display_request_selection_notification (display,
- GDK_SCREEN_X11 (display_x11->screens[i])->cm_selection_atom);
+ _gdk_x11_screen_setup (display_x11->screens[i]);
+ g_signal_emit_by_name (display, "opened");
g_signal_emit_by_name (gdk_display_manager_get(),
"display_opened", display);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]