From: Colin Leroy Date: Sun, 18 Nov 2012 16:40:41 +0000 (+0000) Subject: 2012-11-18 [colin] 3.9.0cvs6-stable X-Git-Url: http://git.claws-mail.org/?p=claws.git;a=commitdiff_plain;h=688ad1c914986e3d897e7649df4eb16ed337fb6f;hp=813004cc5695f104f89f8ec9105f33d924b9b22e 2012-11-18 [colin] 3.9.0cvs6-stable * src/foldersel.c * src/prefs_actions.c * src/prefs_filtering_action.c * src/prefs_matcher.c * src/quote_fmt.c * src/gtk/description_window.c * src/gtk/description_window.h * src/gtk/inputdialog.c * src/gtk/manage_window.c * src/gtk/quicksearch.c Backport 3.9.0cvs10: Try to better fix focus problems. Should address: Bug #2774 Bug #2624 Bug #1963 Please check using your favorite WM that the following works: Information button (Quicksearch, Templates, 'Test' filtering condition) Folder selection (Move/Copy contextual menu, various preferences, including 'New folder'). Tested with XFCE, Gnome Shell and Windows. --- diff --git a/ChangeLog b/ChangeLog index 044ab94d8..53d60ec56 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,27 @@ +2012-11-18 [colin] 3.9.0cvs6-stable + + * src/foldersel.c + * src/prefs_actions.c + * src/prefs_filtering_action.c + * src/prefs_matcher.c + * src/quote_fmt.c + * src/gtk/description_window.c + * src/gtk/description_window.h + * src/gtk/inputdialog.c + * src/gtk/manage_window.c + * src/gtk/quicksearch.c + Backport 3.9.0cvs10: + Try to better fix focus problems. Should address: + Bug #2774 + Bug #2624 + Bug #1963 + Please check using your favorite WM that the following works: + Information button (Quicksearch, Templates, 'Test' filtering + condition) + Folder selection (Move/Copy contextual menu, + various preferences, including 'New folder'). + Tested with XFCE, Gnome Shell and Windows. + 2012-11-18 [colin] 3.9.0cvs5-stable * src/advsearch.c diff --git a/PATCHSETS b/PATCHSETS index 3da15c988..79124557d 100644 --- a/PATCHSETS +++ b/PATCHSETS @@ -4503,3 +4503,4 @@ ( cvs diff -u -r 1.395.2.456 -r 1.395.2.457 src/summaryview.c; ) > 3.9.0cvs3-stable.patchset ( cvs diff -u -r 1.58.2.51 -r 1.58.2.52 po/de.po; ) > 3.9.0cvs4-stable.patchset ( cvs diff -u -r 1.1.2.7 -r 1.1.2.8 src/advsearch.c; ) > 3.9.0cvs5-stable.patchset +( cvs diff -u -r 1.26.2.49 -r 1.26.2.50 src/foldersel.c; cvs diff -u -r 1.60.2.83 -r 1.60.2.84 src/prefs_actions.c; cvs diff -u -r 1.1.4.79 -r 1.1.4.80 src/prefs_filtering_action.c; cvs diff -u -r 1.43.2.96 -r 1.43.2.97 src/prefs_matcher.c; cvs diff -u -r 1.8.2.47 -r 1.8.2.48 src/quote_fmt.c; cvs diff -u -r 1.5.2.36 -r 1.5.2.37 src/gtk/description_window.c; cvs diff -u -r 1.1.4.10 -r 1.1.4.11 src/gtk/description_window.h; cvs diff -u -r 1.2.2.48 -r 1.2.2.49 src/gtk/inputdialog.c; cvs diff -u -r 1.1.4.11 -r 1.1.4.12 src/gtk/manage_window.c; cvs diff -u -r 1.1.2.119 -r 1.1.2.120 src/gtk/quicksearch.c; ) > 3.9.0cvs6-stable.patchset diff --git a/configure.ac b/configure.ac index ab2edd48a..7ed27b070 100644 --- a/configure.ac +++ b/configure.ac @@ -12,7 +12,7 @@ MINOR_VERSION=9 MICRO_VERSION=0 INTERFACE_AGE=0 BINARY_AGE=0 -EXTRA_VERSION=5 +EXTRA_VERSION=6 EXTRA_RELEASE= EXTRA_GTK2_VERSION=-stable diff --git a/src/foldersel.c b/src/foldersel.c index 018bd4006..2ac11e1c5 100644 --- a/src/foldersel.c +++ b/src/foldersel.c @@ -178,7 +178,7 @@ FolderItem *foldersel_folder_sel(Folder *cur_folder, FolderSelectionType type, gtk_widget_grab_focus(ok_button); gtk_widget_grab_focus(treeview); - gtk_widget_show(window); + gtk_window_present(window); gtk_window_set_modal(GTK_WINDOW(window), TRUE); manage_window_set_transient(GTK_WINDOW(window)); @@ -187,10 +187,8 @@ FolderItem *foldersel_folder_sel(Folder *cur_folder, FolderSelectionType type, while (finished == FALSE) gtk_main_iteration(); - gtk_widget_hide(window); - gtk_window_set_modal(GTK_WINDOW(window), FALSE); - gtk_entry_set_text(GTK_ENTRY(entry), ""); - gtk_tree_store_clear(tree_store); + gtk_widget_destroy(window); + window = NULL; if (!cancelled && selected_item && (selected_item->path || root_selectable)) { diff --git a/src/gtk/description_window.c b/src/gtk/description_window.c index 71b6e51db..9e7d66cf5 100644 --- a/src/gtk/description_window.c +++ b/src/gtk/description_window.c @@ -52,7 +52,12 @@ void description_window_create(DescriptionWindow *dwindow) description_create(dwindow); gtk_window_set_transient_for(GTK_WINDOW(dwindow->window), GTK_WINDOW(dwindow->parent)); + dwindow->parent_modal = gtk_window_get_modal(GTK_WINDOW(dwindow->parent)); +#ifndef G_OS_WIN32 gtk_window_set_modal(GTK_WINDOW(dwindow->parent), TRUE); +#else + gtk_window_set_modal(GTK_WINDOW(dwindow->window), TRUE); +#endif gtk_window_set_destroy_with_parent(GTK_WINDOW(dwindow->window), TRUE); gtk_widget_show(dwindow->window); @@ -228,7 +233,10 @@ static void description_window_destroy (GtkWidget *widget, gpointer data) dwindow->window = NULL; } - if(dwindow->parent) + if(dwindow->parent) { + if (GTK_IS_WINDOW(dwindow->parent)) + gtk_window_set_modal(GTK_WINDOW(dwindow->parent), dwindow->parent_modal); g_signal_handlers_disconnect_by_func(G_OBJECT(dwindow->parent), description_window_destroy, dwindow->parent); + } } diff --git a/src/gtk/description_window.h b/src/gtk/description_window.h index 064333437..7d43080b4 100644 --- a/src/gtk/description_window.h +++ b/src/gtk/description_window.h @@ -26,6 +26,7 @@ struct _DescriptionWindow { GtkWidget * window; GtkWidget * parent; + gboolean parent_modal; /** Number of columns for each line of data **/ int columns; /** title of the window **/ diff --git a/src/gtk/inputdialog.c b/src/gtk/inputdialog.c index 09b6046ff..119718959 100644 --- a/src/gtk/inputdialog.c +++ b/src/gtk/inputdialog.c @@ -430,7 +430,7 @@ static gchar *input_dialog_open(const gchar *title, const gchar *message, gtk_button_set_label(GTK_BUTTON(remember_checkbtn), _("Remember this")); input_dialog_set(title, message, default_string); - gtk_widget_show(dialog); + gtk_window_present(GTK_WINDOW(dialog)); gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(remember_checkbtn), default_checkbtn_state); @@ -448,7 +448,6 @@ static gchar *input_dialog_open(const gchar *title, const gchar *message, gtk_main_iteration(); manage_window_focus_out(dialog, NULL, NULL); - gtk_widget_hide(dialog); if (ack) { GtkEditable *editable; @@ -471,6 +470,10 @@ static gchar *input_dialog_open(const gchar *title, const gchar *message, if (remember) { *remember = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(remember_checkbtn)); } + + gtk_widget_destroy(dialog); + dialog = NULL; + if (is_pass) debug_print("return string = %s\n", str ? "********": ("none")); else diff --git a/src/gtk/manage_window.c b/src/gtk/manage_window.c index 409a2ac86..7a53f0872 100644 --- a/src/gtk/manage_window.c +++ b/src/gtk/manage_window.c @@ -21,14 +21,21 @@ #include #include "manage_window.h" -/* #include "utils.h" */ +#include "utils.h" GtkWidget *focus_window; gint manage_window_focus_in(GtkWidget *widget, GdkEventFocus *event, gpointer data) { - /* debug_print("Focus in event: window: %p\n", widget); */ + const gchar *title = NULL; + + if (!GTK_IS_WINDOW(widget)) + return FALSE; + + title = gtk_window_get_title(GTK_WINDOW(widget)); + debug_print("Focus in event: window: %p - %s\n", widget, + title ? title : "no title"); focus_window = widget; @@ -38,8 +45,14 @@ gint manage_window_focus_in(GtkWidget *widget, GdkEventFocus *event, gint manage_window_focus_out(GtkWidget *widget, GdkEventFocus *event, gpointer data) { - /* debug_print("Focused window: %p\n", focus_window); */ - /* debug_print("Focus out event: window: %p\n", widget); */ + const gchar *title = NULL; + + if (!GTK_IS_WINDOW(widget)) + return FALSE; + + title = gtk_window_get_title(GTK_WINDOW(widget)); + debug_print("Focus out event: window: %p - %s\n", widget, + title ? title : "no title"); if (focus_window == widget) focus_window = NULL; @@ -49,7 +62,9 @@ gint manage_window_focus_out(GtkWidget *widget, GdkEventFocus *event, gint manage_window_unmap(GtkWidget *widget, GdkEventAny *event, gpointer data) { - /* debug_print("unmap event: %p\n", widget); */ + const gchar *title = gtk_window_get_title(GTK_WINDOW(widget)); + debug_print("Unmap event: window: %p - %s\n", widget, + title ? title : "no title"); if (focus_window == widget) focus_window = NULL; @@ -59,7 +74,10 @@ gint manage_window_unmap(GtkWidget *widget, GdkEventAny *event, gpointer data) void manage_window_destroy(GtkWidget *widget, gpointer data) { - /* debug_print("destroy event: %p\n", widget); */ + const gchar *title = gtk_window_get_title(GTK_WINDOW(widget)); + debug_print("Destroy event: window: %p - %s\n", widget, + title ? title : "no title"); + if (focus_window == widget) focus_window = NULL; diff --git a/src/gtk/quicksearch.c b/src/gtk/quicksearch.c index e6bd7af54..527ea53e2 100644 --- a/src/gtk/quicksearch.c +++ b/src/gtk/quicksearch.c @@ -483,6 +483,7 @@ static gchar *search_descr_strings[] = { static DescriptionWindow search_descr = { NULL, NULL, + FALSE, 2, N_("Extended Search"), N_("Extended Search allows the user to define criteria that messages must " diff --git a/src/prefs_actions.c b/src/prefs_actions.c index fa9a65f93..f32cd4c11 100644 --- a/src/prefs_actions.c +++ b/src/prefs_actions.c @@ -995,6 +995,7 @@ static gchar *actions_desc_strings[] = { static DescriptionWindow actions_desc_win = { NULL, NULL, + TRUE, 2, N_("Actions"), N_("The Actions feature is a way for the user to launch " diff --git a/src/prefs_filtering_action.c b/src/prefs_filtering_action.c index 597b9b94c..86cc619df 100644 --- a/src/prefs_filtering_action.c +++ b/src/prefs_filtering_action.c @@ -1247,7 +1247,8 @@ static gchar *exec_desc_strings[] = { static DescriptionWindow exec_desc_win = { NULL, - NULL, + NULL, + TRUE, 2, N_("Filtering Action: 'Execute'"), N_("'Execute' allows you to send a message or message element " diff --git a/src/prefs_matcher.c b/src/prefs_matcher.c index 5de48d5f1..0dbc25257 100644 --- a/src/prefs_matcher.c +++ b/src/prefs_matcher.c @@ -2131,6 +2131,7 @@ static gchar *test_desc_strings[] = { static DescriptionWindow test_desc_win = { NULL, NULL, + TRUE, 2, N_("Match Type: 'Test'"), N_("'Test' allows you to test a message or message element " diff --git a/src/quote_fmt.c b/src/quote_fmt.c index 2b20b2b71..d8c9450ed 100644 --- a/src/quote_fmt.c +++ b/src/quote_fmt.c @@ -104,6 +104,7 @@ static gchar *quote_desc_strings[] = { static DescriptionWindow quote_desc_win = { NULL, NULL, + TRUE, 2, N_("Description of symbols"), N_("The following symbols and commands can be used:"),