[gtk+/xi2: 894/1239] Merge branch 'events-refactor' into xi2
- From: Carlos Garnacho <carlosg src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [gtk+/xi2: 894/1239] Merge branch 'events-refactor' into xi2
- Date: Tue, 29 Sep 2009 10:52:57 +0000 (UTC)
commit ccf1c5e2ec63271eff25b736ea445acbc28a8856
Merge: 0a9b019... d0097e6...
Author: Carlos Garnacho <carlos lanedo com>
Date: Wed Aug 26 23:54:45 2009 +0200
Merge branch 'events-refactor' into xi2
Conflicts:
gdk/gdkdisplay.c
gdk/gdkinternals.h
gdk/gdkwindow.c
gdk/gdkwindow.h
NEWS | 227 ++
README.in | 16 +-
README.win32 | 301 +-
configure.in | 29 +-
demos/gtk-demo/Makefile.am | 1 +
demos/gtk-demo/entry_buffer.c | 65 +
demos/gtk-demo/links.c | 1 -
demos/gtk-demo/printing.c | 3 +
docs/reference/gdk/gdk-sections.txt | 1 +
docs/reference/gdk/tmpl/windows.sgml | 14 +
docs/reference/gtk/Makefile.am | 1 +
docs/reference/gtk/gtk-docs.sgml | 1 +
docs/reference/gtk/gtk-sections.txt | 73 +
docs/reference/gtk/gtk.types | 1 +
docs/reference/gtk/migrating-GtkBuilder.sgml | 21 +-
docs/reference/gtk/migrating-GtkEntry-icons.sgml | 10 +-
docs/reference/gtk/migrating-GtkIconView.sgml | 2 +-
docs/reference/gtk/running.sgml | 10 +
docs/reference/gtk/tmpl/gtk-unused.sgml | 27 +-
docs/reference/gtk/tmpl/gtkcellrenderer.sgml | 76 +
docs/reference/gtk/tmpl/gtkcellrenderertoggle.sgml | 18 +
docs/reference/gtk/tmpl/gtkentry.sgml | 32 +
docs/reference/gtk/tmpl/gtkentrybuffer.sgml | 168 +
docs/reference/gtk/tmpl/gtkfilechooser.sgml | 23 +
docs/reference/gtk/tmpl/gtkiconview.sgml | 23 +
docs/reference/gtk/tmpl/gtklabel.sgml | 23 +
docs/reference/gtk/tmpl/gtkmenutoolbutton.sgml | 28 +-
docs/reference/gtk/tmpl/gtkprintoperation.sgml | 37 +
docs/reference/gtk/tmpl/gtkprintunixdialog.sgml | 32 +
docs/reference/gtk/tmpl/gtktoggletoolbutton.sgml | 40 +-
docs/reference/gtk/tmpl/gtktoolitem.sgml | 17 -
docs/reference/gtk/tmpl/gtktreeviewcolumn.sgml | 5 +
docs/reference/gtk/tmpl/gtkwidget.sgml | 167 +
gdk-pixbuf/gdk-pixbuf-io.c | 9 +-
gdk-pixbuf/io-gdip-utils.c | 5 +-
gdk-pixbuf/io-gif.c | 2 +-
gdk-pixbuf/io-jpeg.c | 3 +-
gdk/directfb/gdkdisplay-directfb.c | 18 +-
gdk/directfb/gdkdrawable-directfb.c | 26 +
gdk/directfb/gdkgc-directfb.c | 14 +-
gdk/directfb/gdkinput-directfb.h | 1 -
gdk/directfb/gdkmain-directfb.c | 109 +-
gdk/directfb/gdkpixmap-directfb.c | 30 +-
gdk/directfb/gdkwindow-directfb.c | 736 +---
gdk/gdk.c | 3 +
gdk/gdk.symbols | 1 +
gdk/gdkdisplay.c | 174 +-
gdk/gdkdraw.c | 73 +-
gdk/gdkevents.c | 3 +
gdk/gdkgc.c | 22 +-
gdk/gdkglobals.c | 1 +
gdk/gdkinternals.h | 24 +-
gdk/gdkoffscreenwindow.c | 1 +
gdk/gdkpixmap.c | 12 +-
gdk/gdkwindow.c | 968 ++++--
gdk/gdkwindow.h | 1 +
gdk/gdkwindowimpl.h | 1 +
gdk/makefile.msc | 33 +-
gdk/quartz/gdkgeometry-quartz.c | 1 +
gdk/quartz/gdkprivate-quartz.h | 1 +
gdk/quartz/gdkwindow-quartz.c | 28 +-
gdk/win32/gdkdrawable-win32.c | 106 +-
gdk/win32/gdkdrawable-win32.h | 4 +-
gdk/win32/gdkevents-win32.c | 139 +-
gdk/win32/gdkimage-win32.c | 4 +-
gdk/win32/gdkinput-win32.h | 8 +-
gdk/win32/gdkinput.c | 28 +
gdk/win32/gdkpixmap-win32.c | 2 +-
gdk/win32/gdkprivate-win32.h | 4 +
gdk/win32/gdkwindow-win32.c | 171 +-
gdk/win32/makefile.msc | 10 +-
gdk/x11/gdkevents-x11.c | 19 +-
gdk/x11/gdkgeometry-x11.c | 120 +-
gdk/x11/gdkprivate-x11.h | 1 +
gdk/x11/gdkproperty-x11.c | 4 +-
gdk/x11/gdkscreen-x11.c | 1 -
gdk/x11/gdkselection-x11.c | 4 +-
gdk/x11/gdktestutils-x11.c | 14 +
gdk/x11/gdkwindow-x11.c | 144 +-
gdk/x11/gdkxid.c | 18 +-
gtk/Makefile.am | 4 +
gtk/gtk.h | 1 +
gtk/gtk.symbols | 70 +
gtk/gtkassistant.c | 35 +-
gtk/gtkbuilderparser.c | 13 +-
gtk/gtkcellrenderer.c | 215 ++-
gtk/gtkcellrenderer.h | 23 +
gtk/gtkcellrendereraccel.c | 4 +
gtk/gtkcellrenderertoggle.c | 41 +
gtk/gtkcellrenderertoggle.h | 20 +-
gtk/gtkcustompaperunixdialog.c | 1190 ++++++
gtk/gtkcustompaperunixdialog.h | 70 +
gtk/gtkentry.c | 977 +++---
gtk/gtkentry.h | 15 +-
gtk/gtkentrybuffer.c | 754 ++++
gtk/gtkentrybuffer.h | 133 +
gtk/gtkfilechooser.c | 59 +
gtk/gtkfilechooser.h | 4 +
gtk/gtkfilechooserbutton.c | 1 +
gtk/gtkfilechooserdefault.c | 195 +-
gtk/gtkfilechooserprivate.h | 1 +
gtk/gtkfilechooserutils.c | 3 +
gtk/gtkfilechooserutils.h | 3 +-
gtk/gtkfilesel.c | 12 +-
gtk/gtkicontheme.c | 2 +-
gtk/gtkiconview.c | 120 +-
gtk/gtkiconview.h | 3 +
gtk/gtkimagemenuitem.c | 1 -
gtk/gtkinfobar.h | 4 +
gtk/gtkkeyhash.c | 6 +-
gtk/gtklabel.c | 84 +-
gtk/gtklabel.h | 4 +
gtk/gtkliststore.c | 22 +-
gtk/gtkmarshalers.list | 2 +
gtk/gtkmenu.c | 1 -
gtk/gtkmountoperation-x11.c | 7 +-
gtk/gtkmountoperation.c | 6 +-
gtk/gtknotebook.c | 11 +-
gtk/gtkpagesetupunixdialog.c | 941 +-----
gtk/gtkprinteroption.c | 18 +
gtk/gtkprinteroption.h | 41 +-
gtk/gtkprinteroptionwidget.c | 4 +
gtk/gtkprintoperation-private.h | 1 +
gtk/gtkprintoperation-unix.c | 17 +-
gtk/gtkprintoperation.c | 160 +-
gtk/gtkprintoperation.h | 4 +
gtk/gtkprintunixdialog.c | 917 +++++-
gtk/gtkprintunixdialog.h | 42 +-
gtk/gtkscale.c | 1 -
gtk/gtksettings.c | 2 +-
gtk/gtkstatusbar.c | 35 +-
gtk/gtktextview.c | 3 +-
gtk/gtktoolitem.c | 16 +
gtk/gtktooltip.c | 14 +-
gtk/gtktreemodelfilter.c | 2 +
gtk/gtktreemodelsort.c | 2 +
gtk/gtktreestore.c | 40 +-
gtk/gtktreeview.c | 217 +-
gtk/gtktreeviewcolumn.c | 34 +-
gtk/gtktypeutils.c | 4 +-
gtk/gtkwidget.c | 443 +++-
gtk/gtkwidget.h | 38 +-
gtk/gtkwindow.c | 6 +-
gtk/makefile.msc.in | 7 +-
gtk/tests/Makefile.am | 4 +
gtk/tests/builder.c | 12 +-
gtk/tests/defaultvalue.c | 6 +-
gtk/tests/liststore.c | 80 +
gtk/tests/treestore.c | 80 +
gtk/tests/treeview-scrolling.c | 129 +-
gtk/tests/treeview.c | 109 +
gtk/updateiconcache.c | 18 +-
modules/engines/ms-windows/msw_style.c | 2 +-
modules/other/gail/gailmenuitem.c | 37 +-
modules/other/gail/gailwidget.c | 32 +-
modules/printbackends/cups/gtkprintbackendcups.c | 74 +-
modules/printbackends/cups/gtkprintercups.c | 4 +
modules/printbackends/cups/gtkprintercups.h | 3 +
modules/printbackends/file/gtkprintbackendfile.c | 61 +-
modules/printbackends/lpr/gtkprintbackendlpr.c | 1 +
po-properties/POTFILES.in | 9 +
po-properties/af.po | 884 +++--
po-properties/am.po | 875 +++--
po-properties/ang.po | 867 +++--
po-properties/ar.po | 888 +++--
po-properties/as.po | 888 +++--
po-properties/ast.po | 864 +++--
po-properties/az.po | 883 +++--
po-properties/az_IR.po | 864 +++--
po-properties/be.po | 881 +++--
po-properties/be latin po | 887 +++--
po-properties/bg.po | 912 +++--
po-properties/bn.po | 889 +++--
po-properties/bn_IN.po | 881 +++--
po-properties/br.po | 1404 ++++----
po-properties/bs.po | 883 +++--
po-properties/ca.po | 898 +++--
po-properties/ca valencia po | 2023 +++++-----
po-properties/crh.po | 904 +++--
po-properties/cs.po | 889 +++--
po-properties/cy.po | 887 +++--
po-properties/da.po | 889 +++--
po-properties/de.po | 890 +++--
po-properties/dz.po | 887 +++--
po-properties/el.po | 890 +++--
po-properties/en_CA.po | 887 +++--
po-properties/en_GB.po | 888 +++--
po-properties/eo.po | 864 +++--
po-properties/es.po | 879 +++--
po-properties/et.po | 971 +++---
po-properties/eu.po | 3921 ++++++++++----------
po-properties/fa.po | 878 +++--
po-properties/fi.po | 888 +++--
po-properties/fr.po | 914 +++--
po-properties/ga.po | 1149 +++---
po-properties/gl.po | 1031 +++---
po-properties/gu.po | 902 +++--
po-properties/he.po | 874 +++--
po-properties/hi.po | 3770 ++++++++++---------
po-properties/hr.po | 884 +++--
po-properties/hu.po | 888 +++--
po-properties/hy.po | 870 +++--
po-properties/ia.po | 870 +++--
po-properties/id.po | 889 +++--
po-properties/io.po | 864 +++--
po-properties/is.po | 875 +++--
po-properties/it.po | 895 +++--
po-properties/ja.po | 888 +++--
po-properties/ka.po | 886 +++--
po-properties/kn.po | 888 +++--
po-properties/ko.po | 1214 ++++---
po-properties/ku.po | 868 +++--
po-properties/li.po | 881 +++--
po-properties/lt.po | 888 +++--
po-properties/lv.po | 884 +++--
po-properties/mai.po | 885 +++--
po-properties/mi.po | 865 +++--
po-properties/mk.po | 887 +++--
po-properties/ml.po | 888 +++--
po-properties/mn.po | 899 +++--
po-properties/mr.po | 888 +++--
po-properties/ms.po | 883 +++--
po-properties/nb.po | 887 +++--
po-properties/ne.po | 884 +++--
po-properties/nl.po | 1107 +++---
po-properties/nn.po | 883 +++--
po-properties/nso.po | 885 +++--
po-properties/oc.po | 872 +++--
po-properties/or.po | 886 +++--
po-properties/pa.po | 925 +++--
po-properties/pl.po | 889 +++--
po-properties/ps.po | 875 +++--
po-properties/pt.po | 903 +++--
po-properties/pt_BR.po | 923 +++--
po-properties/ro.po | 890 +++--
po-properties/ru.po | 889 +++--
po-properties/rw.po | 884 +++--
po-properties/si.po | 877 +++--
po-properties/sk.po | 888 +++--
po-properties/sl.po | 888 +++--
po-properties/sq.po | 890 +++--
po-properties/sr.po | 884 +++--
po-properties/sr ije po | 883 +++--
po-properties/sr latin po | 884 +++--
po-properties/sv.po | 902 +++--
po-properties/ta.po | 3776 ++++++++++---------
po-properties/te.po | 887 +++--
po-properties/th.po | 871 +++--
po-properties/tk.po | 870 +++--
po-properties/tr.po | 903 +++--
po-properties/tt.po | 879 +++--
po-properties/uk.po | 921 +++--
po-properties/ur.po | 865 +++--
po-properties/uz.po | 880 +++--
po-properties/uz cyrillic po | 880 +++--
po-properties/vi.po | 888 +++--
po-properties/wa.po | 882 +++--
po-properties/xh.po | 887 +++--
po-properties/yi.po | 881 +++--
po-properties/zh_CN.po | 887 +++--
po-properties/zh_HK.po | 924 +++--
po-properties/zh_TW.po | 922 +++--
po/POTFILES.in | 9 +
po/af.po | 870 +++--
po/am.po | 863 +++--
po/ang.po | 854 +++--
po/ar.po | 921 +++---
po/as.po | 869 +++--
po/ast.po | 3181 ++++++++--------
po/az.po | 864 +++--
po/az_IR.po | 842 +++--
po/be.po | 864 +++--
po/be latin po | 865 +++--
po/bg.po | 924 +++---
po/bn.po | 3091 ++++++----------
po/bn_IN.po | 865 +++--
po/br.po | 2263 +++++-------
po/bs.po | 864 +++--
po/ca.po | 878 +++--
po/ca valencia po | 2888 +++++----------
po/crh.po | 882 +++--
po/cs.po | 865 +++--
po/cy.po | 869 +++--
po/da.po | 869 +++--
po/de.po | 869 +++--
po/dz.po | 858 +++--
po/el.po | 865 +++--
po/en_CA.po | 865 +++--
po/en_GB.po | 869 +++--
po/eo.po | 857 +++--
po/es.po | 2383 ++++++------
po/et.po | 1303 ++++++-
po/eu.po | 1111 +++---
po/fa.po | 864 +++--
po/fi.po | 865 +++--
po/fr.po | 878 +++--
po/ga.po | 1197 ++++---
po/gl.po | 2066 +++--------
po/gu.po | 865 +++--
po/he.po | 865 +++--
po/hi.po | 2482 +++++++------
po/hr.po | 875 +++--
po/hu.po | 865 +++--
po/hy.po | 855 +++--
po/ia.po | 854 +++--
po/id.po | 861 +++--
po/io.po | 859 +++--
po/is.po | 871 +++--
po/it.po | 868 +++--
po/ja.po | 865 +++--
po/ka.po | 865 +++--
po/kn.po | 865 +++--
po/ko.po | 960 +++---
po/ku.po | 865 +++--
po/li.po | 880 +++--
po/lt.po | 869 +++--
po/lv.po | 865 +++--
po/mai.po | 865 +++--
po/mi.po | 863 +++--
po/mk.po | 869 +++--
po/ml.po | 865 +++--
po/mn.po | 883 +++--
po/mr.po | 865 +++--
po/ms.po | 864 +++--
po/nb.po | 867 +++--
po/ne.po | 855 +++--
po/nl.po | 892 +++--
po/nn.po | 904 +++--
po/nso.po | 864 +++--
po/oc.po | 859 +++--
po/or.po | 865 +++--
po/pa.po | 1049 +++---
po/pl.po | 869 +++--
po/ps.po | 865 +++--
po/pt.po | 931 +++---
po/pt_BR.po | 1709 +++------
po/ro.po | 865 +++--
po/ru.po | 865 +++--
po/rw.po | 879 +++--
po/si.po | 868 +++--
po/sk.po | 865 +++--
po/sl.po | 865 +++--
po/sq.po | 865 +++--
po/sr.po | 869 +++--
po/sr ije po | 867 +++--
po/sr latin po | 869 +++--
po/sv.po | 2986 +++++++++-------
po/ta.po | 2484 +++++++------
po/te.po | 865 +++--
po/th.po | 933 +++---
po/tk.po | 863 +++--
po/tr.po | 884 +++--
po/tt.po | 855 +++--
po/uk.po | 896 +++--
po/ur.po | 842 +++--
po/uz.po | 864 +++--
po/uz cyrillic po | 864 +++--
po/vi.po | 863 +++--
po/wa.po | 857 +++--
po/xh.po | 864 +++--
po/yi.po | 864 +++--
po/zh_CN.po | 865 +++--
po/zh_HK.po | 948 +++---
po/zh_TW.po | 936 +++---
tests/makefile.msc | 16 +-
tests/testgtk.c | 7 +-
tests/testoffscreen.c | 2 +-
tests/testscale.c | 1 -
368 files changed, 122551 insertions(+), 96963 deletions(-)
---
diff --cc gdk/gdkdisplay.c
index ecc4dd9,10a0b90..dfeefd3
--- a/gdk/gdkdisplay.c
+++ b/gdk/gdkdisplay.c
@@@ -1034,28 -860,26 +1038,28 @@@ synthesize_crossing_events (GdkDisplay
gdk_window_get_pointer (dest_toplevel,
&x, &y, &state);
_gdk_synthesize_crossing_events (display,
- src_window,
- dest_window,
+ src_window,
+ dest_window,
+ display->core_pointer, /* FIXME */
- crossing_mode,
- x, y, state,
- time,
- NULL,
- serial);
+ crossing_mode,
+ x, y, state,
+ time,
+ NULL,
+ serial, FALSE);
}
else if (dest_toplevel == NULL)
{
gdk_window_get_pointer (src_toplevel,
&x, &y, &state);
_gdk_synthesize_crossing_events (display,
- src_window,
- NULL,
- crossing_mode,
- x, y, state,
- time,
- NULL,
- serial, FALSE);
+ src_window,
+ NULL,
+ display->core_pointer, /* FIXME */
+ crossing_mode,
+ x, y, state,
+ time,
+ NULL,
- serial);
++ serial, FALSE);
}
else
{
@@@ -1063,39 -887,70 +1067,77 @@@
gdk_window_get_pointer (src_toplevel,
&x, &y, &state);
_gdk_synthesize_crossing_events (display,
- src_window,
- NULL,
+ src_window,
+ NULL,
+ display->core_pointer, /* FIXME */
- crossing_mode,
- x, y, state,
- time,
- NULL,
- serial);
+ crossing_mode,
+ x, y, state,
+ time,
+ NULL,
+ serial, FALSE);
gdk_window_get_pointer (dest_toplevel,
&x, &y, &state);
_gdk_synthesize_crossing_events (display,
- NULL,
- dest_window,
+ NULL,
+ dest_window,
+ display->core_pointer, /* FIXME */
- crossing_mode,
- x, y, state,
- time,
- NULL,
- serial);
+ crossing_mode,
+ x, y, state,
+ time,
+ NULL,
+ serial, FALSE);
}
}
+ static GdkWindow *
-get_current_toplevel (GdkDisplay *display,
- int *x_out, int *y_out,
++get_current_toplevel (GdkDisplay *display,
++ GdkDevice *device,
++ int *x_out,
++ int *y_out,
+ GdkModifierType *state_out)
+ {
+ GdkWindow *pointer_window;
+ GdkWindowObject *w;
+ int x, y;
+ GdkModifierType state;
+
- pointer_window = _gdk_windowing_window_at_pointer (display, &x, &y, &state);
++ pointer_window = _gdk_windowing_window_at_device_position (display, device, &x, &y, &state);
++
+ if (pointer_window != NULL &&
+ (GDK_WINDOW_DESTROYED (pointer_window) ||
+ GDK_WINDOW_TYPE (pointer_window) == GDK_WINDOW_ROOT ||
+ GDK_WINDOW_TYPE (pointer_window) == GDK_WINDOW_FOREIGN))
+ pointer_window = NULL;
+
+ w = (GdkWindowObject *)pointer_window;
+ if (w)
+ {
+ /* Convert to toplevel */
+ while (w->parent != NULL &&
+ w->parent->window_type != GDK_WINDOW_ROOT)
+ {
+ x += w->x;
+ y += w->y;
+ w = w->parent;
+ }
+ }
+
+ *x_out = x;
+ *y_out = y;
+ *state_out = state;
+ return (GdkWindow *)w;
+ }
+
static void
-switch_to_pointer_grab (GdkDisplay *display,
+switch_to_pointer_grab (GdkDisplay *display,
+ GdkDevice *device,
GdkPointerGrabInfo *grab,
GdkPointerGrabInfo *last_grab,
- guint32 time,
- gulong serial)
+ guint32 time,
+ gulong serial)
{
- GdkWindow *src_window, *pointer_window;
+ GdkWindow *src_window, *pointer_window, *new_toplevel;
+ GdkPointerWindowInfo *info;
- GdkWindowObject *w;
GList *old_grabs;
GdkModifierType state;
int x, y;
@@@ -1138,60 -992,61 +1180,60 @@@
grab->activated = TRUE;
}
- else if (last_grab)
+
+ if (last_grab)
{
- pointer_window = _gdk_windowing_window_at_device_position (display, device, &x, &y, &state);
- if (pointer_window != NULL &&
- (GDK_WINDOW_DESTROYED (pointer_window) ||
- GDK_WINDOW_TYPE (pointer_window) == GDK_WINDOW_ROOT ||
- GDK_WINDOW_TYPE (pointer_window) == GDK_WINDOW_FOREIGN))
- pointer_window = NULL;
-
- /* We force checked what window we're in, so we need to
- * update the toplevel_under_pointer info, as that won't get told of
- * this change.
- */
- if (info->toplevel_under_pointer)
- g_object_unref (info->toplevel_under_pointer);
- info->toplevel_under_pointer = NULL;
+ new_toplevel = NULL;
- if (pointer_window)
+ if (grab == NULL /* ungrab */ ||
+ (!last_grab->owner_events && grab->owner_events) /* switched to owner_events */ )
{
- /* Convert to toplevel */
- w = (GdkWindowObject *)pointer_window;
- while (/*w->parent != NULL && */
- w->parent->window_type != GDK_WINDOW_ROOT)
+ /* We force check what window we're in, and update the toplevel_under_pointer info,
+ * as that won't get told of this change with toplevel enter events.
+ */
- if (display->pointer_info.toplevel_under_pointer)
- g_object_unref (display->pointer_info.toplevel_under_pointer);
- display->pointer_info.toplevel_under_pointer = NULL;
++ if (info->toplevel_under_pointer)
++ g_object_unref (info->toplevel_under_pointer);
++ info->toplevel_under_pointer = NULL;
+
- new_toplevel = get_current_toplevel (display, &x, &y, &state);
++ new_toplevel = get_current_toplevel (display, device, &x, &y, &state);
+ if (new_toplevel)
{
- x += w->x;
- y += w->y;
- w = w->parent;
+ /* w is now toplevel and x,y in toplevel coords */
- display->pointer_info.toplevel_under_pointer = g_object_ref (new_toplevel);
- display->pointer_info.toplevel_x = x;
- display->pointer_info.toplevel_y = y;
- display->pointer_info.state = state;
++ info->toplevel_under_pointer = g_object_ref (new_toplevel);
++ info->toplevel_x = x;
++ info->toplevel_y = y;
++ info->state = state;
}
-
- /* w is now toplevel and x,y in toplevel coords */
- info->toplevel_under_pointer = g_object_ref (w);
-
- /* Find (possibly virtual) child window */
- pointer_window =
- _gdk_window_find_descendant_at ((GdkWindow *)w,
- x, y,
- NULL, NULL);
}
- if (pointer_window != last_grab->window)
- synthesize_crossing_events (display,
- last_grab->window, pointer_window,
- GDK_CROSSING_UNGRAB, time, serial);
+ if (grab == NULL) /* Ungrabbed, send events */
+ {
+ pointer_window = NULL;
+ if (new_toplevel)
+ {
+ /* Find (possibly virtual) child window */
+ pointer_window =
+ _gdk_window_find_descendant_at (new_toplevel,
+ x, y,
+ NULL, NULL);
+ }
-
+
- /* We're now ungrabbed, update the window_under_pointer */
- _gdk_display_set_window_under_pointer (display, device, pointer_window);
+ if (pointer_window != last_grab->window)
+ synthesize_crossing_events (display,
+ last_grab->window, pointer_window,
+ GDK_CROSSING_UNGRAB, time, serial);
-
+
- if (last_grab->implicit_ungrab)
- generate_grab_broken_event (last_grab->window,
- FALSE, TRUE,
- NULL);
+ /* 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,
+ FALSE, TRUE,
+ NULL);
+ }
}
-
- display->pointer_grabs = old_grabs;
+ display->pointer_grabs = old_grabs;
}
void
diff --cc gdk/gdkinternals.h
index c14e43b,24d17c1..b3f69ea
--- a/gdk/gdkinternals.h
+++ b/gdk/gdkinternals.h
@@@ -616,15 -607,9 +619,15 @@@ void _gdk_display_unset_has_keyboard_gr
gboolean implicit);
void _gdk_display_enable_motion_hints (GdkDisplay *display);
+GdkPointerWindowInfo * _gdk_display_get_pointer_info (GdkDisplay *display,
+ GdkDevice *device);
+
+void _gdk_display_pointer_info_foreach (GdkDisplay *display,
+ GdkDisplayPointerInfoForeach func,
+ gpointer user_data);
void _gdk_window_invalidate_for_expose (GdkWindow *window,
- const GdkRegion *region);
+ GdkRegion *region);
void _gdk_windowing_set_cairo_surface_size (cairo_surface_t *surface,
int width,
@@@ -649,19 -634,18 +652,20 @@@ GdkEvent * _gdk_make_event (GdkWindo
gboolean before_event);
void _gdk_synthesize_crossing_events (GdkDisplay *display,
- GdkWindow *src,
- GdkWindow *dest,
+ GdkWindow *src,
+ GdkWindow *dest,
+ GdkDevice *device,
- GdkCrossingMode mode,
- gint toplevel_x,
- gint toplevel_y,
- GdkModifierType mask,
- guint32 time_,
- GdkEvent *event_in_queue,
- gulong serial);
+ GdkCrossingMode mode,
+ gint toplevel_x,
+ gint toplevel_y,
+ GdkModifierType mask,
+ guint32 time_,
+ GdkEvent *event_in_queue,
+ gulong serial,
+ gboolean non_linear);
void _gdk_display_set_window_under_pointer (GdkDisplay *display,
- GdkWindow *window);
+ GdkDevice *device,
+ GdkWindow *window);
void _gdk_synthesize_crossing_events_for_geometry_change (GdkWindow *changed_window);
diff --cc gdk/gdkwindow.c
index 944105a,0831704..10b03a7
--- a/gdk/gdkwindow.c
+++ b/gdk/gdkwindow.c
@@@ -311,8 -328,8 +327,9 @@@ static void do_move_region_bits_on_imp
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);
+static void update_cursor (GdkDisplay *display,
+ GdkDevice *device);
+ static void gdk_window_region_move_free (GdkWindowRegionMove *move);
static guint signals[LAST_SIGNAL] = { 0 };
@@@ -1806,7 -1890,30 +1919,26 @@@ _gdk_window_destroy_hierarchy (GdkWindo
private->redirect = NULL;
- if (display->pointer_info.toplevel_under_pointer == window)
- {
- g_object_unref (display->pointer_info.toplevel_under_pointer);
- display->pointer_info.toplevel_under_pointer = NULL;
- }
+ window_remove_from_pointer_info (window, display);
+
+ if (private->clip_region)
+ {
+ gdk_region_destroy (private->clip_region);
+ private->clip_region = NULL;
+ }
+
+ if (private->clip_region_with_children)
+ {
+ gdk_region_destroy (private->clip_region_with_children);
+ private->clip_region_with_children = NULL;
+ }
+
+ if (private->outstanding_moves)
+ {
+ g_list_foreach (private->outstanding_moves, (GFunc)gdk_window_region_move_free, NULL);
+ g_list_free (private->outstanding_moves);
+ private->outstanding_moves = NULL;
+ }
}
break;
}
@@@ -6921,19 -7229,35 +7257,52 @@@ gdk_window_set_back_pixmap (GdkWindow *
GDK_WINDOW_IMPL_GET_IFACE (private->impl)->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_window_event_parent_of (window, pointer_info->window_under_pointer))
++ 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
+ * @cursor: a cursor
+ *
+ * Retrieves a #GdkCursor pointer for the cursor currently set on the
+ * specified #GdkWindow, or %NULL. If the return value is %NULL then
+ * there is no custom cursor set on the specified window, and it is
+ * using the cursor for its parent window.
+ *
+ * Return value: a #GdkCursor, or %NULL. The returned object is owned
+ * by the #GdkWindow and should not be unreferenced directly. Use
+ * gdk_window_set_cursor() to unset the cursor of the window
+ *
+ * Since: 2.18
+ */
+ GdkCursor *
+ gdk_window_get_cursor (GdkWindow *window)
+ {
+ GdkWindowObject *private;
+
+ g_return_val_if_fail (GDK_IS_WINDOW (window), NULL);
+
+ private = (GdkWindowObject *) window;
+
+ return private->cursor;
+ }
+
+ /**
* gdk_window_set_cursor:
* @window: a #GdkWindow
* @cursor: a cursor
@@@ -6967,9 -7291,14 +7336,11 @@@ gdk_window_set_cursor (GdkWindow *windo
if (cursor)
private->cursor = gdk_cursor_ref (cursor);
- if (_gdk_native_windows ||
- private->window_type == GDK_WINDOW_ROOT ||
- private->window_type == GDK_WINDOW_FOREIGN)
- GDK_WINDOW_IMPL_GET_IFACE (private->impl)->set_cursor (window, cursor);
- else if (_gdk_window_event_parent_of (window, display->pointer_info.window_under_pointer))
- update_cursor (display);
+ _gdk_display_pointer_info_foreach (display,
+ update_cursor_foreach,
+ window);
+
+ g_object_notify (G_OBJECT (window), "cursor");
}
}
@@@ -8626,16 -8877,16 +9010,17 @@@ send_crossing_event (GdkDispla
*/
void
_gdk_synthesize_crossing_events (GdkDisplay *display,
- GdkWindow *src,
- GdkWindow *dest,
+ GdkWindow *src,
+ GdkWindow *dest,
+ GdkDevice *device,
- GdkCrossingMode mode,
- gint toplevel_x,
- gint toplevel_y,
- GdkModifierType mask,
- guint32 time_,
- GdkEvent *event_in_queue,
- gulong serial)
+ GdkCrossingMode mode,
+ gint toplevel_x,
+ gint toplevel_y,
+ GdkModifierType mask,
+ guint32 time_,
+ GdkEvent *event_in_queue,
+ gulong serial,
+ gboolean non_linear)
{
GdkWindowObject *c;
GdkWindowObject *win, *last, *next;
@@@ -8808,25 -9051,25 +9192,30 @@@ 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);
}
@@@ -8955,38 -9200,30 +9347,39 @@@ do_synthesize_crossing_event (gpointer
display = gdk_drawable_get_display (changed_toplevel);
serial = _gdk_windowing_window_get_next_serial (display);
-
- if (changed_toplevel == display->pointer_info.toplevel_under_pointer)
- {
- new_window_under_pointer =
- get_pointer_window (display, changed_toplevel,
- display->pointer_info.toplevel_x,
- display->pointer_info.toplevel_y,
- serial);
- if (new_window_under_pointer !=
- display->pointer_info.window_under_pointer)
- {
- _gdk_synthesize_crossing_events (display,
- display->pointer_info.window_under_pointer,
- new_window_under_pointer,
- GDK_CROSSING_NORMAL,
- display->pointer_info.toplevel_x,
- display->pointer_info.toplevel_y,
- display->pointer_info.state,
- GDK_CURRENT_TIME,
- NULL,
- serial,
- FALSE);
- _gdk_display_set_window_under_pointer (display, new_window_under_pointer);
- }
+ g_hash_table_iter_init (&iter, display->pointers_info);
+
+ while (g_hash_table_iter_next (&iter, &key, &value))
+ {
+ GdkWindow *new_window_under_pointer;
+ GdkPointerWindowInfo *pointer_info = value;
+ GdkDevice *device = key;
+
+ if (changed_toplevel == pointer_info->toplevel_under_pointer)
+ {
+ new_window_under_pointer =
+ get_pointer_window (display, changed_toplevel,
+ device,
+ pointer_info->toplevel_x,
+ pointer_info->toplevel_y,
+ serial);
+ if (new_window_under_pointer != pointer_info->window_under_pointer)
+ {
+ _gdk_synthesize_crossing_events (display,
+ pointer_info->window_under_pointer,
+ new_window_under_pointer,
+ device,
+ GDK_CROSSING_NORMAL,
+ pointer_info->toplevel_x,
+ pointer_info->toplevel_y,
+ pointer_info->state,
+ GDK_CURRENT_TIME,
+ NULL,
- serial);
++ serial,
++ FALSE);
+ _gdk_display_set_window_under_pointer (display, device, new_window_under_pointer);
+ }
+ }
}
return FALSE;
@@@ -8998,13 -9236,18 +9392,18 @@@ _gdk_synthesize_crossing_events_for_geo
GdkWindow *toplevel;
GdkWindowObject *toplevel_priv;
+ if (_gdk_native_windows)
+ return; /* We use the native crossing events if all native */
+
+ display = gdk_drawable_get_display (changed_window);
+
toplevel = get_event_toplevel (changed_window);
- toplevel_priv = (GdkWindowObject *)toplevel;
+ toplevel_priv = (GdkWindowObject *) toplevel;
- if (toplevel == display->pointer_info.toplevel_under_pointer &&
- !toplevel_priv->synthesize_crossing_event_queued)
+ if (!toplevel_priv->synthesize_crossing_event_queued)
{
toplevel_priv->synthesize_crossing_event_queued = TRUE;
+
g_idle_add_full (GDK_PRIORITY_EVENTS - 1,
do_synthesize_crossing_event,
g_object_ref (toplevel),
@@@ -9124,14 -9370,14 +9530,15 @@@ proxy_pointer_event (GdkDispla
/* Send leave events from window under pointer to event window
that will get the subwindow == NULL window */
_gdk_synthesize_crossing_events (display,
- pointer_info->window_under_pointer,
- event_window,
- display->pointer_info.window_under_pointer,
++ pointer_info->window_under_pointer,
+ event_window,
+ device,
- source_event->crossing.mode,
- toplevel_x, toplevel_y,
- state, time_,
- source_event,
- serial);
+ source_event->crossing.mode,
+ toplevel_x, toplevel_y,
+ state, time_,
+ source_event,
+ serial,
+ non_linear);
/* Send subwindow == NULL event */
send_crossing_event (display,
@@@ -9179,15 -9423,14 +9586,15 @@@
/* Send enter events from event window to pointer_window */
_gdk_synthesize_crossing_events (display,
- event_window,
- pointer_window,
+ event_window,
+ pointer_window,
+ device,
- source_event->crossing.mode,
- toplevel_x, toplevel_y,
- state, time_,
- source_event,
- serial);
+ source_event->crossing.mode,
+ toplevel_x, toplevel_y,
+ state, time_,
+ source_event,
+ serial, non_linear);
- _gdk_display_set_window_under_pointer (display, pointer_window);
+ _gdk_display_set_window_under_pointer (display, device, pointer_window);
return TRUE;
}
@@@ -9198,15 -9441,14 +9605,15 @@@
/* Different than last time, send crossing events */
_gdk_synthesize_crossing_events (display,
- pointer_info->window_under_pointer,
- pointer_window,
- display->pointer_info.window_under_pointer,
++ pointer_info->window_under_pointer,
+ pointer_window,
+ device,
- GDK_CROSSING_NORMAL,
- toplevel_x, toplevel_y,
- state, time_,
- source_event,
- serial);
+ GDK_CROSSING_NORMAL,
+ toplevel_x, toplevel_y,
+ state, time_,
+ source_event,
+ serial, non_linear);
- _gdk_display_set_window_under_pointer (display, pointer_window);
+ _gdk_display_set_window_under_pointer (display, device, pointer_window);
}
else if (source_event->type == GDK_MOTION_NOTIFY)
{
@@@ -9478,7 -9711,42 +9885,42 @@@ _gdk_windowing_got_event (GdkDisplay *d
if (!event_window)
return;
+ if (_gdk_native_windows)
+ {
+ if (event->type == GDK_BUTTON_PRESS &&
+ _gdk_display_has_pointer_grab (display, serial) == NULL)
+ {
+ _gdk_display_add_pointer_grab (display,
+ event_window,
+ event_window,
+ FALSE,
+ gdk_window_get_events (event_window),
+ serial,
+ gdk_event_get_time (event),
+ TRUE);
- _gdk_display_pointer_grab_update (display,
- serial);
++ _gdk_display_pointer_grab_update (display, device, serial);
+ }
+ if (event->type == GDK_BUTTON_RELEASE)
+ {
+ button_release_grab =
+ _gdk_display_has_pointer_grab (display, serial);
+ if (button_release_grab &&
+ button_release_grab->implicit &&
+ (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;
- _gdk_display_pointer_grab_update (display, serial);
++ _gdk_display_pointer_grab_update (display, device, serial);
+ }
+ }
+
+ if (event->type == GDK_BUTTON_PRESS)
+ _gdk_event_button_generate (display, event);
+
+ return;
+ }
+
+ pointer_info = _gdk_display_get_pointer_info (display, device);
event_private = GDK_WINDOW_OBJECT (event_window);
#ifdef DEBUG_WINDOW_PRINTING
diff --cc gdk/gdkwindow.h
index 79142b0,a3297d2..90c1047
--- a/gdk/gdkwindow.h
+++ b/gdk/gdkwindow.h
@@@ -518,9 -517,7 +518,10 @@@ void gdk_window_set_back_pixmap (
gboolean parent_relative);
void gdk_window_set_cursor (GdkWindow *window,
GdkCursor *cursor);
+ GdkCursor *gdk_window_get_cursor (GdkWindow *window);
+void gdk_window_set_device_cursor (GdkWindow *window,
+ GdkDevice *device,
+ GdkCursor *cursor);
void gdk_window_get_user_data (GdkWindow *window,
gpointer *data);
void gdk_window_get_geometry (GdkWindow *window,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]