SF.net SVN: geany:[5692] trunk

eht16 at users.sourceforge.net eht16 at xxxxx
Mon Apr 4 18:03:35 UTC 2011


Revision: 5692
          http://geany.svn.sourceforge.net/geany/?rev=5692&view=rev
Author:   eht16
Date:     2011-04-04 18:03:35 +0000 (Mon, 04 Apr 2011)

Log Message:
-----------
Fix X PRIMARY selection issue when Scintilla widget is unrealized/re-realized (Backport from Scintilla HG, original patch by Matthew Brush).

Modified Paths:
--------------
    trunk/ChangeLog
    trunk/scintilla/gtk/ScintillaGTK.cxx

Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog	2011-04-04 18:01:14 UTC (rev 5691)
+++ trunk/ChangeLog	2011-04-04 18:03:35 UTC (rev 5692)
@@ -1,3 +1,11 @@
+2011-04-04  Enrico Tröger  <enrico(dot)troeger(at)uvena(dot)de>
+
+ * scintilla/gtk/ScintillaGTK.cxx:
+   Fix X PRIMARY selection issue when Scintilla widget is
+   unrealized/re-realized
+   (Backport from Scintilla HG, original patch by Matthew Brush).
+
+
 2011-04-04  Colomban Wendling  <colomban(at)geany(dot)org>
 
  * scintilla/gtk/PlatGTK.cxx:

Modified: trunk/scintilla/gtk/ScintillaGTK.cxx
===================================================================
--- trunk/scintilla/gtk/ScintillaGTK.cxx	2011-04-04 18:01:14 UTC (rev 5691)
+++ trunk/scintilla/gtk/ScintillaGTK.cxx	2011-04-04 18:03:35 UTC (rev 5692)
@@ -420,6 +420,14 @@
 	gtk_widget_realize(widtxt);
 	gtk_widget_realize(PWidget(scrollbarv));
 	gtk_widget_realize(PWidget(scrollbarh));
+
+	gtk_selection_add_targets(widget, GDK_SELECTION_PRIMARY,
+	                          clipboardCopyTargets, nClipboardCopyTargets);
+
+#ifndef USE_GTK_CLIPBOARD
+	gtk_selection_add_targets(widget, atomClipboard,
+	                          clipboardPasteTargets, nClipboardPasteTargets);
+#endif
 }
 
 void ScintillaGTK::Realize(GtkWidget *widget) {
@@ -429,6 +437,14 @@
 
 void ScintillaGTK::UnRealizeThis(GtkWidget *widget) {
 	try {
+
+		gtk_selection_clear_targets(widget, GDK_SELECTION_PRIMARY);
+
+#ifndef USE_GTK_CLIPBOARD
+		gtk_selection_clear_targets(widget, atomClipboard);
+#endif
+
+
 		if (IS_WIDGET_MAPPED(widget)) {
 			gtk_widget_unmap(widget);
 		}
@@ -670,14 +686,6 @@
 
 	gtk_widget_grab_focus(PWidget(wMain));
 
-	gtk_selection_add_targets(GTK_WIDGET(PWidget(wMain)), GDK_SELECTION_PRIMARY,
-	                          clipboardCopyTargets, nClipboardCopyTargets);
-
-#ifndef USE_GTK_CLIPBOARD
-	gtk_selection_add_targets(GTK_WIDGET(PWidget(wMain)), atomClipboard,
-	                          clipboardPasteTargets, nClipboardPasteTargets);
-#endif
-
 	gtk_drag_dest_set(GTK_WIDGET(PWidget(wMain)),
 	                  GTK_DEST_DEFAULT_ALL, clipboardPasteTargets, nClipboardPasteTargets,
 	                  static_cast<GdkDragAction>(GDK_ACTION_COPY | GDK_ACTION_MOVE));


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.



More information about the Commits mailing list