diff --git a/src/core/display.c b/src/core/display.c index 985d202ca..9f26f77af 100644 --- a/src/core/display.c +++ b/src/core/display.c @@ -1986,14 +1986,11 @@ in_tab_chain (MetaWindow *window, gboolean in_normal_tab_chain_type; gboolean in_normal_tab_chain; gboolean in_dock_tab_chain; - gboolean in_group_tab_chain; + gboolean in_group_tab_chain = FALSE; +#ifdef HAVE_X11_CLIENT MetaGroup *focus_group = NULL; MetaGroup *window_group = NULL; - in_normal_tab_chain_type = window->type != META_WINDOW_DOCK && window->type != META_WINDOW_DESKTOP; - in_normal_tab_chain = meta_window_is_focusable (window) && in_normal_tab_chain_type && !window->skip_taskbar; - in_dock_tab_chain = meta_window_is_focusable (window) && (!in_normal_tab_chain_type || window->skip_taskbar); - if (window->display->focus_window && window->display->focus_window->client_type == META_WINDOW_CLIENT_TYPE_X11) focus_group = meta_window_get_group (window->display->focus_window); @@ -2002,6 +1999,11 @@ in_tab_chain (MetaWindow *window, window_group = meta_window_get_group (window); in_group_tab_chain = meta_window_is_focusable (window) && (!focus_group || window_group == focus_group); +#endif + + in_normal_tab_chain_type = window->type != META_WINDOW_DOCK && window->type != META_WINDOW_DESKTOP; + in_normal_tab_chain = meta_window_is_focusable (window) && in_normal_tab_chain_type && !window->skip_taskbar; + in_dock_tab_chain = meta_window_is_focusable (window) && (!in_normal_tab_chain_type || window->skip_taskbar); return (type == META_TAB_LIST_NORMAL && in_normal_tab_chain) || (type == META_TAB_LIST_DOCKS && in_dock_tab_chain) diff --git a/src/core/place.c b/src/core/place.c index 8cb4144ad..cab76993e 100644 --- a/src/core/place.c +++ b/src/core/place.c @@ -36,6 +36,10 @@ #include "meta/prefs.h" #include "meta/workspace.h" +#ifdef HAVE_X11_CLIENT +#include "x11/window-x11-private.h" +#endif + typedef enum { META_LEFT, @@ -410,7 +414,9 @@ avoid_being_obscured_as_second_modal_dialog (MetaWindow *window, if (window->denied_focus_and_not_transient && window->type == META_WINDOW_MODAL_DIALOG && - meta_window_same_application (window, focus_window) && +#ifdef HAVE_X11_CLIENT + meta_window_x11_same_application (window, focus_window) && +#endif window_overlaps_focus_window (window)) { find_most_freespace (window, focus_window, *x, *y, x, y); diff --git a/src/core/stack.c b/src/core/stack.c index 75f69c686..3b47987fd 100644 --- a/src/core/stack.c +++ b/src/core/stack.c @@ -36,11 +36,14 @@ #include "core/meta-workspace-manager-private.h" #include "core/window-private.h" #include "core/workspace-private.h" -#include "meta/group.h" #include "meta/prefs.h" #include "meta/workspace.h" + +#ifdef HAVE_X11_CLIENT +#include "meta/group.h" #include "x11/meta-x11-display-private.h" #include "x11/window-x11.h" +#endif #define WINDOW_TRANSIENT_FOR_WHOLE_GROUP(w) \ (meta_window_has_transient_type (w) && w->transient_for == NULL) @@ -502,6 +505,7 @@ create_constraints (Constraint **constraints, continue; } +#ifdef HAVE_X11_CLIENT if (WINDOW_TRANSIENT_FOR_WHOLE_GROUP (w)) { GSList *group_windows; @@ -550,7 +554,9 @@ create_constraints (Constraint **constraints, g_slist_free (group_windows); } - else if (w->transient_for != NULL) + else +#endif + if (w->transient_for != NULL) { MetaWindow *parent; diff --git a/src/core/window-private.h b/src/core/window-private.h index bd7dd7433..26b96a1da 100644 --- a/src/core/window-private.h +++ b/src/core/window-private.h @@ -717,10 +717,6 @@ void meta_window_get_tile_area (MetaWindow *window, MetaTileMode mode, MtkRectangle *tile_area); - -gboolean meta_window_same_application (MetaWindow *window, - MetaWindow *other_window); - void meta_window_free_delete_dialog (MetaWindow *window); MetaStackLayer meta_window_get_default_layer (MetaWindow *window); diff --git a/src/core/window.c b/src/core/window.c index 8f69c4762..7557ef01a 100644 --- a/src/core/window.c +++ b/src/core/window.c @@ -79,13 +79,13 @@ #include "core/util-private.h" #include "core/workspace-private.h" #include "meta/compositor-mutter.h" -#include "meta/group.h" #include "meta/meta-cursor-tracker.h" #include "meta/meta-enum-types.h" #include "meta/prefs.h" #include "mtk/mtk-x11.h" #ifdef HAVE_X11_CLIENT +#include "meta/group.h" #include "x11/meta-x11-display-private.h" #include "x11/window-props.h" #include "x11/window-x11-private.h" @@ -1444,10 +1444,10 @@ meta_window_unmanage (MetaWindow *window, if (meta_prefs_get_workspaces_only_on_primary ()) meta_window_on_all_workspaces_changed (window); +#ifdef HAVE_X11_CLIENT if (window->fullscreen) { - MetaGroup *group; - + MetaGroup *group = NULL; /* If the window is fullscreen, it may be forcing * other windows in its group to a higher layer */ @@ -1459,16 +1459,18 @@ meta_window_unmanage (MetaWindow *window, if (group) meta_group_update_layers (group); } - meta_stack_thaw (window->display->stack); } +#endif meta_display_remove_pending_pings_for_window (window->display, window); /* safe to do this early as group.c won't re-add to the * group if window->unmanaging */ +#ifdef HAVE_X11_CLIENT if (window->client_type == META_WINDOW_CLIENT_TYPE_X11) meta_window_shutdown_group (window); +#endif /* If we have the focus, focus some other window. * This is done first, so that if the unmap causes @@ -4463,6 +4465,7 @@ meta_window_get_titlebar_rect (MetaWindow *window, const char* meta_window_get_startup_id (MetaWindow *window) { +#ifdef HAVE_X11_CLIENT if (window->startup_id == NULL && window->client_type == META_WINDOW_CLIENT_TYPE_X11) { MetaGroup *group; @@ -4472,6 +4475,7 @@ meta_window_get_startup_id (MetaWindow *window) if (group != NULL) return meta_group_get_startup_id (group); } +#endif return window->startup_id; } @@ -5928,19 +5932,6 @@ meta_window_get_tile_area (MetaWindow *window, tile_area->x += work_area.width - tile_area->width; } -gboolean -meta_window_same_application (MetaWindow *window, - MetaWindow *other_window) -{ - MetaGroup *group = meta_window_get_group (window); - MetaGroup *other_group = meta_window_get_group (other_window); - - return - group!=NULL && - other_group!=NULL && - group==other_group; -} - /** * meta_window_is_client_decorated: * @@ -6119,18 +6110,23 @@ meta_window_get_default_layer (MetaWindow *window) void meta_window_update_layer (MetaWindow *window) { +#ifdef HAVE_X11_CLIENT MetaGroup *group = NULL; - meta_stack_freeze (window->display->stack); - if (window->client_type == META_WINDOW_CLIENT_TYPE_X11) group = meta_window_get_group (window); + meta_stack_freeze (window->display->stack); if (group) meta_group_update_layers (group); else meta_stack_update_layer (window->display->stack, window); meta_stack_thaw (window->display->stack); +#else + meta_stack_freeze (window->display->stack); + meta_stack_update_layer (window->display->stack, window); + meta_stack_thaw (window->display->stack); +#endif } /* ensure_mru_position_after ensures that window appears after diff --git a/src/meta/group.h b/src/meta/group.h index 0d779459e..0951f4897 100644 --- a/src/meta/group.h +++ b/src/meta/group.h @@ -21,7 +21,9 @@ #pragma once +#ifdef HAVE_X11_CLIENT #include +#endif #include #include "meta/common.h" @@ -40,14 +42,15 @@ void meta_window_shutdown_group (MetaWindow *window); META_EXPORT void meta_window_group_leader_changed (MetaWindow *window); +META_EXPORT +GSList* meta_group_list_windows (MetaGroup *group); + +#ifdef HAVE_X11_CLIENT /* note, can return NULL */ META_EXPORT MetaGroup *meta_x11_display_lookup_group (MetaX11Display *x11_display, Window group_leader); -META_EXPORT -GSList* meta_group_list_windows (MetaGroup *group); - META_EXPORT void meta_group_update_layers (MetaGroup *group); @@ -60,3 +63,4 @@ int meta_group_get_size (MetaGroup *group); META_EXPORT gboolean meta_group_property_notify (MetaGroup *group, XEvent *event); +#endif diff --git a/src/x11/window-x11-private.h b/src/x11/window-x11-private.h index 814465e2e..522b571f0 100644 --- a/src/x11/window-x11-private.h +++ b/src/x11/window-x11-private.h @@ -105,4 +105,7 @@ Window meta_window_x11_get_xtransient_for (MetaWindow *window); gboolean meta_window_x11_has_pointer (MetaWindow *window); +gboolean meta_window_x11_same_application (MetaWindow *window, + MetaWindow *other_window); + G_END_DECLS diff --git a/src/x11/window-x11.c b/src/x11/window-x11.c index ca1a41b7b..b1026f537 100644 --- a/src/x11/window-x11.c +++ b/src/x11/window-x11.c @@ -2564,7 +2564,7 @@ meta_window_x11_update_shape_region (MetaWindow *window) meta_window_set_shape_region (window, region); } -/* Generally meta_window_same_application() is a better idea +/* Generally meta_window_x11_same_application() is a better idea * of "sameness", since it handles the case where multiple apps * want to look like the same app or the same app wants to look * like multiple apps, but in the case of workarounds for legacy @@ -2841,7 +2841,7 @@ meta_window_x11_configure_request (MetaWindow *window, window->desc); } else if (active_window && - !meta_window_same_application (window, active_window) && + !meta_window_x11_same_application (window, active_window) && !meta_window_same_client (window, active_window) && XSERVER_TIME_IS_BEFORE (window->net_wm_user_time, active_window->net_wm_user_time)) @@ -4486,3 +4486,15 @@ meta_window_x11_has_pointer (MetaWindow *window) return meta_x11_display_lookup_x_window (x11_display, child) == window; } + +gboolean +meta_window_x11_same_application (MetaWindow *window, + MetaWindow *other_window) +{ + MetaGroup *group = meta_window_get_group (window); + MetaGroup *other_group = meta_window_get_group (other_window); + + return (group != NULL && + other_group != NULL && + group == other_group); +}