aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--gtk/PlatGTK.cxx21
-rw-r--r--gtk/ScintillaGTK.cxx10
2 files changed, 20 insertions, 11 deletions
diff --git a/gtk/PlatGTK.cxx b/gtk/PlatGTK.cxx
index 27c68b93b..63d0c466d 100644
--- a/gtk/PlatGTK.cxx
+++ b/gtk/PlatGTK.cxx
@@ -1338,28 +1338,35 @@ void Window::SetCursor(Cursor curs) {
return;
cursorLast = curs;
+ GdkWindow *pwin = WindowFromWidget(PWidget(wid));
+ if (!pwin)
+ return;
+ GdkDisplay *pdisplay = gdk_window_get_display(pwin);
+ if (!pdisplay)
+ return;
+
GdkCursor *gdkCurs;
switch (curs) {
case cursorText:
- gdkCurs = gdk_cursor_new(GDK_XTERM);
+ gdkCurs = gdk_cursor_new_for_display(pdisplay, GDK_XTERM);
break;
case cursorArrow:
- gdkCurs = gdk_cursor_new(GDK_LEFT_PTR);
+ gdkCurs = gdk_cursor_new_for_display(pdisplay, GDK_LEFT_PTR);
break;
case cursorUp:
- gdkCurs = gdk_cursor_new(GDK_CENTER_PTR);
+ gdkCurs = gdk_cursor_new_for_display(pdisplay, GDK_CENTER_PTR);
break;
case cursorWait:
- gdkCurs = gdk_cursor_new(GDK_WATCH);
+ gdkCurs = gdk_cursor_new_for_display(pdisplay, GDK_WATCH);
break;
case cursorHand:
- gdkCurs = gdk_cursor_new(GDK_HAND2);
+ gdkCurs = gdk_cursor_new_for_display(pdisplay, GDK_HAND2);
break;
case cursorReverseArrow:
- gdkCurs = gdk_cursor_new(GDK_RIGHT_PTR);
+ gdkCurs = gdk_cursor_new_for_display(pdisplay, GDK_RIGHT_PTR);
break;
default:
- gdkCurs = gdk_cursor_new(GDK_LEFT_PTR);
+ gdkCurs = gdk_cursor_new_for_display(pdisplay, GDK_LEFT_PTR);
cursorLast = cursorArrow;
break;
}
diff --git a/gtk/ScintillaGTK.cxx b/gtk/ScintillaGTK.cxx
index e5932a78b..e6d458c00 100644
--- a/gtk/ScintillaGTK.cxx
+++ b/gtk/ScintillaGTK.cxx
@@ -475,7 +475,9 @@ void ScintillaGTK::RealizeThis(GtkWidget *widget) {
attrs.colormap = gtk_widget_get_colormap(widget);
#endif
attrs.event_mask = gtk_widget_get_events(widget) | GDK_EXPOSURE_MASK;
- GdkCursor *cursor = gdk_cursor_new(GDK_XTERM);
+ GdkWindow *pwin = gtk_widget_get_parent_window(widget);
+ GdkDisplay *pdisplay = gdk_window_get_display(pwin);
+ GdkCursor *cursor = gdk_cursor_new_for_display(pdisplay, GDK_XTERM);
attrs.cursor = cursor;
#if GTK_CHECK_VERSION(3,0,0)
gtk_widget_set_window(widget, gdk_window_new(gtk_widget_get_parent_window(widget), &attrs,
@@ -516,15 +518,15 @@ void ScintillaGTK::RealizeThis(GtkWidget *widget) {
gtk_widget_realize(PWidget(scrollbarv));
gtk_widget_realize(PWidget(scrollbarh));
- cursor = gdk_cursor_new(GDK_XTERM);
+ cursor = gdk_cursor_new_for_display(pdisplay, GDK_XTERM);
gdk_window_set_cursor(PWindow(wText), cursor);
UnRefCursor(cursor);
- cursor = gdk_cursor_new(GDK_LEFT_PTR);
+ cursor = gdk_cursor_new_for_display(pdisplay, GDK_LEFT_PTR);
gdk_window_set_cursor(PWindow(scrollbarv), cursor);
UnRefCursor(cursor);
- cursor = gdk_cursor_new(GDK_LEFT_PTR);
+ cursor = gdk_cursor_new_for_display(pdisplay, GDK_LEFT_PTR);
gdk_window_set_cursor(PWindow(scrollbarh), cursor);
UnRefCursor(cursor);