aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMilan Crha <mcrha@redhat.com>2010-04-14 18:40:59 +0800
committerMilan Crha <mcrha@redhat.com>2010-04-14 18:40:59 +0800
commitef31f5027f8ca03b6cc611aa75cc6437b7fec4b4 (patch)
tree68178547830491b43b95ff1d1172fcac25068083
parent4502a5afc2447e4a500b593a825ea13ba2afb2f2 (diff)
downloadgsoc2013-evolution-ef31f5027f8ca03b6cc611aa75cc6437b7fec4b4.tar
gsoc2013-evolution-ef31f5027f8ca03b6cc611aa75cc6437b7fec4b4.tar.gz
gsoc2013-evolution-ef31f5027f8ca03b6cc611aa75cc6437b7fec4b4.tar.bz2
gsoc2013-evolution-ef31f5027f8ca03b6cc611aa75cc6437b7fec4b4.tar.lz
gsoc2013-evolution-ef31f5027f8ca03b6cc611aa75cc6437b7fec4b4.tar.xz
gsoc2013-evolution-ef31f5027f8ca03b6cc611aa75cc6437b7fec4b4.tar.zst
gsoc2013-evolution-ef31f5027f8ca03b6cc611aa75cc6437b7fec4b4.zip
Bug #608203 - Left pane of mailer window is really narrow at startup
-rw-r--r--e-util/gconf-bridge.c36
-rw-r--r--shell/e-shell-window-private.c34
2 files changed, 49 insertions, 21 deletions
diff --git a/e-util/gconf-bridge.c b/e-util/gconf-bridge.c
index d0f884d8fa..d67a238080 100644
--- a/e-util/gconf-bridge.c
+++ b/e-util/gconf-bridge.c
@@ -53,6 +53,8 @@ typedef struct {
that have not received change notification
yet. */
+ GConfValue *use_first_value; /* Not NULL when the object is a Widget and wasn't realized */
+
GObject *object;
GParamSpec *prop;
gulong prop_notify_id;
@@ -263,6 +265,9 @@ prop_binding_sync_prop_to_pref (PropBinding *binding)
binding->prop->name,
&value);
+ if (binding->use_first_value) {
+ gconf_value = binding->use_first_value;
+ } else
switch (value.g_type) {
case G_TYPE_STRING:
gconf_value = gconf_value_new (GCONF_VALUE_STRING);
@@ -356,10 +361,17 @@ prop_binding_sync_prop_to_pref (PropBinding *binding)
/* Set to GConf */
gconf_client_set (bridge->client, binding->key, gconf_value, NULL);
- /* Store until change notification comes in, so that we are able
- * to ignore it */
- binding->val_changes = g_slist_append (binding->val_changes,
- gconf_value);
+ if (binding->use_first_value) {
+ gconf_value_free (binding->use_first_value);
+ binding->use_first_value = NULL;
+
+ gconf_client_notify (bridge->client, binding->key);
+ } else {
+ /* Store until change notification comes in, so that we are able
+ * to ignore it */
+ binding->val_changes = g_slist_append (binding->val_changes,
+ gconf_value);
+ }
done:
g_value_unset (&value);
@@ -513,6 +525,7 @@ gconf_bridge_bind_property_full (GConfBridge *bridge,
binding->id = new_id ();
binding->delayed_mode = delayed_sync;
binding->val_changes = NULL;
+ binding->use_first_value = NULL;
binding->key = g_strdup (key);
binding->object = object;
binding->prop = pspec;
@@ -536,7 +549,15 @@ gconf_bridge_bind_property_full (GConfBridge *bridge,
val = gconf_client_get (bridge->client, key, NULL);
if (val) {
prop_binding_sync_pref_to_prop (binding, val);
- gconf_value_free (val);
+ #if GTK_CHECK_VERSION(2,19,7)
+ if (GTK_IS_WIDGET (object) && !gtk_widget_get_realized (GTK_WIDGET (object))) {
+ #else
+ if (GTK_IS_WIDGET (object) && !GTK_WIDGET_REALIZED (object)) {
+ #endif
+ binding->use_first_value = val;
+ } else {
+ gconf_value_free (val);
+ }
}
/* Handle case where watched object gets destroyed */
@@ -627,6 +648,11 @@ prop_binding_unbind (PropBinding *binding)
(binding->val_changes, binding->val_changes);
}
+ if (binding->use_first_value) {
+ gconf_value_free (binding->use_first_value);
+ binding->use_first_value = NULL;
+ }
+
/* The object might have been destroyed .. */
if (binding->object) {
g_signal_handler_disconnect (binding->object,
diff --git a/shell/e-shell-window-private.c b/shell/e-shell-window-private.c
index faccac8052..2272faca9e 100644
--- a/shell/e-shell-window-private.c
+++ b/shell/e-shell-window-private.c
@@ -413,6 +413,24 @@ e_shell_window_private_constructed (EShellWindow *shell_window)
bridge = gconf_bridge_get ();
+ /* First restore window size, then the rest */
+
+ /* Configure the initial size and position of the window by way
+ * of either a user-supplied geometry string or the last recorded
+ * values. Note that if a geometry string is applied, the window
+ * size and position are -not- recorded. */
+ if (priv->geometry != NULL) {
+ if (!gtk_window_parse_geometry (window, priv->geometry))
+ g_printerr (
+ "Failed to parse geometry '%s'\n",
+ priv->geometry);
+ g_free (priv->geometry);
+ priv->geometry = NULL;
+ } else {
+ key = "/apps/evolution/shell/view_defaults/window";
+ gconf_bridge_bind_window (bridge, key, window, TRUE, TRUE);
+ }
+
object = G_OBJECT (shell_window);
key = "/apps/evolution/shell/view_defaults/component_id";
gconf_bridge_bind_property (bridge, key, object, "active-view");
@@ -441,22 +459,6 @@ e_shell_window_private_constructed (EShellWindow *shell_window)
key = "/apps/evolution/shell/view_defaults/toolbar_visible";
gconf_bridge_bind_property (bridge, key, object, "toolbar-visible");
- /* Configure the initial size and position of the window by way
- * of either a user-supplied geometry string or the last recorded
- * values. Note that if a geometry string is applied, the window
- * size and position are -not- recorded. */
- if (priv->geometry != NULL) {
- if (!gtk_window_parse_geometry (window, priv->geometry))
- g_printerr (
- "Failed to parse geometry '%s'\n",
- priv->geometry);
- g_free (priv->geometry);
- priv->geometry = NULL;
- } else {
- key = "/apps/evolution/shell/view_defaults/window";
- gconf_bridge_bind_window (bridge, key, window, TRUE, TRUE);
- }
-
shell_window_init_switcher_style (shell_window);
id = "org.gnome.evolution.shell";