[Commits] [SCM] claws branch, master, updated. 3.13.2-153-gaafdc44
pawel at claws-mail.org
pawel at claws-mail.org
Thu Jun 9 21:11:53 CEST 2016
The branch, master has been updated
via aafdc441c2f5ad81fe5a65cb5a63a97977581c2c (commit)
from 3fa7a0c630a66c1c33eab441221b212d775e6027 (commit)
Summary of changes:
src/plugins/notification/notification_trayicon.c | 13 ++++++++++++-
1 file changed, 12 insertions(+), 1 deletion(-)
- Log -----------------------------------------------------------------
commit aafdc441c2f5ad81fe5a65cb5a63a97977581c2c
Author: Pawel Pekala <c0rn at o2.pl>
Date: Thu Jun 9 20:59:37 2016 +0200
Implement focused widget saving between iconify/deiconify events in
trayicon notification. Without this focus is lost on deiconify and this
can be painful to keyboard users. This is similar to my old work on
trayicon plugin I've done in the past.
diff --git a/src/plugins/notification/notification_trayicon.c b/src/plugins/notification/notification_trayicon.c
index 522e3ca..6802958 100644
--- a/src/plugins/notification/notification_trayicon.c
+++ b/src/plugins/notification/notification_trayicon.c
@@ -108,6 +108,7 @@ G_LOCK_DEFINE_STATIC(trayicon_popup);
static GtkStatusIcon *trayicon;
static gboolean updating_menu = FALSE;
static GtkWidget *traymenu_popup;
+static GtkWidget *focused_widget = NULL;
static GtkActionEntry trayicon_popup_menu_entries[] = {
{"SysTrayiconPopup", NULL, "SysTrayiconPopup" },
@@ -310,8 +311,10 @@ gboolean notification_trayicon_main_window_close(gpointer source, gpointer data)
MainWindow *mainwin = mainwindow_get_mainwindow();
*close_allowed = FALSE;
- if(mainwin && gtk_widget_get_visible(GTK_WIDGET(mainwin->window)))
+ if(mainwin && gtk_widget_get_visible(GTK_WIDGET(mainwin->window))) {
+ focused_widget = gtk_window_get_focus(GTK_WINDOW(mainwin->window));
main_window_hide(mainwin);
+ }
}
}
return FALSE;
@@ -417,7 +420,15 @@ static GdkPixbuf* notification_trayicon_create(void)
void notification_trayicon_on_activate(GtkStatusIcon *status_icon, gpointer user_data)
{
+ MainWindow *mainwin = mainwindow_get_mainwindow();
+
+ if(mainwin && gtk_widget_get_visible(GTK_WIDGET(mainwin->window)) == TRUE)
+ focused_widget = gtk_window_get_focus(GTK_WINDOW(mainwin->window));
+
notification_toggle_hide_show_window();
+
+ if(mainwin && gtk_widget_get_visible(GTK_WIDGET(mainwin->window)) == TRUE)
+ gtk_window_set_focus(GTK_WINDOW(mainwin->window), focused_widget);
}
static void notification_trayicon_on_popup_menu(GtkStatusIcon *status_icon,
-----------------------------------------------------------------------
hooks/post-receive
--
Claws Mail
More information about the Commits
mailing list