diff options
Diffstat (limited to 'e-util')
-rw-r--r-- | e-util/e-util.c | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/e-util/e-util.c b/e-util/e-util.c index f3b71c58f6..a57998576a 100644 --- a/e-util/e-util.c +++ b/e-util/e-util.c @@ -351,6 +351,11 @@ e_restore_window (GtkWindow *window, if (g_settings_get_boolean (settings, "maximized")) { GdkScreen *screen; + GdkRectangle monitor_area; + gint x, y, monitor; + + x = g_settings_get_int (settings, "x"); + y = g_settings_get_int (settings, "y"); screen = gtk_window_get_screen (window); gtk_window_get_size (window, &width, &height); @@ -358,10 +363,13 @@ e_restore_window (GtkWindow *window, data->premax_width = width; data->premax_height = height; - width = gdk_screen_get_width (screen); - height = gdk_screen_get_height (screen); + monitor = gdk_screen_get_monitor_at_point (screen, x, y); + if (monitor < 0 || monitor >= gdk_screen_get_n_monitors (screen)) + monitor = 0; - gtk_window_resize (window, width, height); + gdk_screen_get_monitor_workarea (screen, monitor, &monitor_area); + + gtk_window_resize (window, monitor_area.width, monitor_area.height); gtk_window_maximize (window); } } |