2012-11-18 [colin] 3.9.0cvs6-stable
authorColin Leroy <colin@colino.net>
Sun, 18 Nov 2012 16:40:41 +0000 (16:40 +0000)
committerColin Leroy <colin@colino.net>
Sun, 18 Nov 2012 16:40:41 +0000 (16:40 +0000)
* 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.

13 files changed:
ChangeLog
PATCHSETS
configure.ac
src/foldersel.c
src/gtk/description_window.c
src/gtk/description_window.h
src/gtk/inputdialog.c
src/gtk/manage_window.c
src/gtk/quicksearch.c
src/prefs_actions.c
src/prefs_filtering_action.c
src/prefs_matcher.c
src/quote_fmt.c

index 044ab94..53d60ec 100644 (file)
--- 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
index 3da15c9..7912455 100644 (file)
--- a/PATCHSETS
+++ b/PATCHSETS
 ( 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
index ab2edd4..7ed27b0 100644 (file)
@@ -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
 
index 018bd40..2ac11e1 100644 (file)
@@ -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)) {
index 71b6e51..9e7d66c 100644 (file)
@@ -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);
+       }
 }
index 0643334..7d43080 100644 (file)
@@ -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 **/
index 09b6046..1197189 100644 (file)
@@ -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
index 409a2ac..7a53f08 100644 (file)
 #include <gtk/gtk.h>
 
 #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;
index e6bd7af..527ea53 100644 (file)
@@ -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 "
index fa9a65f..f32cd4c 100644 (file)
@@ -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 "
index 597b9b9..86cc619 100644 (file)
@@ -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 "
index 5de48d5..0dbc252 100644 (file)
@@ -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 "
index 2b20b2b..d8c9450 100644 (file)
@@ -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:"),