[evolution/gnome-3-4] Bug #677993 - Remember screen used in previous session
- From: Milan Crha <mcrha src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution/gnome-3-4] Bug #677993 - Remember screen used in previous session
- Date: Tue, 26 Jun 2012 14:55:40 +0000 (UTC)
commit bfcf55ab7de47fb2fb4219878c15a8104d7ea5a3
Author: Milan Crha <mcrha redhat com>
Date: Tue Jun 26 16:54:58 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 109ee1b..09f023c 100644
--- a/e-util/e-util.c
+++ b/e-util/e-util.c
@@ -353,6 +353,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);
@@ -360,10 +365,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]