aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMilan Crha <mcrha@redhat.com>2012-06-26 22:54:11 +0800
committerMilan Crha <mcrha@redhat.com>2012-06-26 22:54:11 +0800
commit5f0c5122552e19a4989f5961151b52cd72daf047 (patch)
tree99c9d9d758ad8a516caf6c7ee630395eea9f610b
parent2992ba8de93a8d57c48fbf77549ddcab6d49bccd (diff)
downloadgsoc2013-evolution-5f0c5122552e19a4989f5961151b52cd72daf047.tar
gsoc2013-evolution-5f0c5122552e19a4989f5961151b52cd72daf047.tar.gz
gsoc2013-evolution-5f0c5122552e19a4989f5961151b52cd72daf047.tar.bz2
gsoc2013-evolution-5f0c5122552e19a4989f5961151b52cd72daf047.tar.lz
gsoc2013-evolution-5f0c5122552e19a4989f5961151b52cd72daf047.tar.xz
gsoc2013-evolution-5f0c5122552e19a4989f5961151b52cd72daf047.tar.zst
gsoc2013-evolution-5f0c5122552e19a4989f5961151b52cd72daf047.zip
Bug #677993 - Remember screen used in previous session
-rw-r--r--e-util/e-util.c14
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);
}
}