From 69348e59ea41f1a9135c7bf3a0a5a3c8f31361c2 Mon Sep 17 00:00:00 2001 From: Jan Ziak <0xe2.0x9a.0x9b@gmail.com> Date: Tue, 28 Apr 2020 19:11:12 +0200 Subject: [PATCH] Avoid redundant calls to backdrop_changed_cb (Bug #16773) Signed-off-by: Jan Ziak <0xe2.0x9a.0x9b@gmail.com> --- src/xfce-desktop.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/xfce-desktop.c b/src/xfce-desktop.c index 40d74037..0b674cc6 100644 --- a/src/xfce-desktop.c +++ b/src/xfce-desktop.c @@ -102,6 +102,7 @@ struct _XfceDesktopPrivate gint nworkspaces; XfceWorkspace **workspaces; gint current_workspace; + gboolean current_workspace_initialized; gboolean single_workspace_mode; gint single_workspace_num; @@ -745,10 +746,13 @@ workspace_changed_cb(WnckScreen *wnck_screen, current_workspace = desktop->priv->current_workspace; new_workspace = xfce_desktop_get_current_workspace(desktop); + if(desktop->priv->current_workspace_initialized && new_workspace == current_workspace) + return; if(new_workspace < 0 || new_workspace >= desktop->priv->nworkspaces) return; desktop->priv->current_workspace = new_workspace; + desktop->priv->current_workspace_initialized = TRUE; XF_DEBUG("current_workspace %d, new_workspace %d", current_workspace, new_workspace); -- 2.26.2