[mutter/wip/exalm/focused-appearance: 2/6] window: Add meta_window_should_be_showing_on_workspace()



commit 13c6486ebae1a53bbef504a9d4eb8056672a4ce9
Author: Alexander Mikhaylenko <exalm7659 gmail com>
Date:   Sat Oct 12 23:52:32 2019 +0500

    window: Add meta_window_should_be_showing_on_workspace()
    
    Allow to check visibility for arbitrary workspace.
    
    https://gitlab.gnome.org/GNOME/mutter/merge_requests/850

 src/core/window-private.h |  4 +++-
 src/core/window.c         | 15 +++++++++++----
 2 files changed, 14 insertions(+), 5 deletions(-)
---
diff --git a/src/core/window-private.h b/src/core/window-private.h
index dd89fdc90..f45e7b111 100644
--- a/src/core/window-private.h
+++ b/src/core/window-private.h
@@ -656,7 +656,9 @@ void        meta_window_resize_frame_with_gravity (MetaWindow  *window,
                                                    int          gravity);
 
 /* Return whether the window should be currently mapped */
-gboolean    meta_window_should_be_showing   (MetaWindow  *window);
+gboolean    meta_window_should_be_showing              (MetaWindow    *window);
+gboolean    meta_window_should_be_showing_on_workspace (MetaWindow    *window,
+                                                        MetaWorkspace *workspace);
 
 void        meta_window_update_struts      (MetaWindow  *window);
 
diff --git a/src/core/window.c b/src/core/window.c
index e276b1e59..03f1fab27 100644
--- a/src/core/window.c
+++ b/src/core/window.c
@@ -1751,19 +1751,26 @@ meta_window_showing_on_its_workspace (MetaWindow *window)
 }
 
 gboolean
-meta_window_should_be_showing (MetaWindow  *window)
+meta_window_should_be_showing (MetaWindow *window)
 {
   MetaWorkspaceManager *workspace_manager = window->display->workspace_manager;
 
+  /* Windows should be showing if they're located on the
+   * active workspace and they're showing on their own workspace. */
+  return meta_window_should_be_showing_on_workspace (window, workspace_manager->active_workspace);
+}
+
+gboolean
+meta_window_should_be_showing_on_workspace (MetaWindow    *window,
+                                            MetaWorkspace *workspace)
+{
 #ifdef HAVE_WAYLAND
   if (window->client_type == META_WINDOW_CLIENT_TYPE_WAYLAND &&
       !meta_wayland_surface_get_buffer (window->surface))
     return FALSE;
 #endif
 
-  /* Windows should be showing if they're located on the
-   * active workspace and they're showing on their own workspace. */
-  return (meta_window_located_on_workspace (window, workspace_manager->active_workspace) &&
+  return (meta_window_located_on_workspace (window, workspace) &&
           meta_window_showing_on_its_workspace (window));
 }
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]