2010-02-03 [pawel] 3.7.5cvs6
authorPaweł Pękala <c0rn@gazeta.pl>
Wed, 3 Feb 2010 21:01:52 +0000 (21:01 +0000)
committerPaweł Pękala <c0rn@gazeta.pl>
Wed, 3 Feb 2010 21:01:52 +0000 (21:01 +0000)
* src/plugins/trayicon/trayicon.c
Save and then restore focus when closing/minimizing to tray

ChangeLog
PATCHSETS
configure.ac
src/plugins/trayicon/trayicon.c

index 2ef5b01..7202c02 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2010-02-03 [pawel]     3.7.5cvs6
+
+       * src/plugins/trayicon/trayicon.c
+               Save and then restore focus when closing/minimizing to tray
+
 2010-02-03 [mir]       3.7.5cvs5
 
        * src/addrindex.c
index eb5a5ed..1bea80c 100644 (file)
--- a/PATCHSETS
+++ b/PATCHSETS
 ( cvs diff -u -r 1.1.2.7 -r 1.1.2.8 src/plugins/smime/smime.c;  cvs diff -u -r 1.10.2.23 -r 1.10.2.24 src/privacy.c;  ) > 3.7.5cvs3.patchset
 ( cvs diff -u -r 1.10.2.24 -r 1.10.2.25 src/privacy.c;  ) > 3.7.5cvs4.patchset
 ( cvs diff -u -r 1.28.2.42 -r 1.28.2.43 src/addrindex.c;  cvs diff -u -r 1.8.2.36 -r 1.8.2.37 src/editldap.c;  cvs diff -u -r 1.2.2.19 -r 1.2.2.20 src/ldapctrl.c;  cvs diff -u -r 1.1.4.14 -r 1.1.4.15 src/ldapctrl.h;  cvs diff -u -r 1.3.2.33 -r 1.3.2.34 src/ldapquery.c;  cvs diff -u -r 1.1.2.23 -r 1.1.2.24 src/ldapupdate.c;  ) > 3.7.5cvs5.patchset
+( cvs diff -u -r 1.14.2.69 -r 1.14.2.70 src/plugins/trayicon/trayicon.c;  ) > 3.7.5cvs6.patchset
index 022d0ed..2ae3938 100644 (file)
@@ -12,7 +12,7 @@ MINOR_VERSION=7
 MICRO_VERSION=5
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=5
+EXTRA_VERSION=6
 EXTRA_RELEASE=
 EXTRA_GTK2_VERSION=
 
index 10e63b0..a81f9de 100644 (file)
@@ -68,6 +68,7 @@ static GdkPixbuf *nomail_pixmap[2] = {NULL, NULL};
 static EggTrayIcon *trayicon;
 static GtkWidget *eventbox;
 static GtkWidget *image = NULL;
+static GtkWidget *focused_widget = NULL;
 
 #if !(GTK_CHECK_VERSION(2,12,0))
 static GtkTooltips *tooltips;
@@ -242,12 +243,14 @@ static gboolean trayicon_close_hook(gpointer source, gpointer data)
                gboolean *close_allowed = (gboolean*)source;
 
                if (trayicon_prefs.close_to_tray) {
-               MainWindow *mainwin = mainwindow_get_mainwindow();
+                       MainWindow *mainwin = mainwindow_get_mainwindow();
 
                        *close_allowed = FALSE;
-               if (GTK_WIDGET_VISIBLE(GTK_WIDGET(mainwin->window)))
-                       main_window_hide(mainwin);
-       }
+                       focused_widget = gtk_window_get_focus(GTK_WINDOW(mainwin->window));
+                       
+                       if (GTK_WIDGET_VISIBLE(GTK_WIDGET(mainwin->window)))
+                               main_window_hide(mainwin);
+               }
        }
        return FALSE;
 }
@@ -259,6 +262,7 @@ static gboolean trayicon_got_iconified_hook(gpointer source, gpointer data)
        if (trayicon_prefs.hide_when_iconified
                        && GTK_WIDGET_VISIBLE(GTK_WIDGET(mainwin->window))
                        && !gtk_window_get_skip_taskbar_hint(GTK_WINDOW(mainwin->window))) {
+               focused_widget = gtk_window_get_focus(GTK_WINDOW(mainwin->window));
                gtk_window_set_skip_taskbar_hint(GTK_WINDOW(mainwin->window), TRUE);
        }
        return FALSE;
@@ -302,7 +306,9 @@ static gboolean click_cb(GtkWidget * widget,
                                gtk_window_set_skip_taskbar_hint(GTK_WINDOW(mainwin->window), FALSE);
                                main_window_show(mainwin);
                                gtk_window_present(GTK_WINDOW(mainwin->window));
+                               gtk_window_set_focus(GTK_WINDOW(mainwin->window), focused_widget);
                        } else {
+                               focused_widget = gtk_window_get_focus(GTK_WINDOW(mainwin->window));
                                main_window_hide(mainwin);
                        }
                } else {
@@ -311,6 +317,7 @@ static gboolean click_cb(GtkWidget * widget,
                        main_window_show(mainwin);
                        gtk_window_present(GTK_WINDOW(mainwin->window));
                        fix_folderview_scroll(mainwin);
+                       gtk_window_set_focus(GTK_WINDOW(mainwin->window), focused_widget);
         }
                break;
        case 3: