]> Pileus Git - ~andy/gtk/commitdiff
Do return the correct owner for CLIPBOARD (i.e., the owner of the Windows
authorTor Lillqvist <tml@novell.com>
Tue, 20 Sep 2005 07:59:19 +0000 (07:59 +0000)
committerTor Lillqvist <tml@src.gnome.org>
Tue, 20 Sep 2005 07:59:19 +0000 (07:59 +0000)
2005-09-20  Tor Lillqvist  <tml@novell.com>

* gdk/win32/gdkselection-win32.c
(gdk_selection_owner_get_for_display): Do return the correct owner
for CLIPBOARD (i.e., the owner of the Windows Clipboard, if it is
a window GDK knows about). The reason to return NULL seems to have
gone when in the fix for bug #163702 the artificial
GDK_SELECTION_CLEAR event generation was removed from
gdk_selection_send_notify_for_display(). Fixes bug #316552.

ChangeLog
ChangeLog.pre-2-10
gdk/win32/gdkselection-win32.c

index 9f02a50938316233b8cbd25d4b5886346d6b509b..fcba1e8cfc240eac0ec96ffb1f79444a0d083fe8 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2005-09-20  Tor Lillqvist  <tml@novell.com>
+
+       * gdk/win32/gdkselection-win32.c
+       (gdk_selection_owner_get_for_display): Do return the correct owner
+       for CLIPBOARD (i.e., the owner of the Windows Clipboard, if it is
+       a window GDK knows about). The reason to return NULL seems to have
+       gone when in the fix for bug #163702 the artificial
+       GDK_SELECTION_CLEAR event generation was removed from
+       gdk_selection_send_notify_for_display(). Fixes bug #316552.
+
 2005-09-20  Matthias Clasen  <mclasen@redhat.com>
 
        Avoid unnecessary XkbGetState() calls and XkbStateNotify
index 9f02a50938316233b8cbd25d4b5886346d6b509b..fcba1e8cfc240eac0ec96ffb1f79444a0d083fe8 100644 (file)
@@ -1,3 +1,13 @@
+2005-09-20  Tor Lillqvist  <tml@novell.com>
+
+       * gdk/win32/gdkselection-win32.c
+       (gdk_selection_owner_get_for_display): Do return the correct owner
+       for CLIPBOARD (i.e., the owner of the Windows Clipboard, if it is
+       a window GDK knows about). The reason to return NULL seems to have
+       gone when in the fix for bug #163702 the artificial
+       GDK_SELECTION_CLEAR event generation was removed from
+       gdk_selection_send_notify_for_display(). Fixes bug #316552.
+
 2005-09-20  Matthias Clasen  <mclasen@redhat.com>
 
        Avoid unnecessary XkbGetState() calls and XkbStateNotify
index 1bcdaa54970d5b8176ab346c53a8eb373873561e..6389571300cf3b8a6e5da3e698e537f02ad99c80 100644 (file)
@@ -280,14 +280,15 @@ gdk_selection_owner_get_for_display (GdkDisplay *display,
   g_return_val_if_fail (display == _gdk_display, NULL);
   g_return_val_if_fail (selection != GDK_NONE, NULL);
 
-  /* Return NULL for CLIPBOARD, because otherwise cut&paste inside the
-   * same application doesn't work. We must pretend to gtk that we
-   * don't have the selection, so that we always fetch it from the
-   * Windows clipboard. See also comments in
-   * gdk_selection_send_notify().
-   */
   if (selection == GDK_SELECTION_CLIPBOARD)
-    return NULL;
+    {
+      HWND owner = GetClipboardOwner ();
+
+      if (owner == NULL)
+       return NULL;
+
+      return gdk_win32_handle_table_lookup ((GdkNativeWindow) owner);
+    }
 
   window = gdk_window_lookup ((GdkNativeWindow) g_hash_table_lookup (sel_owner_table, selection));
 
@@ -746,7 +747,9 @@ gdk_selection_send_notify_for_display (GdkDisplay *display,
                                        GdkAtom     property,
                                        guint32     time)
 {
+#ifdef G_ENABLE_DEBUG
   gchar *sel_name, *tgt_name, *prop_name;
+#endif
 
   g_return_if_fail (display == _gdk_display);
 
@@ -754,7 +757,7 @@ gdk_selection_send_notify_for_display (GdkDisplay *display,
            (sel_name = gdk_atom_name (selection),
             tgt_name = gdk_atom_name (target),
             prop_name = gdk_atom_name (property),
-            g_print ("gdk_selection_send_notify: %#x %#x (%s) %#x (%s) %#x (%s)\n",
+            g_print ("gdk_selection_send_notify_for_display: %#x %#x (%s) %#x (%s) %#x (%s)\n",
                      requestor,
                      (guint) selection, sel_name,
                      (guint) target, tgt_name,