From 621fb7466a984a45b5d2fc267eac0024d6218030 Mon Sep 17 00:00:00 2001 From: Owen Taylor Date: Tue, 18 Jun 2002 20:59:44 +0000 Subject: [PATCH] Replace gdk_cursor_new_for_screen() with gdk_cursor_new_for_display(). Tue Jun 18 14:41:48 2002 Owen Taylor * gdk/gdkcursor.[ch] gdk/x11/gdkcursor-x11.c gdk/x11/gdkprivate-x11.h gdk/win32/gdkcursor-win32.c: Replace gdk_cursor_new_for_screen() with gdk_cursor_new_for_display(). (#85671) * gtk/gtkclist.c gtk/gtkcombo.c gtk/gtkcurve.c gtk/gtkdnd.c gtk/gtkentry.c gtk/gtkhandlebox.c gtk/gtkhsv.c gtk/gtklabel.c gtk/gtkpaned.c gtk/gtktext.c gtk/gtktextview.c gtk/gtktipsquery.c gtk/gtktreeviewcolumn.c: Adapt to above change. --- ChangeLog | 13 +++++++++++++ ChangeLog.pre-2-10 | 13 +++++++++++++ ChangeLog.pre-2-2 | 13 +++++++++++++ ChangeLog.pre-2-4 | 13 +++++++++++++ ChangeLog.pre-2-6 | 13 +++++++++++++ ChangeLog.pre-2-8 | 13 +++++++++++++ gdk/gdkcursor.c | 8 ++++---- gdk/gdkcursor.h | 8 ++++---- gdk/win32/gdkcursor-win32.c | 14 ++++++------- gdk/x11/gdkcursor-x11.c | 39 ++++++++++++++++++------------------- gdk/x11/gdkprivate-x11.h | 3 ++- gtk/gtkclist.c | 4 ++-- gtk/gtkcombo.c | 4 ++-- gtk/gtkcurve.c | 2 +- gtk/gtkdnd.c | 26 +++++++++++-------------- gtk/gtkentry.c | 4 ++-- gtk/gtkhandlebox.c | 4 ++-- gtk/gtkhsv.c | 4 ++-- gtk/gtklabel.c | 4 ++-- gtk/gtkpaned.c | 4 ++-- gtk/gtktext.c | 2 +- gtk/gtktextview.c | 8 ++++---- gtk/gtktipsquery.c | 4 ++-- gtk/gtktreeviewcolumn.c | 4 ++-- tests/testgtk.c | 6 +++--- 25 files changed, 152 insertions(+), 78 deletions(-) diff --git a/ChangeLog b/ChangeLog index 03624255ee..4efce67f26 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,16 @@ +Tue Jun 18 14:41:48 2002 Owen Taylor + + * gdk/gdkcursor.[ch] gdk/x11/gdkcursor-x11.c + gdk/x11/gdkprivate-x11.h gdk/win32/gdkcursor-win32.c: Replace + gdk_cursor_new_for_screen() with gdk_cursor_new_for_display(). + (#85671) + + * gtk/gtkclist.c gtk/gtkcombo.c gtk/gtkcurve.c gtk/gtkdnd.c + gtk/gtkentry.c gtk/gtkhandlebox.c gtk/gtkhsv.c gtk/gtklabel.c + gtk/gtkpaned.c gtk/gtktext.c gtk/gtktextview.c + gtk/gtktipsquery.c gtk/gtktreeviewcolumn.c: + Adapt to above change. + Tue Jun 18 12:04:10 2002 Owen Taylor * gdk/gdk.c (gdk_init_check): Change handling diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index 03624255ee..4efce67f26 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,3 +1,16 @@ +Tue Jun 18 14:41:48 2002 Owen Taylor + + * gdk/gdkcursor.[ch] gdk/x11/gdkcursor-x11.c + gdk/x11/gdkprivate-x11.h gdk/win32/gdkcursor-win32.c: Replace + gdk_cursor_new_for_screen() with gdk_cursor_new_for_display(). + (#85671) + + * gtk/gtkclist.c gtk/gtkcombo.c gtk/gtkcurve.c gtk/gtkdnd.c + gtk/gtkentry.c gtk/gtkhandlebox.c gtk/gtkhsv.c gtk/gtklabel.c + gtk/gtkpaned.c gtk/gtktext.c gtk/gtktextview.c + gtk/gtktipsquery.c gtk/gtktreeviewcolumn.c: + Adapt to above change. + Tue Jun 18 12:04:10 2002 Owen Taylor * gdk/gdk.c (gdk_init_check): Change handling diff --git a/ChangeLog.pre-2-2 b/ChangeLog.pre-2-2 index 03624255ee..4efce67f26 100644 --- a/ChangeLog.pre-2-2 +++ b/ChangeLog.pre-2-2 @@ -1,3 +1,16 @@ +Tue Jun 18 14:41:48 2002 Owen Taylor + + * gdk/gdkcursor.[ch] gdk/x11/gdkcursor-x11.c + gdk/x11/gdkprivate-x11.h gdk/win32/gdkcursor-win32.c: Replace + gdk_cursor_new_for_screen() with gdk_cursor_new_for_display(). + (#85671) + + * gtk/gtkclist.c gtk/gtkcombo.c gtk/gtkcurve.c gtk/gtkdnd.c + gtk/gtkentry.c gtk/gtkhandlebox.c gtk/gtkhsv.c gtk/gtklabel.c + gtk/gtkpaned.c gtk/gtktext.c gtk/gtktextview.c + gtk/gtktipsquery.c gtk/gtktreeviewcolumn.c: + Adapt to above change. + Tue Jun 18 12:04:10 2002 Owen Taylor * gdk/gdk.c (gdk_init_check): Change handling diff --git a/ChangeLog.pre-2-4 b/ChangeLog.pre-2-4 index 03624255ee..4efce67f26 100644 --- a/ChangeLog.pre-2-4 +++ b/ChangeLog.pre-2-4 @@ -1,3 +1,16 @@ +Tue Jun 18 14:41:48 2002 Owen Taylor + + * gdk/gdkcursor.[ch] gdk/x11/gdkcursor-x11.c + gdk/x11/gdkprivate-x11.h gdk/win32/gdkcursor-win32.c: Replace + gdk_cursor_new_for_screen() with gdk_cursor_new_for_display(). + (#85671) + + * gtk/gtkclist.c gtk/gtkcombo.c gtk/gtkcurve.c gtk/gtkdnd.c + gtk/gtkentry.c gtk/gtkhandlebox.c gtk/gtkhsv.c gtk/gtklabel.c + gtk/gtkpaned.c gtk/gtktext.c gtk/gtktextview.c + gtk/gtktipsquery.c gtk/gtktreeviewcolumn.c: + Adapt to above change. + Tue Jun 18 12:04:10 2002 Owen Taylor * gdk/gdk.c (gdk_init_check): Change handling diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6 index 03624255ee..4efce67f26 100644 --- a/ChangeLog.pre-2-6 +++ b/ChangeLog.pre-2-6 @@ -1,3 +1,16 @@ +Tue Jun 18 14:41:48 2002 Owen Taylor + + * gdk/gdkcursor.[ch] gdk/x11/gdkcursor-x11.c + gdk/x11/gdkprivate-x11.h gdk/win32/gdkcursor-win32.c: Replace + gdk_cursor_new_for_screen() with gdk_cursor_new_for_display(). + (#85671) + + * gtk/gtkclist.c gtk/gtkcombo.c gtk/gtkcurve.c gtk/gtkdnd.c + gtk/gtkentry.c gtk/gtkhandlebox.c gtk/gtkhsv.c gtk/gtklabel.c + gtk/gtkpaned.c gtk/gtktext.c gtk/gtktextview.c + gtk/gtktipsquery.c gtk/gtktreeviewcolumn.c: + Adapt to above change. + Tue Jun 18 12:04:10 2002 Owen Taylor * gdk/gdk.c (gdk_init_check): Change handling diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index 03624255ee..4efce67f26 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -1,3 +1,16 @@ +Tue Jun 18 14:41:48 2002 Owen Taylor + + * gdk/gdkcursor.[ch] gdk/x11/gdkcursor-x11.c + gdk/x11/gdkprivate-x11.h gdk/win32/gdkcursor-win32.c: Replace + gdk_cursor_new_for_screen() with gdk_cursor_new_for_display(). + (#85671) + + * gtk/gtkclist.c gtk/gtkcombo.c gtk/gtkcurve.c gtk/gtkdnd.c + gtk/gtkentry.c gtk/gtkhandlebox.c gtk/gtkhsv.c gtk/gtklabel.c + gtk/gtkpaned.c gtk/gtktext.c gtk/gtktextview.c + gtk/gtktipsquery.c gtk/gtktreeviewcolumn.c: + Adapt to above change. + Tue Jun 18 12:04:10 2002 Owen Taylor * gdk/gdk.c (gdk_init_check): Change handling diff --git a/gdk/gdkcursor.c b/gdk/gdkcursor.c index dc0b5ee813..d18befe78e 100644 --- a/gdk/gdkcursor.c +++ b/gdk/gdkcursor.c @@ -25,7 +25,7 @@ */ #include "gdkcursor.h" -#include "gdkscreen.h" +#include "gdkdisplay.h" #include "gdkinternals.h" GType @@ -83,8 +83,8 @@ gdk_cursor_unref (GdkCursor *cursor) * gdk_cursor_new: * @cursor_type: cursor to create * - * Creates a new cursor from the set of builtin cursors for the default screen. - * See gdk_cursor_new_for_screen(). + * Creates a new cursor from the set of builtin cursors for the default display. + * See gdk_cursor_new_for_display(). * * To make the cursor invisible, use gdk_cursor_new_from_pixmap() to create * a cursor with no pixels in it. @@ -94,5 +94,5 @@ gdk_cursor_unref (GdkCursor *cursor) GdkCursor* gdk_cursor_new (GdkCursorType cursor_type) { - return gdk_cursor_new_for_screen (gdk_get_default_screen(), cursor_type); + return gdk_cursor_new_for_display (gdk_get_default_display(), cursor_type); } diff --git a/gdk/gdkcursor.h b/gdk/gdkcursor.h index 187299a0ea..5780e5bf96 100644 --- a/gdk/gdkcursor.h +++ b/gdk/gdkcursor.h @@ -105,7 +105,7 @@ struct _GdkCursor GType gdk_cursor_get_type (void); -GdkCursor* gdk_cursor_new_for_screen (GdkScreen *screen, +GdkCursor* gdk_cursor_new_for_display (GdkDisplay *display, GdkCursorType cursor_type); #ifndef GDK_MULTIHEAD_SAFE GdkCursor* gdk_cursor_new (GdkCursorType cursor_type); @@ -116,9 +116,9 @@ GdkCursor* gdk_cursor_new_from_pixmap (GdkPixmap *source, GdkColor *bg, gint x, gint y); -GdkScreen* gdk_cursor_get_screen (GdkCursor *cursor); -GdkCursor* gdk_cursor_ref (GdkCursor *cursor); -void gdk_cursor_unref (GdkCursor *cursor); +GdkDisplay* gdk_cursor_get_display (GdkCursor *cursor); +GdkCursor* gdk_cursor_ref (GdkCursor *cursor); +void gdk_cursor_unref (GdkCursor *cursor); #ifndef GDK_DISABLE_DEPRECATED #define gdk_cursor_destroy gdk_cursor_unref diff --git a/gdk/win32/gdkcursor-win32.c b/gdk/win32/gdkcursor-win32.c index aeac1a7a87..da3a93e1b5 100644 --- a/gdk/win32/gdkcursor-win32.c +++ b/gdk/win32/gdkcursor-win32.c @@ -18,7 +18,7 @@ * Boston, MA 02111-1307, USA. */ -#include "gdkscreen.h" +#include "gdkdisplay.h" #include "gdkcursor.h" #include "gdkprivate-win32.h" @@ -84,14 +84,14 @@ _gdk_win32_data_to_wcursor (GdkCursorType cursor_type) } GdkCursor* -gdk_cursor_new_for_screen (GdkScreen *screen, - GdkCursorType cursor_type) +gdk_cursor_new_for_display (GdkDisplay *display, + GdkCursorType cursor_type) { GdkCursorPrivate *private; GdkCursor *cursor; HCURSOR hcursor; - g_return_val_if_fail (screen == gdk_get_default_screen (), NULL); + g_return_val_if_fail (display == gdk_get_default_display (), NULL); hcursor = _gdk_win32_data_to_wcursor (cursor_type); @@ -307,8 +307,8 @@ _gdk_cursor_destroy (GdkCursor *cursor) g_free (private); } -GdkScreen * -gdk_cursor_get_screen (GdkCursor *cursor) +GdkDisplay * +gdk_cursor_get_display (GdkCursor *cursor) { - return gdk_get_default_screen (); + return gdk_get_default_display (); } diff --git a/gdk/x11/gdkcursor-x11.c b/gdk/x11/gdkcursor-x11.c index 5b995ec689..813b9acec9 100644 --- a/gdk/x11/gdkcursor-x11.c +++ b/gdk/x11/gdkcursor-x11.c @@ -32,11 +32,10 @@ #include "gdkpixmap-x11.h" #include "gdkx.h" #include -#include "gdkscreen-x11.h" /** - * gdk_cursor_new_for_screen: - * @screen: the #GdkScreen where the cursor will be defined + * gdk_cursor_new_for_display: + * @display: the #GdkDisplay for which the cursor will be created * @cursor_type: cursor to create * * Creates a new cursor from the set of builtin cursors. @@ -101,18 +100,18 @@ * Return value: a new #GdkCursor **/ GdkCursor* -gdk_cursor_new_for_screen (GdkScreen *screen, - GdkCursorType cursor_type) +gdk_cursor_new_for_display (GdkDisplay *display, + GdkCursorType cursor_type) { GdkCursorPrivate *private; GdkCursor *cursor; Cursor xcursor; - g_return_val_if_fail (GDK_IS_SCREEN (screen), NULL); + g_return_val_if_fail (GDK_IS_DISPLAY (display), NULL); - xcursor = XCreateFontCursor (GDK_SCREEN_XDISPLAY (screen), cursor_type); + xcursor = XCreateFontCursor (GDK_DISPLAY_XDISPLAY (display), cursor_type); private = g_new (GdkCursorPrivate, 1); - private->screen = screen; + private->display = display; private->xcursor = xcursor; cursor = (GdkCursor *) private; cursor->type = cursor_type; @@ -134,7 +133,7 @@ gdk_cursor_new_from_pixmap (GdkPixmap *source, Pixmap source_pixmap, mask_pixmap; Cursor xcursor; XColor xfg, xbg; - GdkScreen *screen; + GdkDisplay *display; g_return_val_if_fail (GDK_IS_PIXMAP (source), NULL); g_return_val_if_fail (GDK_IS_PIXMAP (mask), NULL); @@ -143,7 +142,7 @@ gdk_cursor_new_from_pixmap (GdkPixmap *source, source_pixmap = GDK_PIXMAP_XID (source); mask_pixmap = GDK_PIXMAP_XID (mask); - screen = GDK_PIXMAP_SCREEN (source); + display = GDK_PIXMAP_DISPLAY (source); xfg.pixel = fg->pixel; xfg.red = fg->red; @@ -154,10 +153,10 @@ gdk_cursor_new_from_pixmap (GdkPixmap *source, xbg.blue = bg->blue; xbg.green = bg->green; - xcursor = XCreatePixmapCursor (GDK_SCREEN_XDISPLAY (screen), + xcursor = XCreatePixmapCursor (GDK_DISPLAY_XDISPLAY (display), source_pixmap, mask_pixmap, &xfg, &xbg, x, y); private = g_new (GdkCursorPrivate, 1); - private->screen = screen; + private->display = display; private->xcursor = xcursor; cursor = (GdkCursor *) private; cursor->type = GDK_CURSOR_IS_PIXMAP; @@ -175,7 +174,7 @@ _gdk_cursor_destroy (GdkCursor *cursor) g_return_if_fail (cursor->ref_count == 0); private = (GdkCursorPrivate *) cursor; - XFreeCursor (GDK_SCREEN_XDISPLAY (private->screen), private->xcursor); + XFreeCursor (GDK_DISPLAY_XDISPLAY (private->display), private->xcursor); g_free (private); } @@ -185,7 +184,7 @@ gdk_x11_cursor_get_xdisplay (GdkCursor *cursor) { g_return_val_if_fail (cursor != NULL, NULL); - return GDK_SCREEN_XDISPLAY(((GdkCursorPrivate *)cursor)->screen); + return GDK_DISPLAY_XDISPLAY(((GdkCursorPrivate *)cursor)->display); } Cursor @@ -197,18 +196,18 @@ gdk_x11_cursor_get_xcursor (GdkCursor *cursor) } /** - * gdk_cursor_get_screen: + * gdk_cursor_get_display: * @cursor : a #GdkCursor. * - * Returns the screen on which the GdkCursor is defined + * Returns the display on which the GdkCursor is defined * - * Returns : the #GdkScreen associated to @cursor + * Returns : the #GdkDisplay associated to @cursor */ -GdkScreen * -gdk_cursor_get_screen (GdkCursor *cursor) +GdkDisplay * +gdk_cursor_get_display (GdkCursor *cursor) { g_return_val_if_fail (cursor != NULL, NULL); - return ((GdkCursorPrivate *)cursor)->screen; + return ((GdkCursorPrivate *)cursor)->display; } diff --git a/gdk/x11/gdkprivate-x11.h b/gdk/x11/gdkprivate-x11.h index e67968938f..d458c281f6 100644 --- a/gdk/x11/gdkprivate-x11.h +++ b/gdk/x11/gdkprivate-x11.h @@ -35,6 +35,7 @@ #include #include #include +#include #include "gdkinternals.h" @@ -81,7 +82,7 @@ struct _GdkCursorPrivate { GdkCursor cursor; Cursor xcursor; - GdkScreen *screen; + GdkDisplay *display; }; struct _GdkVisualPrivate diff --git a/gtk/gtkclist.c b/gtk/gtkclist.c index 77b69a7523..f66a12d72f 100644 --- a/gtk/gtkclist.c +++ b/gtk/gtkclist.c @@ -4545,8 +4545,8 @@ gtk_clist_realize (GtkWidget *widget) GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK); attributes_mask = GDK_WA_CURSOR; - attributes.cursor = gdk_cursor_new_for_screen (gtk_widget_get_screen (widget), - GDK_SB_H_DOUBLE_ARROW); + attributes.cursor = gdk_cursor_new_for_display (gtk_widget_get_display (widget), + GDK_SB_H_DOUBLE_ARROW); clist->cursor_drag = attributes.cursor; attributes.x = LIST_WIDTH (clist) + 1; diff --git a/gtk/gtkcombo.c b/gtk/gtkcombo.c index a425d9800c..3c4e6cd637 100644 --- a/gtk/gtkcombo.c +++ b/gtk/gtkcombo.c @@ -757,8 +757,8 @@ gtk_combo_list_key_press (GtkWidget * widget, GdkEventKey * event, GtkCombo * co static void combo_event_box_realize (GtkWidget *widget) { - GdkCursor *cursor = gdk_cursor_new_for_screen (gtk_widget_get_screen (widget), - GDK_TOP_LEFT_ARROW); + GdkCursor *cursor = gdk_cursor_new_for_display (gtk_widget_get_display (widget), + GDK_TOP_LEFT_ARROW); gdk_window_set_cursor (widget->window, cursor); gdk_cursor_destroy (cursor); } diff --git a/gtk/gtkcurve.c b/gtk/gtkcurve.c index f3fb148ffe..5f20d177bf 100644 --- a/gtk/gtkcurve.c +++ b/gtk/gtkcurve.c @@ -652,7 +652,7 @@ gtk_curve_graph_events (GtkWidget *widget, GdkEvent *event, GtkCurve *c) c->cursor_type = new_type; - cursor = gdk_cursor_new_for_screen (gtk_widget_get_screen (w), + cursor = gdk_cursor_new_for_display (gtk_widget_get_display (w), c->cursor_type); gdk_window_set_cursor (w->window, cursor); gdk_cursor_destroy (cursor); diff --git a/gtk/gtkdnd.c b/gtk/gtkdnd.c index 09af044ad8..ca6c833bdf 100644 --- a/gtk/gtkdnd.c +++ b/gtk/gtkdnd.c @@ -182,7 +182,7 @@ static void gtk_drag_get_event_actions (GdkEvent *event, GdkDragAction actions, GdkDragAction *suggested_action, GdkDragAction *possible_actions); -static GdkCursor * gtk_drag_get_cursor (GdkScreen *screen, +static GdkCursor * gtk_drag_get_cursor (GdkDisplay *display, GdkDragAction action); static GtkWidget *gtk_drag_get_ipc_widget (GdkScreen *screen); static void gtk_drag_release_ipc_widget (GtkWidget *widget); @@ -552,7 +552,7 @@ gtk_drag_get_event_actions (GdkEvent *event, } static GdkCursor * -gtk_drag_get_cursor (GdkScreen *screen, +gtk_drag_get_cursor (GdkDisplay *display, GdkDragAction action) { gint i; @@ -562,7 +562,7 @@ gtk_drag_get_cursor (GdkScreen *screen, break; if (drag_cursors[i].cursor != NULL) { - if (screen != gdk_cursor_get_screen (drag_cursors[i].cursor)) + if (display != gdk_cursor_get_display (drag_cursors[i].cursor)) { gdk_cursor_unref (drag_cursors[i].cursor); drag_cursors[i].cursor = NULL; @@ -571,21 +571,17 @@ gtk_drag_get_cursor (GdkScreen *screen, if (drag_cursors[i].cursor == NULL) { - GdkColormap *colormap; - GdkColor fg, bg; + GdkColor bg = { 0, 0xffff, 0xffff, 0xffff }; + GdkColor fg = { 0, 0x0000, 0x0000, 0x0000 }; + GdkScreen *screen = gdk_display_get_default_screen (display); + GdkWindow *window = gdk_screen_get_root_window (screen); GdkPixmap *pixmap = - gdk_bitmap_create_from_data (gdk_screen_get_root_window (screen), - drag_cursors[i].bits, CURSOR_WIDTH, CURSOR_HEIGHT); + gdk_bitmap_create_from_data (window, drag_cursors[i].bits, CURSOR_WIDTH, CURSOR_HEIGHT); GdkPixmap *mask = - gdk_bitmap_create_from_data (gdk_screen_get_root_window (screen), - drag_cursors[i].mask, CURSOR_WIDTH, CURSOR_HEIGHT); + gdk_bitmap_create_from_data (window, drag_cursors[i].mask, CURSOR_WIDTH, CURSOR_HEIGHT); - colormap = gdk_screen_get_system_colormap (screen); - gdk_color_white (colormap, &bg); - gdk_color_black (colormap, &fg); - drag_cursors[i].cursor = gdk_cursor_new_from_pixmap (pixmap, mask, &fg, &bg, 0, 0); gdk_pixmap_unref (pixmap); @@ -1843,7 +1839,7 @@ gtk_drag_begin (GtkWidget *widget, gtk_drag_get_event_actions (event, info->button, actions, &suggested_action, &possible_actions); - info->cursor = gtk_drag_get_cursor (gtk_widget_get_screen (widget), suggested_action); + info->cursor = gtk_drag_get_cursor (gtk_widget_get_display (widget), suggested_action); /* Set cur_x, cur_y here so if the "drag_begin" signal shows * the drag icon, it will be in the right place @@ -2467,7 +2463,7 @@ _gtk_drag_source_handle_event (GtkWidget *widget, } else if (info->have_grab) { - cursor = gtk_drag_get_cursor (gtk_widget_get_screen (widget), + cursor = gtk_drag_get_cursor (gtk_widget_get_display (widget), event->dnd.context->action); if (info->cursor != cursor) { diff --git a/gtk/gtkentry.c b/gtk/gtkentry.c index d8d6f7a65b..8231f940d5 100644 --- a/gtk/gtkentry.c +++ b/gtk/gtkentry.c @@ -972,7 +972,7 @@ gtk_entry_realize (GtkWidget *widget) get_text_area_size (entry, &attributes.x, &attributes.y, &attributes.width, &attributes.height); - attributes.cursor = gdk_cursor_new_for_screen (gtk_widget_get_screen (widget), GDK_XTERM); + attributes.cursor = gdk_cursor_new_for_display (gtk_widget_get_display (widget), GDK_XTERM); attributes_mask |= GDK_WA_CURSOR; entry->text_area = gdk_window_new (widget->window, &attributes, attributes_mask); @@ -1435,7 +1435,7 @@ gtk_entry_motion_notify (GtkWidget *widget, { GdkCursor *cursor; - cursor = gdk_cursor_new_for_screen (gtk_widget_get_screen (widget), GDK_XTERM); + cursor = gdk_cursor_new_for_display (gtk_widget_get_display (widget), GDK_XTERM); gdk_window_set_cursor (entry->text_area, cursor); gdk_cursor_unref (cursor); entry->mouse_cursor_obscured = FALSE; diff --git a/gtk/gtkhandlebox.c b/gtk/gtkhandlebox.c index da46d0a651..73e198c18e 100644 --- a/gtk/gtkhandlebox.c +++ b/gtk/gtkhandlebox.c @@ -990,8 +990,8 @@ gtk_handle_box_button_changed (GtkWidget *widget, hb->attach_allocation.height = height; hb->in_drag = TRUE; - fleur = gdk_cursor_new_for_screen (gdk_drawable_get_screen (widget->window), - GDK_FLEUR); + fleur = gdk_cursor_new_for_display (gtk_widget_get_display (widget), + GDK_FLEUR); if (gdk_pointer_grab (widget->window, FALSE, (GDK_BUTTON1_MOTION_MASK | diff --git a/gtk/gtkhsv.c b/gtk/gtkhsv.c index a2a77f1358..a950ea5d54 100644 --- a/gtk/gtkhsv.c +++ b/gtk/gtkhsv.c @@ -753,8 +753,8 @@ set_cross_grab (GtkHSV *hsv, priv = hsv->priv; - cursor = gdk_cursor_new_for_screen (gtk_widget_get_screen (GTK_WIDGET (hsv)), - GDK_CROSSHAIR); + cursor = gdk_cursor_new_for_display (gtk_widget_get_display (GTK_WIDGET (hsv)), + GDK_CROSSHAIR); gdk_pointer_grab (priv->window, FALSE, (GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK diff --git a/gtk/gtklabel.c b/gtk/gtklabel.c index 936662539c..8b9ca6aceb 100644 --- a/gtk/gtklabel.c +++ b/gtk/gtklabel.c @@ -2292,8 +2292,8 @@ gtk_label_create_window (GtkLabel *label) attributes.window_type = GDK_WINDOW_TEMP; attributes.wclass = GDK_INPUT_ONLY; attributes.override_redirect = TRUE; - attributes.cursor = gdk_cursor_new_for_screen (gtk_widget_get_screen (widget), - GDK_XTERM); + attributes.cursor = gdk_cursor_new_for_display (gtk_widget_get_display (widget), + GDK_XTERM); attributes.event_mask = gtk_widget_get_events (widget) | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK | diff --git a/gtk/gtkpaned.c b/gtk/gtkpaned.c index 53051f3d34..7e28dc7dd9 100644 --- a/gtk/gtkpaned.c +++ b/gtk/gtkpaned.c @@ -459,8 +459,8 @@ gtk_paned_realize (GtkWidget *widget) attributes.y = paned->handle_pos.y; attributes.width = paned->handle_pos.width; attributes.height = paned->handle_pos.height; - attributes.cursor = gdk_cursor_new_for_screen (gtk_widget_get_screen (widget), - paned->cursor_type); + attributes.cursor = gdk_cursor_new_for_display (gtk_widget_get_display (widget), + paned->cursor_type); attributes.event_mask = gtk_widget_get_events (widget); attributes.event_mask |= (GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK | diff --git a/gtk/gtktext.c b/gtk/gtktext.c index f1519173aa..b9eff75392 100644 --- a/gtk/gtktext.c +++ b/gtk/gtktext.c @@ -1344,7 +1344,7 @@ gtk_text_realize (GtkWidget *widget) attributes.width = MAX (1, (gint)widget->allocation.width - (gint)attributes.x * 2); attributes.height = MAX (1, (gint)widget->allocation.height - (gint)attributes.y * 2); - attributes.cursor = gdk_cursor_new_for_screen (gtk_widget_get_screen (widget), GDK_XTERM); + attributes.cursor = gdk_cursor_new_for_display (gtk_widget_get_display (widget), GDK_XTERM); attributes_mask |= GDK_WA_CURSOR; text->text_area = gdk_window_new (widget->window, &attributes, attributes_mask); diff --git a/gtk/gtktextview.c b/gtk/gtktextview.c index 4a8c69f522..099809f522 100644 --- a/gtk/gtktextview.c +++ b/gtk/gtktextview.c @@ -3987,8 +3987,8 @@ gtk_text_view_motion_event (GtkWidget *widget, GdkEventMotion *event) { GdkCursor *cursor; - cursor = gdk_cursor_new_for_screen (gtk_widget_get_screen (widget), - GDK_XTERM); + cursor = gdk_cursor_new_for_display (gtk_widget_get_display (widget), + GDK_XTERM); gdk_window_set_cursor (text_view->text_window->bin_window, cursor); gdk_cursor_unref (cursor); text_view->mouse_cursor_obscured = FALSE; @@ -6581,8 +6581,8 @@ text_window_realize (GtkTextWindow *win, if (win->type == GTK_TEXT_WINDOW_TEXT) { /* I-beam cursor */ - cursor = gdk_cursor_new_for_screen (gdk_drawable_get_screen (parent), - GDK_XTERM); + cursor = gdk_cursor_new_for_display (gdk_drawable_get_display (parent), + GDK_XTERM); gdk_window_set_cursor (win->bin_window, cursor); gdk_cursor_unref (cursor); diff --git a/gtk/gtktipsquery.c b/gtk/gtktipsquery.c index faab09c07b..98f1c05306 100644 --- a/gtk/gtktipsquery.c +++ b/gtk/gtktipsquery.c @@ -342,8 +342,8 @@ gtk_tips_query_real_start_query (GtkTipsQuery *tips_query) g_return_if_fail (GTK_IS_TIPS_QUERY (tips_query)); - tips_query->query_cursor = gdk_cursor_new_for_screen (gtk_widget_get_screen (GTK_WIDGET (tips_query)), - GDK_QUESTION_ARROW); + tips_query->query_cursor = gdk_cursor_new_for_display (gtk_widget_get_display (GTK_WIDGET (tips_query)), + GDK_QUESTION_ARROW); failure = gdk_pointer_grab (GTK_WIDGET (tips_query)->window, TRUE, GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK | diff --git a/gtk/gtktreeviewcolumn.c b/gtk/gtktreeviewcolumn.c index 74cd5d794f..c876a1eaa6 100644 --- a/gtk/gtktreeviewcolumn.c +++ b/gtk/gtktreeviewcolumn.c @@ -980,8 +980,8 @@ _gtk_tree_view_column_realize_button (GtkTreeViewColumn *column) GDK_POINTER_MOTION_HINT_MASK | GDK_KEY_PRESS_MASK); attributes_mask = GDK_WA_CURSOR | GDK_WA_X | GDK_WA_Y; - attr.cursor = gdk_cursor_new_for_screen (gdk_drawable_get_screen (tree_view->priv->header_window), - GDK_SB_H_DOUBLE_ARROW); + attr.cursor = gdk_cursor_new_for_display (gdk_drawable_get_display (tree_view->priv->header_window), + GDK_SB_H_DOUBLE_ARROW); attr.y = 0; attr.width = TREE_VIEW_DRAG_WIDTH; attr.height = tree_view->priv->header_height; diff --git a/tests/testgtk.c b/tests/testgtk.c index 0eadd2bd24..2c6704e1e2 100644 --- a/tests/testgtk.c +++ b/tests/testgtk.c @@ -4846,7 +4846,7 @@ set_cursor (GtkWidget *spinner, else gtk_label_set_text (GTK_LABEL (label), ""); - cursor = gdk_cursor_new_for_screen (gtk_widget_get_screen (widget), c); + cursor = gdk_cursor_new_for_display (gtk_widget_get_display (widget), c); gdk_window_set_cursor (widget->window, cursor); gdk_cursor_unref (cursor); } @@ -10727,8 +10727,8 @@ query_properties (GtkButton *button, if (!data->cursor) - data->cursor = gdk_cursor_new_for_screen (gtk_widget_get_screen (GTK_WIDGET (button)), - GDK_TARGET); + data->cursor = gdk_cursor_new_for_display (gtk_widget_get_display (GTK_WIDGET (button)), + GDK_TARGET); failure = gdk_pointer_grab (GTK_WIDGET (button)->window, TRUE,