summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2017-11-01 22:53:24 -0400
committerMatthias Clasen <mclasen@redhat.com>2017-11-01 22:53:24 -0400
commit5bd8884bf849abb5000af065d7923944a84c30e6 (patch)
treee87033793fd3665509bdc09eadc28535d9c10a95
parent33195d473c7e7f93c24c34ef0cb2cf045e85e34c (diff)
downloadgtk+-5bd8884bf849abb5000af065d7923944a84c30e6.tar.gz
Stop providing the owner in GdkEventOwnerChange
This information is rarely useful, and it is one of the last places where we create foreign windows.
-rw-r--r--gdk/gdkevents.c11
-rw-r--r--gdk/gdkeventsprivate.h2
-rw-r--r--gdk/wayland/gdkdevice-wayland.c1
-rw-r--r--gdk/win32/gdkdisplay-win32.c5
-rw-r--r--gdk/win32/gdkevents-win32.c3
-rw-r--r--gdk/x11/gdkdisplay-x11.c11
6 files changed, 3 insertions, 30 deletions
diff --git a/gdk/gdkevents.c b/gdk/gdkevents.c
index f768003764..0d76cc9943 100644
--- a/gdk/gdkevents.c
+++ b/gdk/gdkevents.c
@@ -716,12 +716,6 @@ gdk_event_copy (const GdkEvent *event)
sizeof (gdouble) * gdk_device_get_n_axes (event->motion.device));
break;
- case GDK_OWNER_CHANGE:
- new_event->owner_change.owner = event->owner_change.owner;
- if (new_event->owner_change.owner)
- g_object_ref (new_event->owner_change.owner);
- break;
-
case GDK_SELECTION_CLEAR:
case GDK_SELECTION_NOTIFY:
case GDK_SELECTION_REQUEST:
@@ -809,11 +803,6 @@ gdk_event_free (GdkEvent *event)
case GDK_MOTION_NOTIFY:
g_free (event->motion.axes);
break;
-
- case GDK_OWNER_CHANGE:
- if (event->owner_change.owner)
- g_object_unref (event->owner_change.owner);
- break;
case GDK_SELECTION_CLEAR:
case GDK_SELECTION_NOTIFY:
diff --git a/gdk/gdkeventsprivate.h b/gdk/gdkeventsprivate.h
index 3f19fcbd71..669a747b2f 100644
--- a/gdk/gdkeventsprivate.h
+++ b/gdk/gdkeventsprivate.h
@@ -436,7 +436,6 @@ struct _GdkEventSelection
* @type: the type of the event (%GDK_OWNER_CHANGE).
* @window: the window which received the event
* @send_event: %TRUE if the event was sent explicitly.
- * @owner: the new owner of the selection, or %NULL if there is none
* @reason: the reason for the ownership change as a #GdkOwnerChange value
* @selection: the atom identifying the selection
* @time: the timestamp of the event
@@ -454,7 +453,6 @@ struct _GdkEventOwnerChange
GdkEventType type;
GdkWindow *window;
gint8 send_event;
- GdkWindow *owner;
GdkOwnerChange reason;
GdkAtom selection;
guint32 time;
diff --git a/gdk/wayland/gdkdevice-wayland.c b/gdk/wayland/gdkdevice-wayland.c
index 454c54604d..c851823aa3 100644
--- a/gdk/wayland/gdkdevice-wayland.c
+++ b/gdk/wayland/gdkdevice-wayland.c
@@ -1083,7 +1083,6 @@ emit_selection_owner_change (GdkWindow *window,
event = gdk_event_new (GDK_OWNER_CHANGE);
event->owner_change.window = g_object_ref (window);
- event->owner_change.owner = NULL;
event->owner_change.reason = GDK_OWNER_CHANGE_NEW_OWNER;
event->owner_change.selection = atom;
event->owner_change.time = GDK_CURRENT_TIME;
diff --git a/gdk/win32/gdkdisplay-win32.c b/gdk/win32/gdkdisplay-win32.c
index 7af465c9d9..2d8eb2c95c 100644
--- a/gdk/win32/gdkdisplay-win32.c
+++ b/gdk/win32/gdkdisplay-win32.c
@@ -618,13 +618,8 @@ inner_clipboard_window_procedure (HWND hwnd,
GDK_NOTE (DND, g_print (" \n"));
- owner = gdk_win32_window_lookup_for_display (_gdk_display, hwnd_owner);
- if (owner == NULL)
- owner = gdk_win32_window_foreign_new_for_display (_gdk_display, hwnd_owner);
-
event = gdk_event_new (GDK_OWNER_CHANGE);
event->owner_change.window = gdk_get_default_root_window ();
- event->owner_change.owner = owner;
event->owner_change.reason = GDK_OWNER_CHANGE_NEW_OWNER;
event->owner_change.selection = GDK_SELECTION_CLIPBOARD;
event->owner_change.time = _gdk_win32_get_next_tick (0);
diff --git a/gdk/win32/gdkevents-win32.c b/gdk/win32/gdkevents-win32.c
index 3d7d6ae196..aee97c470f 100644
--- a/gdk/win32/gdkevents-win32.c
+++ b/gdk/win32/gdkevents-win32.c
@@ -842,9 +842,6 @@ fixup_event (GdkEvent *event)
(event->any.type == GDK_SELECTION_REQUEST)) &&
(event->selection.requestor != NULL))
g_object_ref (event->selection.requestor);
- if ((event->any.type == GDK_OWNER_CHANGE) &&
- (event->owner_change.owner != NULL))
- g_object_ref (event->owner_change.owner);
event->any.send_event = InSendMessage ();
}
diff --git a/gdk/x11/gdkdisplay-x11.c b/gdk/x11/gdkdisplay-x11.c
index c76348f98c..752d2abfd0 100644
--- a/gdk/x11/gdkdisplay-x11.c
+++ b/gdk/x11/gdkdisplay-x11.c
@@ -1155,18 +1155,13 @@ gdk_x11_display_translate_event (GdkEventTranslator *translator,
event->owner_change.type = GDK_OWNER_CHANGE;
event->owner_change.window = window;
- if (selection_notify->owner != None)
- event->owner_change.owner = gdk_x11_window_foreign_new_for_display (display,
- selection_notify->owner);
- else
- event->owner_change.owner = NULL;
event->owner_change.reason = selection_notify->subtype;
- event->owner_change.selection =
- gdk_x11_xatom_to_atom_for_display (display,
+ event->owner_change.selection =
+ gdk_x11_xatom_to_atom_for_display (display,
selection_notify->selection);
event->owner_change.time = selection_notify->timestamp;
event->owner_change.selection_time = selection_notify->selection_timestamp;
-
+
return_val = TRUE;
}
else