Merge pull request #326 from TingPing/minimize
fix restoring previously maximized window from tray
This commit is contained in:
commit
3e85c2e820
|
@ -498,10 +498,6 @@ fe_set_title (session *sess)
|
||||||
static gboolean
|
static gboolean
|
||||||
mg_windowstate_cb (GtkWindow *wid, GdkEventWindowState *event, gpointer userdata)
|
mg_windowstate_cb (GtkWindow *wid, GdkEventWindowState *event, gpointer userdata)
|
||||||
{
|
{
|
||||||
prefs.hex_gui_win_state = 0;
|
|
||||||
if (event->new_window_state & GDK_WINDOW_STATE_MAXIMIZED)
|
|
||||||
prefs.hex_gui_win_state = 1;
|
|
||||||
|
|
||||||
if ((event->changed_mask & GDK_WINDOW_STATE_ICONIFIED) &&
|
if ((event->changed_mask & GDK_WINDOW_STATE_ICONIFIED) &&
|
||||||
(event->new_window_state & GDK_WINDOW_STATE_ICONIFIED) &&
|
(event->new_window_state & GDK_WINDOW_STATE_ICONIFIED) &&
|
||||||
prefs.hex_gui_tray_minimize && !hextray_mode ())
|
prefs.hex_gui_tray_minimize && !hextray_mode ())
|
||||||
|
@ -510,6 +506,10 @@ mg_windowstate_cb (GtkWindow *wid, GdkEventWindowState *event, gpointer userdata
|
||||||
gtk_window_deiconify (wid);
|
gtk_window_deiconify (wid);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
prefs.hex_gui_win_state = 0;
|
||||||
|
if (event->new_window_state & GDK_WINDOW_STATE_MAXIMIZED)
|
||||||
|
prefs.hex_gui_win_state = 1;
|
||||||
|
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -372,6 +372,7 @@ tray_toggle_visibility (gboolean force_hide)
|
||||||
{
|
{
|
||||||
static int x, y;
|
static int x, y;
|
||||||
static GdkScreen *screen;
|
static GdkScreen *screen;
|
||||||
|
static int maximized;
|
||||||
GtkWindow *win;
|
GtkWindow *win;
|
||||||
|
|
||||||
if (!sticon)
|
if (!sticon)
|
||||||
|
@ -396,12 +397,15 @@ tray_toggle_visibility (gboolean force_hide)
|
||||||
{
|
{
|
||||||
gtk_window_get_position (win, &x, &y);
|
gtk_window_get_position (win, &x, &y);
|
||||||
screen = gtk_window_get_screen (win);
|
screen = gtk_window_get_screen (win);
|
||||||
|
maximized = prefs.hex_gui_win_state;
|
||||||
gtk_widget_hide (GTK_WIDGET (win));
|
gtk_widget_hide (GTK_WIDGET (win));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
gtk_window_set_screen (win, screen);
|
gtk_window_set_screen (win, screen);
|
||||||
gtk_window_move (win, x, y);
|
gtk_window_move (win, x, y);
|
||||||
|
if (maximized)
|
||||||
|
gtk_window_maximize (win);
|
||||||
gtk_widget_show (GTK_WIDGET (win));
|
gtk_widget_show (GTK_WIDGET (win));
|
||||||
gtk_window_present (win);
|
gtk_window_present (win);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue