aboutsummaryrefslogtreecommitdiffstats
path: root/shell
diff options
context:
space:
mode:
authorMilan Crha <mcrha@redhat.com>2014-06-05 01:46:25 +0800
committerMilan Crha <mcrha@redhat.com>2014-06-05 01:46:25 +0800
commit2f3fbdd6c6ff42a6c71ebe1d1d78108affe59d0f (patch)
treefd60a103158c3cfdbbce197feca07d7fea008a3d /shell
parent668745ff49d8f312c7d419a691cdab3e128ded06 (diff)
downloadgsoc2013-evolution-2f3fbdd6c6ff42a6c71ebe1d1d78108affe59d0f.tar
gsoc2013-evolution-2f3fbdd6c6ff42a6c71ebe1d1d78108affe59d0f.tar.gz
gsoc2013-evolution-2f3fbdd6c6ff42a6c71ebe1d1d78108affe59d0f.tar.bz2
gsoc2013-evolution-2f3fbdd6c6ff42a6c71ebe1d1d78108affe59d0f.tar.lz
gsoc2013-evolution-2f3fbdd6c6ff42a6c71ebe1d1d78108affe59d0f.tar.xz
gsoc2013-evolution-2f3fbdd6c6ff42a6c71ebe1d1d78108affe59d0f.tar.zst
gsoc2013-evolution-2f3fbdd6c6ff42a6c71ebe1d1d78108affe59d0f.zip
Ignore false GObject property change notifications
This is related to bug 698275, which did not cover all cases. The problem here is that the dconf can in certain situation claim that everything changed (path "/" changed), which GSettingsBinding propagates to a GObject property unconditionally and GObject's property setter (g_object_set_property()) also notifies about the property change unconditionally, despite the real descendant property setter properly checks for the value change. After all these false notifications a callback on "notify" signal is called and possibly an expensive operation is run. Checking whether the value really changed helps in performance, for which were added new e-util functions: e_signal_connect_notify() e_signal_connect_notify_after() e_signal_connect_notify_swapped() e_signal_connect_notify_object() which have the same prototype as their GLib counterparts, but they allow only "notify::..." signals and they test whether the value really changed before they call the registered callback.
Diffstat (limited to 'shell')
-rw-r--r--shell/e-shell-switcher.c4
-rw-r--r--shell/e-shell-window-private.c8
-rw-r--r--shell/e-shell-window.c14
-rw-r--r--shell/e-shell.c2
4 files changed, 15 insertions, 13 deletions
diff --git a/shell/e-shell-switcher.c b/shell/e-shell-switcher.c
index 191426e162..a4d6394660 100644
--- a/shell/e-shell-switcher.c
+++ b/shell/e-shell-switcher.c
@@ -33,6 +33,8 @@
#include <glib/gi18n.h>
#include <libebackend/libebackend.h>
+#include <e-util/e-util.h>
+
#define E_SHELL_SWITCHER_GET_PRIVATE(obj) \
(G_TYPE_INSTANCE_GET_PRIVATE \
((obj), E_TYPE_SHELL_SWITCHER, EShellSwitcherPrivate))
@@ -377,7 +379,7 @@ shell_switcher_screen_changed (GtkWidget *widget,
if (settings != NULL) {
priv->settings = g_object_ref (settings);
- priv->settings_handler_id = g_signal_connect_swapped (
+ priv->settings_handler_id = e_signal_connect_notify_swapped (
settings, "notify::gtk-toolbar-style",
G_CALLBACK (shell_switcher_toolbar_style_changed_cb),
widget);
diff --git a/shell/e-shell-window-private.c b/shell/e-shell-window-private.c
index d00b8496b7..67612063e6 100644
--- a/shell/e-shell-window-private.c
+++ b/shell/e-shell-window-private.c
@@ -327,19 +327,19 @@ e_shell_window_private_constructed (EShellWindow *shell_window)
/* Bunch of chores to do when the active view changes. */
- g_signal_connect (
+ e_signal_connect_notify (
shell_window, "notify::active-view",
G_CALLBACK (e_shell_window_update_icon), NULL);
- g_signal_connect (
+ e_signal_connect_notify (
shell_window, "notify::active-view",
G_CALLBACK (e_shell_window_update_title), NULL);
- g_signal_connect (
+ e_signal_connect_notify (
shell_window, "notify::active-view",
G_CALLBACK (e_shell_window_update_view_menu), NULL);
- g_signal_connect (
+ e_signal_connect_notify (
shell_window, "notify::active-view",
G_CALLBACK (e_shell_window_update_search_menu), NULL);
diff --git a/shell/e-shell-window.c b/shell/e-shell-window.c
index 69eef7d40f..70187c954f 100644
--- a/shell/e-shell-window.c
+++ b/shell/e-shell-window.c
@@ -454,7 +454,7 @@ shell_window_construct_menubar (EShellWindow *shell_window)
shell_window, "/main-menu");
gtk_widget_show (main_menu);
- g_signal_connect (
+ e_signal_connect_notify (
shell_window, "notify::active-view",
G_CALLBACK (shell_window_menubar_update_new_menu), NULL);
@@ -572,7 +572,7 @@ shell_window_construct_sidebar (EShellWindow *shell_window)
shell_window->priv->sidebar_notebook = g_object_ref (notebook);
gtk_widget_show (notebook);
- g_signal_connect (
+ e_signal_connect_notify (
shell_window, "notify::active-view",
G_CALLBACK (shell_window_set_notebook_page), notebook);
@@ -600,7 +600,7 @@ shell_window_construct_content (EShellWindow *shell_window)
shell_window->priv->content_notebook = g_object_ref (widget);
gtk_widget_show (widget);
- g_signal_connect (
+ e_signal_connect_notify (
shell_window, "notify::active-view",
G_CALLBACK (shell_window_set_notebook_page), widget);
@@ -665,7 +665,7 @@ shell_window_construct_taskbar (EShellWindow *shell_window)
shell_window->priv->status_notebook = g_object_ref (notebook);
gtk_widget_show (notebook);
- g_signal_connect (
+ e_signal_connect_notify (
shell_window, "notify::active-view",
G_CALLBACK (shell_window_set_notebook_page), notebook);
@@ -747,15 +747,15 @@ shell_window_create_shell_view (EShellWindow *shell_window,
/* Listen for changes that affect the shell window. */
- g_signal_connect_swapped (
+ e_signal_connect_notify_swapped (
action, "notify::icon-name",
G_CALLBACK (e_shell_window_update_icon), shell_window);
- g_signal_connect_swapped (
+ e_signal_connect_notify_swapped (
shell_view, "notify::title",
G_CALLBACK (e_shell_window_update_title), shell_window);
- g_signal_connect_swapped (
+ e_signal_connect_notify_swapped (
shell_view, "notify::view-id",
G_CALLBACK (e_shell_window_update_view_menu), shell_window);
diff --git a/shell/e-shell.c b/shell/e-shell.c
index 2c1ae2f83f..dc2d993de6 100644
--- a/shell/e-shell.c
+++ b/shell/e-shell.c
@@ -1171,7 +1171,7 @@ e_shell_init (EShell *shell)
icon_theme = gtk_icon_theme_get_default ();
gtk_icon_theme_append_search_path (icon_theme, EVOLUTION_ICONDIR);
- g_signal_connect (
+ e_signal_connect_notify (
shell, "notify::online",
G_CALLBACK (shell_notify_online_cb), NULL);