summaryrefslogtreecommitdiff
path: root/gtk/gtkdnd.c
diff options
context:
space:
mode:
authorOwen Taylor <otaylor@redhat.com>2002-06-18 20:59:44 +0000
committerOwen Taylor <otaylor@src.gnome.org>2002-06-18 20:59:44 +0000
commit621fb7466a984a45b5d2fc267eac0024d6218030 (patch)
tree3f760dd49587cfc84b71c6989daf5be2b0cbb13d /gtk/gtkdnd.c
parent1371ded54cb57c793a09ccf14c1dfcdcdd6e4a47 (diff)
downloadgtk+-621fb7466a984a45b5d2fc267eac0024d6218030.tar.gz
Replace gdk_cursor_new_for_screen() with gdk_cursor_new_for_display().
Tue Jun 18 14:41:48 2002 Owen Taylor <otaylor@redhat.com> * 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.
Diffstat (limited to 'gtk/gtkdnd.c')
-rw-r--r--gtk/gtkdnd.c26
1 files changed, 11 insertions, 15 deletions
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)
{