diff options
| -rw-r--r-- | gtk/PlatGTK.cxx | 4 | ||||
| -rw-r--r-- | gtk/ScintillaGTK.cxx | 7 |
2 files changed, 9 insertions, 2 deletions
diff --git a/gtk/PlatGTK.cxx b/gtk/PlatGTK.cxx index f91fbdbe0..742f4ce9b 100644 --- a/gtk/PlatGTK.cxx +++ b/gtk/PlatGTK.cxx @@ -1338,10 +1338,14 @@ void Window::SetCursor(Cursor curs) { return; cursorLast = curs; +#if GTK_CHECK_VERSION(2,24,0) GdkWindow *pwin = WindowFromWidget(PWidget(wid)); if (!pwin) return; GdkDisplay *pdisplay = gdk_window_get_display(pwin); +#else + GdkDisplay *pdisplay = gdk_display_get_default(); +#endif if (!pdisplay) return; diff --git a/gtk/ScintillaGTK.cxx b/gtk/ScintillaGTK.cxx index 21b0841b3..b69f5a2da 100644 --- a/gtk/ScintillaGTK.cxx +++ b/gtk/ScintillaGTK.cxx @@ -474,8 +474,11 @@ void ScintillaGTK::RealizeThis(GtkWidget *widget) { attrs.colormap = gtk_widget_get_colormap(widget); #endif attrs.event_mask = gtk_widget_get_events(widget) | GDK_EXPOSURE_MASK; - GdkWindow *pwin = gtk_widget_get_parent_window(widget); - GdkDisplay *pdisplay = gdk_window_get_display(pwin); +#if GTK_CHECK_VERSION(2,24,0) + GdkDisplay *pdisplay = gdk_window_get_display(gtk_widget_get_parent_window(widget)); +#else + GdkDisplay *pdisplay = gdk_display_get_default(); +#endif GdkCursor *cursor = gdk_cursor_new_for_display(pdisplay, GDK_XTERM); attrs.cursor = cursor; #if GTK_CHECK_VERSION(3,0,0) |
