From d036c8b0a5102a92671ee36384bd54b63c33256c Mon Sep 17 00:00:00 2001 From: =?utf8?q?Pawe=C5=82=20P=C4=99kala?= Date: Wed, 3 Feb 2010 21:01:52 +0000 Subject: [PATCH] 2010-02-03 [pawel] 3.7.5cvs6 * src/plugins/trayicon/trayicon.c Save and then restore focus when closing/minimizing to tray --- ChangeLog | 5 +++++ PATCHSETS | 1 + configure.ac | 2 +- src/plugins/trayicon/trayicon.c | 15 +++++++++++---- 4 files changed, 18 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index 2ef5b0157..7202c02f9 100644 --- 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 diff --git a/PATCHSETS b/PATCHSETS index eb5a5eded..1bea80c10 100644 --- a/PATCHSETS +++ b/PATCHSETS @@ -3946,3 +3946,4 @@ ( 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 diff --git a/configure.ac b/configure.ac index 022d0ed7f..2ae393893 100644 --- a/configure.ac +++ b/configure.ac @@ -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= diff --git a/src/plugins/trayicon/trayicon.c b/src/plugins/trayicon/trayicon.c index 10e63b061..a81f9de75 100644 --- a/src/plugins/trayicon/trayicon.c +++ b/src/plugins/trayicon/trayicon.c @@ -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: -- 2.25.1