From 37e46c39ed8edf42f438719963d2cf2bc84439cb Mon Sep 17 00:00:00 2001 From: Matthew Brush Date: Mon, 28 Mar 2011 23:12:47 -0700 Subject: Reset cursors when Scintilla widget is realized. Solves problem which occurs when Scintilla widget is unrealized and then re-realized and the cursor is left at GDK_XTERM even over the scrollbars. When the Scintilla widget is unrealized it's GdkWindows are destroyed and so the previous cursors are lost. This commit forces default cursors on the text and scrollbar windows when the widget is realized. References: http://www.mail-archive.com/scintilla-interest@lyra.org/msg01364.html http://git.geany.org/geany/tree/plugins/splitwindow.c#n310 http://www.mail-archive.com/geany@uvena.de/msg00821.html --- gtk/ScintillaGTK.cxx | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'gtk') diff --git a/gtk/ScintillaGTK.cxx b/gtk/ScintillaGTK.cxx index 42f9bc756..f36af2760 100644 --- a/gtk/ScintillaGTK.cxx +++ b/gtk/ScintillaGTK.cxx @@ -421,6 +421,18 @@ void ScintillaGTK::RealizeThis(GtkWidget *widget) { gtk_widget_realize(PWidget(scrollbarv)); gtk_widget_realize(PWidget(scrollbarh)); + cursor = gdk_cursor_new(GDK_XTERM); + gdk_window_set_cursor(PWidget(wText)->window, cursor); + gdk_cursor_unref(cursor); + + cursor = gdk_cursor_new(GDK_LEFT_PTR); + gdk_window_set_cursor(PWidget(scrollbarv)->window, cursor); + gdk_cursor_unref(cursor); + + cursor = gdk_cursor_new(GDK_LEFT_PTR); + gdk_window_set_cursor(PWidget(scrollbarh)->window, cursor); + gdk_cursor_unref(cursor); + gtk_selection_add_targets(widget, GDK_SELECTION_PRIMARY, clipboardCopyTargets, nClipboardCopyTargets); -- cgit v1.2.3