2006-12-01 [wwp] 2.6.0cvs76
authorTristan Chabredier <wwp@claws-mail.org>
Fri, 1 Dec 2006 14:03:55 +0000 (14:03 +0000)
committerTristan Chabredier <wwp@claws-mail.org>
Fri, 1 Dec 2006 14:03:55 +0000 (14:03 +0000)
* src/message_search.c
* src/summary_search.c
fix more focus issues (don't set focus to combobox's entry widget when
entry's value changed, if entry widget has focus already).

ChangeLog
PATCHSETS
configure.ac
src/message_search.c
src/summary_search.c

index a6e55d8..85a04ed 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2006-12-01 [wwp]       2.6.0cvs76
+
+       * src/message_search.c
+       * src/summary_search.c
+               fix more focus issues (don't set focus to combobox's entry widget when
+               entry's value changed, if entry widget has focus already).
+
 2006-12-01 [wwp]       2.6.0cvs75
 
        * src/gtk/quicksearch.c
index e32397f..3f8cf8d 100644 (file)
--- a/PATCHSETS
+++ b/PATCHSETS
 ( cvs diff -u -r 1.1.2.53 -r 1.1.2.54 src/gtk/quicksearch.c;  ) > 2.6.0cvs73.patchset
 ( cvs diff -u -r 1.2.2.8 -r 1.2.2.9 tools/kdeservicemenu/README;  cvs diff -u -r 1.1.2.2 -r 1.1.2.3 tools/kdeservicemenu/claws-mail-kdeservicemenu.pl;  cvs diff -u -r 1.2.2.4 -r 1.2.2.5 tools/kdeservicemenu/install.sh;  cvs diff -u -r 1.1.2.1 -r 1.1.2.2 tools/kdeservicemenu/template_claws-mail-attach-files.desktop;  cvs diff -u -r -1.1.2.1 -r -1.1.2.2 tools/kdeservicemenu/template_claws-mail-compress-attach.desktop;  ) > 2.6.0cvs74.patchset
 ( cvs diff -u -r 1.1.2.54 -r 1.1.2.55 src/gtk/quicksearch.c;  ) > 2.6.0cvs75.patchset
+( cvs diff -u -r 1.3.12.19 -r 1.3.12.20 src/message_search.c;  cvs diff -u -r 1.15.2.37 -r 1.15.2.38 src/summary_search.c;  ) > 2.6.0cvs76.patchset
index 09f9f56..449ca3e 100644 (file)
@@ -11,7 +11,7 @@ MINOR_VERSION=6
 MICRO_VERSION=0
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=75
+EXTRA_VERSION=76
 EXTRA_RELEASE=
 EXTRA_GTK2_VERSION=
 
index 18f44c4..7cf63bf 100644 (file)
@@ -68,6 +68,7 @@ static struct MessageSearchWindow {
        Compose *compose;
        gboolean search_compose;
        gboolean is_searching;
+       gboolean body_entry_has_focus;
 } search_window;
 
 static void message_search_create      (void);
@@ -80,6 +81,10 @@ static void message_search_next_clicked      (GtkButton      *button,
 static void message_search_stop_clicked        (GtkButton      *button,
                                         gpointer        data);
 static void body_changed               (void);
+static gboolean body_entry_focus_evt_in(GtkWidget *widget, GdkEventFocus *event,
+                                 gpointer data);
+static gboolean body_entry_focus_evt_out(GtkWidget *widget, GdkEventFocus *event,
+                                 gpointer data);
 static gboolean key_pressed            (GtkWidget      *widget,
                                         GdkEventKey    *event,
                                         gpointer        data);
@@ -192,6 +197,10 @@ static void message_search_create(void)
        gtk_box_pack_start (GTK_BOX (hbox1), body_entry, TRUE, TRUE, 0);
        g_signal_connect(G_OBJECT(body_entry), "changed",
                         G_CALLBACK(body_changed), NULL);
+       g_signal_connect(G_OBJECT(GTK_BIN(body_entry)->child),
+                        "focus_in_event", G_CALLBACK(body_entry_focus_evt_in), NULL);
+       g_signal_connect(G_OBJECT(GTK_BIN(body_entry)->child),
+                        "focus_out_event", G_CALLBACK(body_entry_focus_evt_out), NULL);
 
        checkbtn_hbox = gtk_hbox_new (FALSE, 8);
        gtk_widget_show (checkbtn_hbox);
@@ -349,7 +358,22 @@ static void message_search_execute(gboolean backward)
 
 static void body_changed(void)
 {
-       gtk_widget_grab_focus(search_window.body_entry);
+       if (!search_window.body_entry_has_focus)
+               gtk_widget_grab_focus(search_window.body_entry);
+}
+
+static gboolean body_entry_focus_evt_in(GtkWidget *widget, GdkEventFocus *event,
+                                 gpointer data)
+{
+       search_window.body_entry_has_focus = TRUE;
+       return FALSE;
+}
+
+static gboolean body_entry_focus_evt_out(GtkWidget *widget, GdkEventFocus *event,
+                                 gpointer data)
+{
+       search_window.body_entry_has_focus = FALSE;
+       return FALSE;
 }
 
 static void message_search_prev_clicked(GtkButton *button, gpointer data)
index c95c3ce..cf2c443 100644 (file)
@@ -89,6 +89,11 @@ static struct SummarySearchWindow {
        MatcherList                     *matcher_list;
 
        gboolean is_searching;
+       gboolean from_entry_has_focus;
+       gboolean to_entry_has_focus;
+       gboolean subject_entry_has_focus;
+       gboolean body_entry_has_focus;
+       gboolean adv_condition_entry_has_focus;
 } search_window;
 
 static void summary_search_create      (void);
@@ -115,6 +120,27 @@ static void subject_changed                        (void);
 static void body_changed                       (void);
 static void adv_condition_changed      (void);
 
+static gboolean from_entry_focus_evt_in(GtkWidget *widget, GdkEventFocus *event,
+                                 gpointer data);
+static gboolean from_entry_focus_evt_out(GtkWidget *widget, GdkEventFocus *event,
+                                 gpointer data);
+static gboolean to_entry_focus_evt_in(GtkWidget *widget, GdkEventFocus *event,
+                                 gpointer data);
+static gboolean to_entry_focus_evt_out(GtkWidget *widget, GdkEventFocus *event,
+                                 gpointer data);
+static gboolean subject_entry_focus_evt_in(GtkWidget *widget, GdkEventFocus *event,
+                                 gpointer data);
+static gboolean subject_entry_focus_evt_out(GtkWidget *widget, GdkEventFocus *event,
+                                 gpointer data);
+static gboolean body_entry_focus_evt_in(GtkWidget *widget, GdkEventFocus *event,
+                                 gpointer data);
+static gboolean body_entry_focus_evt_out(GtkWidget *widget, GdkEventFocus *event,
+                                 gpointer data);
+static gboolean adv_condition_entry_focus_evt_in(GtkWidget *widget, GdkEventFocus *event,
+                                 gpointer data);
+static gboolean adv_condition_entry_focus_evt_out(GtkWidget *widget, GdkEventFocus *event,
+                                 gpointer data);
+
 static gboolean key_pressed            (GtkWidget      *widget,
                                         GdkEventKey    *event,
                                         gpointer        data);
@@ -248,6 +274,10 @@ static void summary_search_create(void)
                          GTK_EXPAND|GTK_FILL, 0, 0, 0);
        g_signal_connect(G_OBJECT(from_entry), "changed",
                         G_CALLBACK(from_changed), NULL);
+       g_signal_connect(G_OBJECT(GTK_BIN(from_entry)->child),
+                        "focus_in_event", G_CALLBACK(from_entry_focus_evt_in), NULL);
+       g_signal_connect(G_OBJECT(GTK_BIN(from_entry)->child),
+                        "focus_out_event", G_CALLBACK(from_entry_focus_evt_out), NULL);
 
        to_entry = gtk_combo_box_entry_new_text ();
        gtk_combo_box_set_active(GTK_COMBO_BOX(to_entry), -1);
@@ -259,6 +289,10 @@ static void summary_search_create(void)
                          GTK_EXPAND|GTK_FILL, 0, 0, 0);
        g_signal_connect(G_OBJECT(from_entry), "changed",
                         G_CALLBACK(from_changed), NULL);
+       g_signal_connect(G_OBJECT(GTK_BIN(to_entry)->child),
+                        "focus_in_event", G_CALLBACK(to_entry_focus_evt_in), NULL);
+       g_signal_connect(G_OBJECT(GTK_BIN(to_entry)->child),
+                        "focus_out_event", G_CALLBACK(to_entry_focus_evt_out), NULL);
 
        subject_entry = gtk_combo_box_entry_new_text ();
        gtk_combo_box_set_active(GTK_COMBO_BOX(subject_entry), -1);
@@ -270,6 +304,10 @@ static void summary_search_create(void)
                          GTK_EXPAND|GTK_FILL, 0, 0, 0);
        g_signal_connect(G_OBJECT(from_entry), "changed",
                         G_CALLBACK(from_changed), NULL);
