diff options
author | Owen Taylor <otaylor@redhat.com> | 1999-02-02 18:40:47 +0000 |
---|---|---|
committer | Owen Taylor <otaylor@src.gnome.org> | 1999-02-02 18:40:47 +0000 |
commit | 902de9d4131028e235b6dc52c479da588ab5110c (patch) | |
tree | a2110826944191263cfaa0d5bde8ac4e7c19ab25 | |
parent | 7e68d71fd2039c85056b474469256d1eec09acef (diff) | |
download | gdk-pixbuf-902de9d4131028e235b6dc52c479da588ab5110c.tar.gz |
Make sure we set the icon window position before it is shown to prevent
Tue Feb 2 12:39:42 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkdnd.c: Make sure we set the icon window position
before it is shown to prevent annoying flicking to 0,0.
Make it consistent that info->cur_x/y do not include
info->hot_x/y displacement.
-rw-r--r-- | ChangeLog | 13 | ||||
-rw-r--r-- | ChangeLog.pre-2-0 | 13 | ||||
-rw-r--r-- | ChangeLog.pre-2-10 | 13 | ||||
-rw-r--r-- | ChangeLog.pre-2-2 | 13 | ||||
-rw-r--r-- | ChangeLog.pre-2-4 | 13 | ||||
-rw-r--r-- | ChangeLog.pre-2-6 | 13 | ||||
-rw-r--r-- | ChangeLog.pre-2-8 | 13 | ||||
-rw-r--r-- | gtk/gtkdnd.c | 53 |
8 files changed, 122 insertions, 22 deletions
@@ -1,3 +1,16 @@ +Tue Feb 2 12:39:42 1999 Owen Taylor <otaylor@redhat.com> + + * gtk/gtkdnd.c: Make sure we set the icon window position + before it is shown to prevent annoying flicking to 0,0. + Make it consistent that info->cur_x/y do not include + info->hot_x/y displacement. + +Tue Feb 2 11:06:02 1999 Owen Taylor <otaylor@redhat.com> + + * gtk/gtkrange.c (gtk_range_style_set): Fixes + to account for the changed structure of the windows + of range widgets. + Tue Feb 2 08:59:16 GMT 1999 Tony Gale <gale@gtk.org> * docs/gtk_tut.sgml: new sections on Layout and diff --git a/ChangeLog.pre-2-0 b/ChangeLog.pre-2-0 index 739dee097..6c2e70381 100644 --- a/ChangeLog.pre-2-0 +++ b/ChangeLog.pre-2-0 @@ -1,3 +1,16 @@ +Tue Feb 2 12:39:42 1999 Owen Taylor <otaylor@redhat.com> + + * gtk/gtkdnd.c: Make sure we set the icon window position + before it is shown to prevent annoying flicking to 0,0. + Make it consistent that info->cur_x/y do not include + info->hot_x/y displacement. + +Tue Feb 2 11:06:02 1999 Owen Taylor <otaylor@redhat.com> + + * gtk/gtkrange.c (gtk_range_style_set): Fixes + to account for the changed structure of the windows + of range widgets. + Tue Feb 2 08:59:16 GMT 1999 Tony Gale <gale@gtk.org> * docs/gtk_tut.sgml: new sections on Layout and diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index 739dee097..6c2e70381 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,3 +1,16 @@ +Tue Feb 2 12:39:42 1999 Owen Taylor <otaylor@redhat.com> + + * gtk/gtkdnd.c: Make sure we set the icon window position + before it is shown to prevent annoying flicking to 0,0. + Make it consistent that info->cur_x/y do not include + info->hot_x/y displacement. + +Tue Feb 2 11:06:02 1999 Owen Taylor <otaylor@redhat.com> + + * gtk/gtkrange.c (gtk_range_style_set): Fixes + to account for the changed structure of the windows + of range widgets. + Tue Feb 2 08:59:16 GMT 1999 Tony Gale <gale@gtk.org> * docs/gtk_tut.sgml: new sections on Layout and diff --git a/ChangeLog.pre-2-2 b/ChangeLog.pre-2-2 index 739dee097..6c2e70381 100644 --- a/ChangeLog.pre-2-2 +++ b/ChangeLog.pre-2-2 @@ -1,3 +1,16 @@ +Tue Feb 2 12:39:42 1999 Owen Taylor <otaylor@redhat.com> + + * gtk/gtkdnd.c: Make sure we set the icon window position + before it is shown to prevent annoying flicking to 0,0. + Make it consistent that info->cur_x/y do not include + info->hot_x/y displacement. + +Tue Feb 2 11:06:02 1999 Owen Taylor <otaylor@redhat.com> + + * gtk/gtkrange.c (gtk_range_style_set): Fixes + to account for the changed structure of the windows + of range widgets. + Tue Feb 2 08:59:16 GMT 1999 Tony Gale <gale@gtk.org> * docs/gtk_tut.sgml: new sections on Layout and diff --git a/ChangeLog.pre-2-4 b/ChangeLog.pre-2-4 index 739dee097..6c2e70381 100644 --- a/ChangeLog.pre-2-4 +++ b/ChangeLog.pre-2-4 @@ -1,3 +1,16 @@ +Tue Feb 2 12:39:42 1999 Owen Taylor <otaylor@redhat.com> + + * gtk/gtkdnd.c: Make sure we set the icon window position + before it is shown to prevent annoying flicking to 0,0. + Make it consistent that info->cur_x/y do not include + info->hot_x/y displacement. + +Tue Feb 2 11:06:02 1999 Owen Taylor <otaylor@redhat.com> + + * gtk/gtkrange.c (gtk_range_style_set): Fixes + to account for the changed structure of the windows + of range widgets. + Tue Feb 2 08:59:16 GMT 1999 Tony Gale <gale@gtk.org> * docs/gtk_tut.sgml: new sections on Layout and diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6 index 739dee097..6c2e70381 100644 --- a/ChangeLog.pre-2-6 +++ b/ChangeLog.pre-2-6 @@ -1,3 +1,16 @@ +Tue Feb 2 12:39:42 1999 Owen Taylor <otaylor@redhat.com> + + * gtk/gtkdnd.c: Make sure we set the icon window position + before it is shown to prevent annoying flicking to 0,0. + Make it consistent that info->cur_x/y do not include + info->hot_x/y displacement. + +Tue Feb 2 11:06:02 1999 Owen Taylor <otaylor@redhat.com> + + * gtk/gtkrange.c (gtk_range_style_set): Fixes + to account for the changed structure of the windows + of range widgets. + Tue Feb 2 08:59:16 GMT 1999 Tony Gale <gale@gtk.org> * docs/gtk_tut.sgml: new sections on Layout and diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index 739dee097..6c2e70381 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -1,3 +1,16 @@ +Tue Feb 2 12:39:42 1999 Owen Taylor <otaylor@redhat.com> + + * gtk/gtkdnd.c: Make sure we set the icon window position + before it is shown to prevent annoying flicking to 0,0. + Make it consistent that info->cur_x/y do not include + info->hot_x/y displacement. + +Tue Feb 2 11:06:02 1999 Owen Taylor <otaylor@redhat.com> + + * gtk/gtkrange.c (gtk_range_style_set): Fixes + to account for the changed structure of the windows + of range widgets. + Tue Feb 2 08:59:16 GMT 1999 Tony Gale <gale@gtk.org> * docs/gtk_tut.sgml: new sections on Layout and diff --git a/gtk/gtkdnd.c b/gtk/gtkdnd.c index 8ffdd2abf..612f1fc26 100644 --- a/gtk/gtkdnd.c +++ b/gtk/gtkdnd.c @@ -1556,6 +1556,23 @@ gtk_drag_begin (GtkWidget *widget, if (event) info->cursor = gtk_drag_get_cursor (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 + */ + if (event->type == GDK_MOTION_NOTIFY) + { + info->cur_x = event->motion.x_root; + info->cur_y = event->motion.y_root; + } + else + { + gint x, y; + gdk_window_get_pointer (GDK_ROOT_PARENT(), &x, &y, NULL); + + info->cur_x = x; + info->cur_y = y; + } + gtk_signal_emit_by_name (GTK_OBJECT (widget), "drag_begin", info->context); @@ -1571,20 +1588,6 @@ gtk_drag_begin (GtkWidget *widget, if (event->type == GDK_MOTION_NOTIFY) gtk_drag_motion_cb (info->ipc_widget, (GdkEventMotion *)event, info); - else - { - gint x, y; - gdk_window_get_pointer (GDK_ROOT_PARENT(), &x, &y, NULL); - - info->cur_x = x; - info->cur_y = y; - - if (info->icon_window) - { - gdk_window_raise (info->icon_window->window); - gtk_widget_set_uposition (info->icon_window, x - info->hot_x, y - info->hot_y); - } - } info->start_x = info->cur_x; info->start_y = info->cur_y; @@ -1754,16 +1757,18 @@ gtk_drag_set_icon_widget (GdkDragContext *context, gtk_drag_remove_icon (info); info->icon_window = widget; + info->hot_x = hot_x; + info->hot_y = hot_y; + if (widget) { - gtk_widget_set_uposition (widget, info->cur_x, info->cur_y); + gtk_widget_set_uposition (widget, + info->cur_x - info->hot_x, + info->cur_y - info->hot_y); gtk_widget_ref (widget); gdk_window_raise (widget->window); gtk_widget_show (widget); } - - info->hot_x = hot_x; - info->hot_y = hot_y; } /************************************************************* @@ -2338,7 +2343,9 @@ gtk_drag_anim_timeout (gpointer data) y = (anim->info->start_y * (anim->step + 1) + anim->info->cur_y * (anim->n_steps - anim->step - 1)) / anim->n_steps; if (anim->info->icon_window) - gtk_widget_set_uposition (anim->info->icon_window, x, y); + gtk_widget_set_uposition (anim->info->icon_window, + x - anim->info->hot_x, + y - anim->info->hot_y); anim->step++; @@ -2427,13 +2434,15 @@ gtk_drag_motion_cb (GtkWidget *widget, info->possible_actions, &action, &possible_actions); - info->cur_x = event->x_root - info->hot_x; - info->cur_y = event->y_root - info->hot_y; + info->cur_x = event->x_root; + info->cur_y = event->y_root; if (info->icon_window) { gdk_window_raise (info->icon_window->window); - gtk_widget_set_uposition (info->icon_window, info->cur_x, info->cur_y); + gtk_widget_set_uposition (info->icon_window, + info->cur_x - info->hot_x, + info->cur_y - info->hot_y); window = info->icon_window->window; } |