[evolution] Bug #677993 - Remember screen used in previous session
- From: Milan Crha <mcrha src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution] Bug #677993 - Remember screen used in previous session
- Date: Tue, 26 Jun 2012 14:54:53 +0000 (UTC)
commit 5f0c5122552e19a4989f5961151b52cd72daf047
Author: Milan Crha <mcrha redhat com>
Date: Tue Jun 26 16:54:11 2012 +0200
Bug #677993 - Remember screen used in previous session
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 f3b71c5..a579985 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);
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]