[gtk+/wip/matthiasc/no-foreign: 1/3] Stop providing the owner in GdkEventOwnerChange



commit 69b6be6bc9b0e48d945cd5c6ed4dbeaae91ec6ed
Author: Matthias Clasen <mclasen redhat com>
Date:   Tue Aug 22 14:38:52 2017 -0400

    Stop providing the owner in GdkEventOwnerChange
    
    This information is rarely useful, and it is one
    of the last places where we create foreign windows.

 gdk/gdkevents.c                 |   15 ++-------------
 gdk/gdkevents.h                 |    2 --
 gdk/wayland/gdkdevice-wayland.c |    1 -
 gdk/win32/gdkdisplay-win32.c    |    5 -----
 gdk/win32/gdkevents-win32.c     |    3 ---
 gdk/x11/gdkdisplay-x11.c        |   11 +++--------
 6 files changed, 5 insertions(+), 32 deletions(-)
---
diff --git a/gdk/gdkevents.c b/gdk/gdkevents.c
index 2623c9c..3630339 100644
--- a/gdk/gdkevents.c
+++ b/gdk/gdkevents.c
@@ -723,12 +723,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:
@@ -813,19 +807,14 @@ gdk_event_free (GdkEvent *event)
       if (event->expose.region)
        cairo_region_destroy (event->expose.region);
       break;
-      
+
     case GDK_MOTION_NOTIFY:
       g_free (event->motion.axes);
       break;
-      
+
     case GDK_SETTING:
       g_free (event->setting.name);
       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/gdkevents.h b/gdk/gdkevents.h
index 405ccc1..8dc364d 100644
--- a/gdk/gdkevents.h
+++ b/gdk/gdkevents.h
@@ -1029,7 +1029,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
@@ -1047,7 +1046,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 1bc142a..258d061 100644
--- a/gdk/wayland/gdkdevice-wayland.c
+++ b/gdk/wayland/gdkdevice-wayland.c
@@ -1087,7 +1087,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 10ae262..6e33ec8 100644
--- a/gdk/win32/gdkdisplay-win32.c
+++ b/gdk/win32/gdkdisplay-win32.c
@@ -626,13 +626,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 3a55329..233d9f0 100644
--- a/gdk/win32/gdkevents-win32.c
+++ b/gdk/win32/gdkevents-win32.c
@@ -854,9 +854,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 4ffbce5..f021fe0 100644
--- a/gdk/x11/gdkdisplay-x11.c
+++ b/gdk/x11/gdkdisplay-x11.c
@@ -1002,18 +1002,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


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]