[fadb19bfbddde11ed6828a22e742cc97f5589ce48ac8ec8f94a6510ad5f16b8b/wip/exalm/focused-appearance: 304/304] window: Appear as focused while focusing
- From: Alexander Mikhaylenko <alexm src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [fadb19bfbddde11ed6828a22e742cc97f5589ce48ac8ec8f94a6510ad5f16b8b/wip/exalm/focused-appearance: 304/304] window: Appear as focused while focusing
- Date: Tue, 7 Jul 2020 20:50:18 +0000 (UTC)
commit 0c03702168d63cb56a5d7aa8cbed854f42e1a402
Author: Alexander Mikhaylenko <exalm7659 gmail com>
Date: Sun Oct 13 05:15:51 2019 +0500
window: Appear as focused while focusing
Prevent focused window from blinking after switching to another
workspace on X11.
https://gitlab.gnome.org/GNOME/mutter/merge_requests/850
src/core/window-private.h | 3 +++
src/core/window.c | 9 ++++++++-
2 files changed, 11 insertions(+), 1 deletion(-)
---
diff --git a/src/core/window-private.h b/src/core/window-private.h
index 12123e2d26..5ead4fa998 100644
--- a/src/core/window-private.h
+++ b/src/core/window-private.h
@@ -550,6 +550,9 @@ struct _MetaWindow
guint unmanage_idle_id;
pid_t client_pid;
+
+ /* Prevent blinking when focusing */
+ gboolean focusing;
};
struct _MetaWindowClass
diff --git a/src/core/window.c b/src/core/window.c
index 550762e6d6..4208061e32 100644
--- a/src/core/window.c
+++ b/src/core/window.c
@@ -4782,6 +4782,10 @@ meta_window_focus (MetaWindow *window,
window = modal_transient;
}
+ /* If the window was already appearing focused, but didn't have has_focus set,
+ * it will now briefly appear unfocused on X11. Set a flag to prevent that. */
+ window->focusing = TRUE;
+
meta_window_flush_calc_showing (window);
if ((!window->mapped || window->hidden) && !window->shaded)
@@ -4789,6 +4793,7 @@ meta_window_focus (MetaWindow *window,
meta_topic (META_DEBUG_FOCUS,
"Window %s is not showing, not focusing after all\n",
window->desc);
+ window->focusing = FALSE;
return;
}
@@ -5274,6 +5279,8 @@ meta_window_set_focused_internal (MetaWindow *window,
{
MetaWorkspaceManager *workspace_manager = window->display->workspace_manager;
+ window->focusing = FALSE;
+
if (focused)
{
window->has_focus = TRUE;
@@ -7272,7 +7279,7 @@ meta_window_appears_focused (MetaWindow *window)
if (workspace && workspace != workspace_manager->active_workspace)
default_window = meta_workspace_get_default_focus_window (workspace);
- return window->has_focus || (window->attached_focus_window != NULL) || (window == default_window);
+ return window->has_focus || window->focusing || (window->attached_focus_window != NULL) || (window ==
default_window);
}
gboolean
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]