From d99cd18fb9e97c4ec264ad7a72bf7e2ba9a6dfa2 Mon Sep 17 00:00:00 2001 From: Patrick Griffis Date: Thu, 31 Aug 2017 09:52:45 -0400 Subject: Improve detection of system tray support Closes #2045 --- src/fe-gtk/maingui.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src/fe-gtk/maingui.c') diff --git a/src/fe-gtk/maingui.c b/src/fe-gtk/maingui.c index 20edf1ba..145f4096 100644 --- a/src/fe-gtk/maingui.c +++ b/src/fe-gtk/maingui.c @@ -51,6 +51,7 @@ #include "plugin-tray.h" #include "xtext.h" #include "sexy-spell-entry.h" +#include "gtkutil.h" #define GUI_SPACING (3) #define GUI_BORDER (0) @@ -430,7 +431,7 @@ mg_windowstate_cb (GtkWindow *wid, GdkEventWindowState *event, gpointer userdata if ((event->changed_mask & GDK_WINDOW_STATE_ICONIFIED) && (event->new_window_state & GDK_WINDOW_STATE_ICONIFIED) && prefs.hex_gui_tray_minimize && prefs.hex_gui_tray && - !unity_mode ()) + gtkutil_tray_icon_supported (wid)) { tray_toggle_visibility (TRUE); gtk_window_deiconify (wid); @@ -1215,7 +1216,7 @@ mg_open_quit_dialog (gboolean minimize_button) gtk_button_box_set_layout (GTK_BUTTON_BOX (dialog_action_area1), GTK_BUTTONBOX_END); - if (minimize_button && !unity_mode ()) + if (minimize_button && gtkutil_tray_icon_supported (GTK_WINDOW(dialog))) { button = gtk_button_new_with_mnemonic (_("_Minimize to Tray")); gtk_widget_show (button); @@ -3176,8 +3177,9 @@ mg_tabwindow_de_cb (GtkWidget *widget, GdkEvent *event, gpointer user_data) { GSList *list; session *sess; + GtkWindow *win = GTK_WINDOW(gtk_widget_get_toplevel (widget)); - if (prefs.hex_gui_tray_close && !unity_mode () && tray_toggle_visibility (FALSE)) + if (prefs.hex_gui_tray_close && gtkutil_tray_icon_supported (win) && tray_toggle_visibility (FALSE)) return TRUE; /* check for remaining toplevel windows */ -- cgit 1.4.1