From 225f98121898dbdd8d633843c1df70093fd2e5ba Mon Sep 17 00:00:00 2001 From: Ettore Perazzoli Date: Wed, 5 Dec 2001 22:56:54 +0000 Subject: [Fix #7827, Switching desktops leaves the folder bar popped up.] * e-shell-view.c (folder_bar_popup_map_callback): And grab the keyboard as well. (popdown_transient_folder_bar): Ungrab the keyboard as well. (switch_on_folder_tree_click): Likewise. [Fix #16507, Right Click -> View does nothing.] * e-shell-view-menu.c: New verb "ActivateView". (command_activate_view): New, callback for the "ActivateView" verb. svn path=/trunk/; revision=14897 --- shell/ChangeLog | 15 +++++++++++++++ shell/e-shell-view-menu.c | 16 ++++++++++++++++ shell/e-shell-view.c | 13 ++++++++++++- 3 files changed, 43 insertions(+), 1 deletion(-) (limited to 'shell') diff --git a/shell/ChangeLog b/shell/ChangeLog index 7dd91cbf36..155ec88dc4 100644 --- a/shell/ChangeLog +++ b/shell/ChangeLog @@ -1,3 +1,18 @@ +2001-12-04 Ettore Perazzoli + + [Fix #7827, Switching desktops leaves the folder bar popped up.] + + * e-shell-view.c (folder_bar_popup_map_callback): And grab the + keyboard as well. + (popdown_transient_folder_bar): Ungrab the keyboard as well. + (switch_on_folder_tree_click): Likewise. + + [Fix #16507, Right Click -> View does nothing.] + + * e-shell-view-menu.c: New verb "ActivateView". + (command_activate_view): New, callback for the "ActivateView" + verb. + 2001-11-15 Zbigniew Chyla * e-shell-folder-commands.c (e_shell_command_rename_folder): Convert diff --git a/shell/e-shell-view-menu.c b/shell/e-shell-view-menu.c index b20c2e3545..e972184df4 100644 --- a/shell/e-shell-view-menu.c +++ b/shell/e-shell-view-menu.c @@ -283,6 +283,21 @@ command_new_folder (BonoboUIComponent *uih, NULL /* result_callback_data */); } +static void +command_activate_view (BonoboUIComponent *uih, + void *data, + const char *path) +{ + EShellView *shell_view; + char *uri; + + shell_view = E_SHELL_VIEW (data); + + uri = g_strconcat (E_SHELL_URI_PREFIX, get_path_for_folder_op (shell_view), NULL); + e_shell_view_display_uri (shell_view, uri); + g_free (uri); +} + static void command_open_folder_in_new_window (BonoboUIComponent *uih, gpointer data, @@ -592,6 +607,7 @@ BonoboUIVerb file_verbs [] = { }; BonoboUIVerb folder_verbs [] = { + BONOBO_UI_VERB ("ActivateView", command_activate_view), BONOBO_UI_VERB ("OpenFolderInNewWindow", command_open_folder_in_new_window), BONOBO_UI_VERB ("MoveFolder", command_move_folder), BONOBO_UI_VERB ("CopyFolder", command_copy_folder), diff --git a/shell/e-shell-view.c b/shell/e-shell-view.c index fbf80ec9df..b0960a972a 100644 --- a/shell/e-shell-view.c +++ b/shell/e-shell-view.c @@ -403,6 +403,7 @@ popdown_transient_folder_bar (EShellView *shell_view) priv = shell_view->priv; gdk_pointer_ungrab (GDK_CURRENT_TIME); + gdk_keyboard_ungrab (GDK_CURRENT_TIME); gtk_grab_remove (priv->storage_set_view_box); reparent_storage_set_view_box_and_destroy_popup (shell_view); @@ -459,21 +460,30 @@ folder_bar_popup_map_callback (GtkWidget *widget, { EShellView *shell_view; EShellViewPrivate *priv; + guint32 current_time; shell_view = E_SHELL_VIEW (data); priv = shell_view->priv; + current_time = GDK_CURRENT_TIME; + if (gdk_pointer_grab (widget->window, TRUE, (GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK | GDK_ENTER_NOTIFY_MASK | GDK_LEAVE_NOTIFY_MASK | GDK_POINTER_MOTION_MASK), - NULL, NULL, GDK_CURRENT_TIME) != 0) { + NULL, NULL, current_time) != 0) { g_warning ("e-shell-view.c:folder_bar_popup_map_callback() -- pointer grab failed."); return; } + if (gdk_keyboard_grab (widget->window, TRUE, 0) != 0) { + g_warning ("e-shell-view.c:folder_bar_popup_map_callback() -- keyboard grab failed."); + gdk_pointer_ungrab (current_time); + return; + } + gtk_grab_add (widget); gtk_signal_connect_while_alive (GTK_OBJECT (widget), "button_release_event", @@ -576,6 +586,7 @@ switch_on_folder_tree_click (EShellView *shell_view, priv = shell_view->priv; gdk_pointer_ungrab (GDK_CURRENT_TIME); + gdk_keyboard_ungrab (GDK_CURRENT_TIME); gtk_grab_remove (priv->storage_set_view_box); uri = g_strconcat (E_SHELL_URI_PREFIX, path, NULL); -- cgit