diff options
author | Dan Winship <danw@src.gnome.org> | 2003-04-08 04:20:00 +0800 |
---|---|---|
committer | Dan Winship <danw@src.gnome.org> | 2003-04-08 04:20:00 +0800 |
commit | 320484b37fb316e369b66d3bf11484854d8911ca (patch) | |
tree | 95e0ffbfea497e8ef9ef24c54160445850dcaa37 /shell | |
parent | 42d845bd31c3cfb824d417baccb37ba0db0118b3 (diff) | |
download | gsoc2013-evolution-320484b37fb316e369b66d3bf11484854d8911ca.tar.gz gsoc2013-evolution-320484b37fb316e369b66d3bf11484854d8911ca.tar.zst gsoc2013-evolution-320484b37fb316e369b66d3bf11484854d8911ca.zip |
Desensitize the window's top-level container rather than desensitizing the
* evolution-folder-selector-button.c (clicked): Desensitize the
window's top-level container rather than desensitizing the window
itself, which causes strange problems [#40854]. Also fix up the
code that tries to watch for the parent window being destroyed.
* e-shell.c (impl_Shell_selectUserFolder): Use
e_dialog_set_transient_for_xid.
* e-shell-folder-selection-dialog.c (impl_response): Treat
GTK_RESPONSE_DELETE_EVENT the same as GTK_RESPONSE_CANCEL.
(e_shell_folder_selection_dialog_construct): No need to catch
"delete_event" signal.
svn path=/trunk/; revision=20729
Diffstat (limited to 'shell')
-rw-r--r-- | shell/ChangeLog | 15 | ||||
-rw-r--r-- | shell/e-shell-folder-selection-dialog.c | 17 | ||||
-rw-r--r-- | shell/e-shell.c | 3 | ||||
-rw-r--r-- | shell/evolution-folder-selector-button.c | 37 |
4 files changed, 40 insertions, 32 deletions
diff --git a/shell/ChangeLog b/shell/ChangeLog index b3266618b9..17fe672815 100644 --- a/shell/ChangeLog +++ b/shell/ChangeLog @@ -1,5 +1,20 @@ 2003-04-07 Dan Winship <danw@ximian.com> + * evolution-folder-selector-button.c (clicked): Desensitize the + window's top-level container rather than desensitizing the window + itself, which causes strange problems [#40854]. Also fix up the + code that tries to watch for the parent window being destroyed. + + * e-shell.c (impl_Shell_selectUserFolder): Use + e_dialog_set_transient_for_xid. + + * e-shell-folder-selection-dialog.c (impl_response): Treat + GTK_RESPONSE_DELETE_EVENT the same as GTK_RESPONSE_CANCEL. + (e_shell_folder_selection_dialog_construct): No need to catch + "delete_event" signal. + +2003-04-07 Dan Winship <danw@ximian.com> + * Makefile.am ($(server_in_files)): Substitute version number into the evolution binary name in the server file (INCLUDES): define EVOLUTION_TOOLSDIR diff --git a/shell/e-shell-folder-selection-dialog.c b/shell/e-shell-folder-selection-dialog.c index 69b3f5cb0d..962d145ca3 100644 --- a/shell/e-shell-folder-selection-dialog.c +++ b/shell/e-shell-folder-selection-dialog.c @@ -240,6 +240,7 @@ impl_response (GtkDialog *dialog, break; case GTK_RESPONSE_CANCEL: + case GTK_RESPONSE_DELETE_EVENT: g_signal_emit (folder_selection_dialog, signals[CANCELLED], 0); gtk_widget_destroy (GTK_WIDGET (dialog)); break; @@ -267,9 +268,6 @@ impl_response (GtkDialog *dialog, g_free (default_type); break; - - default: /* WM close button */ - gtk_widget_destroy (GTK_WIDGET (dialog)); } } @@ -344,16 +342,6 @@ folder_selected_cb (EStorageSetView *storage_set_view, gtk_dialog_set_response_sensitive (GTK_DIALOG (dialog), GTK_RESPONSE_OK, FALSE); } -static gint -delete_event_cb (GtkWidget *w, GdkEvent *event, gpointer data) -{ - EShellFolderSelectionDialog *dialog = data; - - g_signal_emit (dialog, signals[CANCELLED], 0); - - return TRUE; -} - static void double_click_cb (EStorageSetView *essv, int row, @@ -411,9 +399,6 @@ e_shell_folder_selection_dialog_construct (EShellFolderSelectionDialog *folder_s gtk_window_set_modal (GTK_WINDOW (folder_selection_dialog), TRUE); gtk_window_set_title (GTK_WINDOW (folder_selection_dialog), title); - g_signal_connect (folder_selection_dialog, "delete_event", - G_CALLBACK (delete_event_cb), folder_selection_dialog); - if (allow_creation) gtk_dialog_add_buttons (GTK_DIALOG (folder_selection_dialog), GTK_STOCK_NEW, RESPONSE_NEW, diff --git a/shell/e-shell.c b/shell/e-shell.c index 826178413f..f8b1f2df89 100644 --- a/shell/e-shell.c +++ b/shell/e-shell.c @@ -550,6 +550,9 @@ impl_Shell_selectUserFolder (PortableServer_Servant servant, g_signal_connect (folder_selection_dialog, "cancelled", G_CALLBACK (folder_selection_dialog_cancelled_cb), shell); + if (parent_xid) + e_dialog_set_transient_for_xid (GTK_WINDOW (folder_selection_dialog), parent_xid); + #if NASTY_HACK_FOR_OUT_OF_PROC_COMPONENTS if (parent_xid == 0) { gtk_widget_show (folder_selection_dialog); diff --git a/shell/evolution-folder-selector-button.c b/shell/evolution-folder-selector-button.c index 0a01874c06..f3b9ab6179 100644 --- a/shell/evolution-folder-selector-button.c +++ b/shell/evolution-folder-selector-button.c @@ -142,15 +142,26 @@ clicked (GtkButton *button) EvolutionFolderSelectorButton *folder_selector_button; EvolutionFolderSelectorButtonPrivate *priv; GNOME_Evolution_Folder *return_folder; + GtkWidget *toplevel_container; GtkWindow *parent_window; char *initial_uri; - parent_window = (GtkWindow *) - gtk_widget_get_ancestor (GTK_WIDGET (button), - GTK_TYPE_WINDOW); + /* We want to disable the window the button is in, since the + * folder selection dialog may be in another process and the WM + * won't enforce modality cross-process. In Evo 1.2, this code + * called gtk_widget_set_sensitive on the button's parent + * window, but in GNOME 2 that seems to cause bad things to + * happen (the window doesn't resensitize properly at the end). + * So we desensitize the top-level container inside the window + * instead. + */ + toplevel_container = GTK_WIDGET (button); + while (toplevel_container->parent && + !GTK_IS_WINDOW (toplevel_container->parent)) + toplevel_container = toplevel_container->parent; + parent_window = (GtkWindow *)toplevel_container->parent; - gtk_widget_set_sensitive (GTK_WIDGET (parent_window), FALSE); - g_object_ref (parent_window); + gtk_widget_set_sensitive (GTK_WIDGET (toplevel_container), FALSE); folder_selector_button = EVOLUTION_FOLDER_SELECTOR_BUTTON (button); priv = folder_selector_button->priv; @@ -162,7 +173,7 @@ clicked (GtkButton *button) g_signal_emit (folder_selector_button, signals[POPPED_UP], 0); - g_object_add_weak_pointer (G_OBJECT (parent_window), (void **) &parent_window); + g_object_add_weak_pointer (G_OBJECT (button), (void **) &button); evolution_shell_client_user_select_folder (priv->shell_client, parent_window, @@ -171,18 +182,12 @@ clicked (GtkButton *button) (const char **)priv->possible_types, &return_folder); - g_object_remove_weak_pointer (G_OBJECT (parent_window), (void **) &parent_window); - - /* If the parent gets destroyed despite our best efforts (eg, - * because its own parent got destroyed), then the folder - * selector button will have been destroyed too and we need - * to just bail out here. - */ - if (parent_window == NULL) + /* Bail out if the parent window was destroyed */ + if (button == NULL) return; + g_object_remove_weak_pointer (G_OBJECT (button), (void **) &button); - gtk_widget_set_sensitive (GTK_WIDGET (parent_window), TRUE); - g_object_unref (parent_window); + gtk_widget_set_sensitive (GTK_WIDGET (toplevel_container), TRUE); if (!return_folder) { g_signal_emit (folder_selector_button, signals[CANCELED], 0); |