diff options
author | Matthew Brush <matthewbrush@gmail.com> | 2011-03-28 23:12:47 -0700 |
---|---|---|
committer | Matthew Brush <matthewbrush@gmail.com> | 2011-03-28 23:12:47 -0700 |
commit | 9eea472d6597dca24394cce2748610e449bb122c (patch) | |
tree | 43dabe5dd5e13cf8c556978e73aaa77798f15c2f | |
parent | 176aacfd488b45e198bb88c219f3193515bbd822 (diff) | |
download | scintilla-mirror-9eea472d6597dca24394cce2748610e449bb122c.tar.gz |
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
-rw-r--r-- | gtk/ScintillaGTK.cxx | 12 |
1 files changed, 12 insertions, 0 deletions
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); |