window: Move out 'showable' check from should_be_showing_on_workspace()

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3475>
This commit is contained in:
Jonas Ådahl 2024-03-25 11:01:02 +01:00 committed by Marge Bot
parent 33ff998a10
commit eab06bcf24

View File

@ -1690,6 +1690,22 @@ window_has_buffer (MetaWindow *window)
return TRUE; return TRUE;
} }
static gboolean
meta_window_is_showable (MetaWindow *window)
{
#ifdef HAVE_WAYLAND
if (window->client_type == META_WINDOW_CLIENT_TYPE_WAYLAND &&
!window_has_buffer (window))
return FALSE;
#endif
if (window->client_type == META_WINDOW_CLIENT_TYPE_X11 &&
window->decorated && !window->frame)
return FALSE;
return TRUE;
}
/** /**
* meta_window_should_be_showing_on_workspace: * meta_window_should_be_showing_on_workspace:
* *
@ -1703,14 +1719,7 @@ gboolean
meta_window_should_be_showing_on_workspace (MetaWindow *window, meta_window_should_be_showing_on_workspace (MetaWindow *window,
MetaWorkspace *workspace) MetaWorkspace *workspace)
{ {
#ifdef HAVE_WAYLAND if (!meta_window_is_showable (window))
if (window->client_type == META_WINDOW_CLIENT_TYPE_WAYLAND &&
!window_has_buffer (window))
return FALSE;
#endif
if (window->client_type == META_WINDOW_CLIENT_TYPE_X11 &&
window->decorated && !window->frame)
return FALSE; return FALSE;
/* Windows should be showing if they're located on the /* Windows should be showing if they're located on the