+       g_signal_connect(G_OBJECT(GTK_BIN(subject_entry)->child),
+                        "focus_in_event", G_CALLBACK(subject_entry_focus_evt_in), NULL);
+       g_signal_connect(G_OBJECT(GTK_BIN(subject_entry)->child),
+                        "focus_out_event", G_CALLBACK(subject_entry_focus_evt_out), NULL);
 
        body_entry = gtk_combo_box_entry_new_text ();
        gtk_combo_box_set_active(GTK_COMBO_BOX(body_entry), -1);
@@ -281,6 +319,10 @@ static void summary_search_create(void)
                          GTK_EXPAND|GTK_FILL, 0, 0, 0);
        g_signal_connect(G_OBJECT(from_entry), "changed",
                         G_CALLBACK(from_changed), NULL);
+       g_signal_connect(G_OBJECT(GTK_BIN(body_entry)->child),
+                        "focus_in_event", G_CALLBACK(body_entry_focus_evt_in), NULL);
+       g_signal_connect(G_OBJECT(GTK_BIN(body_entry)->child),
+                        "focus_out_event", G_CALLBACK(body_entry_focus_evt_out), NULL);
 
        adv_condition_entry = gtk_combo_box_entry_new_text ();
        gtk_combo_box_set_active(GTK_COMBO_BOX(adv_condition_entry), -1);
