diff options
author | Alexander Larsson <alexl@redhat.com> | 2006-11-06 16:31:54 +0000 |
---|---|---|
committer | Alexander Larsson <alexl@src.gnome.org> | 2006-11-06 16:31:54 +0000 |
commit | 270f44ecd1a8b4eb4c4362d42f57ce3e9289cab8 (patch) | |
tree | fdcec3852b38ea1ed60b5da0aea8bbc1e00127f2 /libnautilus-private | |
parent | 6529dfeb752b5b5311ac89e2493eb9237ecbdd36 (diff) | |
download | nautilus-270f44ecd1a8b4eb4c4362d42f57ce3e9289cab8.tar.gz |
Cancel rubberbanding if we get a grab shadow event. This happens when a
2006-11-06 Alexander Larsson <alexl@redhat.com>
* libnautilus-private/nautilus-icon-container.c:
Cancel rubberbanding if we get a grab shadow event.
This happens when a modal dialog (e.g. an error or auth dialog)
appears. (Partially fixes #122688)
Diffstat (limited to 'libnautilus-private')
-rw-r--r-- | libnautilus-private/nautilus-icon-container.c | 29 |
1 files changed, 25 insertions, 4 deletions
diff --git a/libnautilus-private/nautilus-icon-container.c b/libnautilus-private/nautilus-icon-container.c index 05a2a1896..02f88d14f 100644 --- a/libnautilus-private/nautilus-icon-container.c +++ b/libnautilus-private/nautilus-icon-container.c @@ -2135,7 +2135,7 @@ start_rubberbanding (NautilusIconContainer *container, static void stop_rubberbanding (NautilusIconContainer *container, - GdkEventButton *event) + guint32 time) { NautilusIconRubberbandInfo *band_info; @@ -2148,11 +2148,10 @@ stop_rubberbanding (NautilusIconContainer *container, band_info->active = FALSE; /* Destroy this canvas item; the parent will unref it. */ - eel_canvas_item_ungrab (band_info->selection_rectangle, event->time); + eel_canvas_item_ungrab (band_info->selection_rectangle, time); gtk_object_destroy (GTK_OBJECT (band_info->selection_rectangle)); band_info->selection_rectangle = NULL; - g_signal_emit (container, signals[BAND_SELECT_ENDED], 0); } @@ -3583,7 +3582,7 @@ button_release_event (GtkWidget *widget, details = container->details; if (event->button == RUBBERBAND_BUTTON && details->rubberband_info.active) { - stop_rubberbanding (container, event); + stop_rubberbanding (container, event->time); return TRUE; } @@ -4467,6 +4466,27 @@ get_accessible (GtkWidget *widget) return eel_accessibility_set_atk_object_return (widget, accessible); } +static void +grab_notify_cb (GtkWidget *widget, + gboolean was_grabbed) +{ + NautilusIconContainer *container; + + container = NAUTILUS_ICON_CONTAINER (widget); + + if (container->details->rubberband_info.active && + !was_grabbed) { + /* we got a (un)grab-notify during rubberband. + * This happens when a new modal dialog shows + * up (e.g. authentication or an error). Stop + * the rubberbanding so that we can handle the + * dialog. */ + stop_rubberbanding (container, + GDK_CURRENT_TIME); + } +} + + /* Initialization. */ static void @@ -4802,6 +4822,7 @@ nautilus_icon_container_class_init (NautilusIconContainerClass *class) widget_class->get_accessible = get_accessible; widget_class->style_set = style_set; widget_class->expose_event = expose_event; + widget_class->grab_notify = grab_notify_cb; canvas_class = EEL_CANVAS_CLASS (class); canvas_class->draw_background = draw_canvas_background; |