[gtk/gtk-3-22] gtkselection: ensure W32 functions used only for W32 displays



commit b9bb63b1ab0257083bd177a0629c0aa29e541fe9
Author: Руслан Ижбулатов <lrn1986 gmail com>
Date:   Thu Apr 26 19:36:27 2018 +0000

    gtkselection: ensure W32 functions used only for W32 displays
    
    gdk_win32_selection_add_targets() is for W32 displays only.

 gtk/gtkselection.c | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)
---
diff --git a/gtk/gtkselection.c b/gtk/gtkselection.c
index 9842f2dfc3..0a96cf372d 100644
--- a/gtk/gtkselection.c
+++ b/gtk/gtkselection.c
@@ -986,15 +986,16 @@ gtk_selection_add_targets (GtkWidget            *widget,
 #endif
 
 #ifdef GDK_WINDOWING_WIN32
-  {
-    int i;
-    GdkAtom *atoms = g_new (GdkAtom, ntargets);
-
-    for (i = 0; i < ntargets; ++i)
-      atoms[i] = gdk_atom_intern (targets[i].target, FALSE);
-    gdk_win32_selection_add_targets (gtk_widget_get_window (widget), selection, ntargets, atoms);
-    g_free (atoms);
-  }
+  if (GDK_IS_WIN32_DISPLAY (gtk_widget_get_display (widget)))
+    {
+      int i;
+      GdkAtom *atoms = g_new (GdkAtom, ntargets);
+
+      for (i = 0; i < ntargets; ++i)
+        atoms[i] = gdk_atom_intern (targets[i].target, FALSE);
+      gdk_win32_selection_add_targets (gtk_widget_get_window (widget), selection, ntargets, atoms);
+      g_free (atoms);
+    }
 #endif
 }
 


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