@@ -292,6 +334,10 @@ static void summary_search_create(void)
                          GTK_EXPAND|GTK_FILL, 0, 0, 0);
        g_signal_connect(G_OBJECT(from_entry), "changed",
                         G_CALLBACK(from_changed), NULL);
+       g_signal_connect(G_OBJECT(GTK_BIN(adv_condition_entry)->child),
+                        "focus_in_event", G_CALLBACK(adv_condition_entry_focus_evt_in), NULL);
+       g_signal_connect(G_OBJECT(GTK_BIN(adv_condition_entry)->child),
+                        "focus_out_event", G_CALLBACK(adv_condition_entry_focus_evt_out), NULL);
 
        adv_condition_btn = gtk_button_new_with_label(" ... ");
        gtk_widget_show (adv_condition_btn);
@@ -801,27 +847,102 @@ static void adv_condition_btn_clicked(GtkButton *button, gpointer data)
 
 static void from_changed(void)
 {
-       gtk_widget_grab_focus(search_window.from_entry);
+       if (!search_window.from_entry_has_focus)
+               gtk_widget_grab_focus(search_window.from_entry);
 }
 
 static void to_changed(void)
 {
-       gtk_widget_grab_focus(search_window.to_entry);
+       if (!search_window.to_entry_has_focus)
+               gtk_widget_grab_focus(search_window.to_entry);
 }
 
 static void subject_changed(void)
 {
-       gtk_widget_grab_focus(search_window.subject_entry);
+       if (!search_window.subject_entry_has_focus)
+               gtk_widget_grab_focus(search_window.subject_entry);
 }
 
 static void body_changed(void)
 {
-       gtk_widget_grab_focus(search_window.body_entry);
+       if (!search_window.body_entry_has_focus)
+               gtk_widget_grab_focus(search_window.body_entry);
 }
 
 static void adv_condition_changed(void)
 {
-       gtk_widget_grab_focus(search_window.adv_condition_entry);
+       if (!search_window.adv_condition_entry_has_focus)
+               gtk_widget_grab_focus(search_window.adv_condition_entry);
+}
+
+static gboolean from_entry_focus_evt_in(GtkWidget *widget, GdkEventFocus *event,
+                                 gpointer data)
+{
+       search_window.from_entry_has_focus = TRUE;
+       return FALSE;
+}
+
+static gboolean from_entry_focus_evt_out(GtkWidget *widget, GdkEventFocus *event,
+                                 gpointer data)
+{
+       search_window.from_entry_has_focus = FALSE;
+       return FALSE;
+}
+
+static gboolean to_entry_focus_evt_in(GtkWidget *widget, GdkEventFocus *event,
+                                 gpointer data)
+{
+       search_window.to_entry_has_focus = TRUE;
+       return FALSE;
+}
+
+static gboolean to_entry_focus_evt_out(GtkWidget *widget, GdkEventFocus *event,
+                                 gpointer data)
+{
+       search_window.to_entry_has_focus = FALSE;
+       return FALSE;
+}
+
+static gboolean subject_entry_focus_evt_in(GtkWidget *widget, GdkEventFocus *event,
+                                 gpointer data)
+{
+       search_window.subject_entry_has_focus = TRUE;
+       return FALSE;
+}
+
+static gboolean subject_entry_focus_evt_out(GtkWidget *widget, GdkEventFocus *event,
+                                 gpointer data)
+{
+       search_window.subject_entry_has_focus = FALSE;
+       return FALSE;
+}
+
+static gboolean body_entry_focus_evt_in(GtkWidget *widget, GdkEventFocus *event,
+                                 gpointer data)
+{
+       search_window.body_entry_has_focus = TRUE;
+       return FALSE;
+}
+
+static gboolean body_entry_focus_evt_out(GtkWidget *widget, GdkEventFocus *event,
+                                 gpointer data)
+{
+       search_window.body_entry_has_focus = FALSE;
+       return FALSE;
+}
+
+static gboolean adv_condition_entry_focus_evt_in(GtkWidget *widget, GdkEventFocus *event,
+                                 gpointer data)
+{
+       search_window.adv_condition_entry_has_focus = TRUE;
+       return FALSE;
+}
+
+static gboolean adv_condition_entry_focus_evt_out(GtkWidget *widget, GdkEventFocus *event,
+                                 gpointer data)
+{
+       search_window.adv_condition_entry_has_focus = FALSE;
+       return FALSE;
 }
 
 static gboolean key_pressed(GtkWidget *widget, GdkEventKey *event,