aboutsummaryrefslogtreecommitdiffstats
path: root/e-util/gconf-bridge.c
diff options
context:
space:
mode:
authorMilan Crha <mcrha@redhat.com>2011-06-06 18:15:15 +0800
committerMilan Crha <mcrha@redhat.com>2011-06-06 18:15:15 +0800
commit72b7cfacfaad04f2e389681e5e5ebaf40259cbf6 (patch)
tree0687c96ace3bddf07244a6b839a11d10cd027054 /e-util/gconf-bridge.c
parentd10061af309cdba3890e51e267a915dfb2c55472 (diff)
downloadgsoc2013-evolution-72b7cfacfaad04f2e389681e5e5ebaf40259cbf6.tar.gz
gsoc2013-evolution-72b7cfacfaad04f2e389681e5e5ebaf40259cbf6.tar.zst
gsoc2013-evolution-72b7cfacfaad04f2e389681e5e5ebaf40259cbf6.zip
Bug #608203 - Left pane of mailer window is narrow at startup
Diffstat (limited to 'e-util/gconf-bridge.c')
-rw-r--r--e-util/gconf-bridge.c35
1 files changed, 35 insertions, 0 deletions
diff --git a/e-util/gconf-bridge.c b/e-util/gconf-bridge.c
index 9741f6c280..e1fc3770a8 100644
--- a/e-util/gconf-bridge.c
+++ b/e-util/gconf-bridge.c
@@ -727,6 +727,25 @@ window_binding_state_event_cb (GtkWindow *window,
if (binding->sync_timeout_id > 0)
g_source_remove (binding->sync_timeout_id);
+ if (event
+ && (event->changed_mask & GDK_WINDOW_STATE_MAXIMIZED) != 0
+ && (event->new_window_state & GDK_WINDOW_STATE_MAXIMIZED) == 0) {
+ /* the window was restored from a maximized state; make sure its
+ width and height is the one user stored before maximization */
+ gint width, height;
+
+ width = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (window), "binding-premax-width"));
+ height = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (window), "binding-premax-height"));
+
+ if (width && height) {
+ gtk_window_resize (window, width, height);
+
+ /* do this only once, as it is restore after loading maximized state */
+ g_object_set_data (G_OBJECT (window), "binding-premax-width", NULL);
+ g_object_set_data (G_OBJECT (window), "binding-premax-height", NULL);
+ }
+ }
+
window_binding_perform_scheduled_sync (binding);
return FALSE;
@@ -842,6 +861,22 @@ gconf_bridge_bind_window (GConfBridge *bridge,
if (maximized_val) {
if (gconf_value_get_bool (maximized_val)) {
+ /* maximize is not done immediately, but to count with proper
+ window size, resize it before. The previous size is restored
+ after the maximization is changed, in window_binding_state_event_cb()
+ */
+ gint width = 0, height = 0;
+ GdkScreen *screen;
+
+ gtk_window_get_size (window, &width, &height);
+ g_object_set_data (G_OBJECT (window), "binding-premax-width", GINT_TO_POINTER (width));
+ g_object_set_data (G_OBJECT (window), "binding-premax-height", GINT_TO_POINTER (height));
+
+ screen = gtk_window_get_screen (window);
+ gtk_window_resize (window,
+ gdk_screen_get_width (screen),
+ gdk_screen_get_height (screen));
+
gtk_window_maximize (window);
}
gconf_value_free (maximized_val);