aboutsummaryrefslogtreecommitdiffhomepage
path: root/gtk/PlatGTK.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'gtk/PlatGTK.cxx')
-rw-r--r--gtk/PlatGTK.cxx21
1 files changed, 14 insertions, 7 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;
}