diff options
author | Mihai Moldovan <[email protected]> | 2023-07-28 20:27:28 +0200 |
---|---|---|
committer | raveit65 <[email protected]> | 2023-08-17 21:50:32 +0200 |
commit | 645c83a4755db32d68a4b0ec27fe9dddd9f92e07 (patch) | |
tree | 01d4d95b36c86a1550a4dec31128d5aa3f44291f | |
parent | dc4a2863dd402b052edce27e441503751619b024 (diff) | |
download | marco-645c83a4755db32d68a4b0ec27fe9dddd9f92e07.tar.bz2 marco-645c83a4755db32d68a4b0ec27fe9dddd9f92e07.tar.xz |
ui/tabpopup: likewise only enable compositing code if available.
-rw-r--r-- | src/core/screen.c | 2 | ||||
-rw-r--r-- | src/include/tabpopup.h | 2 | ||||
-rw-r--r-- | src/ui/tabpopup.c | 9 |
3 files changed, 11 insertions, 2 deletions
diff --git a/src/core/screen.c b/src/core/screen.c index 99932393..99e3fc39 100644 --- a/src/core/screen.c +++ b/src/core/screen.c @@ -1407,6 +1407,7 @@ meta_screen_ensure_tab_popup (MetaScreen *screen, } screen->tab_popup = meta_ui_tab_popup_new (entries, + screen, len, meta_prefs_get_alt_tab_max_columns(), meta_prefs_get_alt_tab_expand_to_fit_title(), @@ -1486,6 +1487,7 @@ meta_screen_ensure_workspace_popup (MetaScreen *screen) } screen->tab_popup = meta_ui_tab_popup_new (entries, + screen, len, layout.cols, FALSE, /* expand_for_titles */ diff --git a/src/include/tabpopup.h b/src/include/tabpopup.h index 19e8621b..8f249511 100644 --- a/src/include/tabpopup.h +++ b/src/include/tabpopup.h @@ -28,6 +28,7 @@ /* Don't include gtk.h or gdk.h here */ #include "common.h" #include "boxes.h" +#include "types.h" #include <X11/Xlib.h> #include <glib.h> #include <gdk-pixbuf/gdk-pixbuf.h> @@ -58,6 +59,7 @@ struct _MetaTabEntry }; MetaTabPopup* meta_ui_tab_popup_new (const MetaTabEntry *entries, + MetaScreen *meta_screen, int entry_count, int width, gboolean expand_for_titles, diff --git a/src/ui/tabpopup.c b/src/ui/tabpopup.c index d3b9ba62..57973fb0 100644 --- a/src/ui/tabpopup.c +++ b/src/ui/tabpopup.c @@ -30,6 +30,7 @@ #include "tabpopup.h" #include "theme.h" #include "prefs.h" +#include "screen.h" /* FIXME these two includes are 100% broken... */ #include "../core/workspace.h" #include "../core/frame-private.h" @@ -235,6 +236,7 @@ tab_entry_new (const MetaTabEntry *entry, MetaTabPopup* meta_ui_tab_popup_new (const MetaTabEntry *entries, + MetaScreen *meta_screen, int entry_count, int width, gboolean expand_for_titles, @@ -285,7 +287,8 @@ meta_ui_tab_popup_new (const MetaTabEntry *entries, gtk_window_set_resizable (GTK_WINDOW (popup->window), TRUE); /* This style should only be set for composited mode. */ - if (meta_prefs_get_compositing_manager ()) + if (meta_prefs_get_compositing_manager () && meta_screen && + !!(meta_display_get_compositor (meta_screen_get_display (meta_screen)))) { frame_shadow = GTK_SHADOW_NONE; gtk_style_context_add_class (gtk_widget_get_style_context (GTK_WIDGET (popup->window)), @@ -1117,13 +1120,15 @@ meta_select_workspace_draw (GtkWidget *widget, { GtkStyleContext *context; GdkRGBA color; + MetaScreen *screen = META_SELECT_WORKSPACE (widget)->workspace->screen; context = gtk_widget_get_style_context (widget); gtk_style_context_set_state (context, gtk_widget_get_state_flags (widget)); - if (meta_prefs_get_compositing_manager ()) + if (meta_prefs_get_compositing_manager () && screen && + !!(meta_display_get_compositor (meta_screen_get_display (screen)))) { /* compositing manager creates a dark background: show the selection in a light color */ meta_gtk_style_get_light_color (context, GTK_STATE_FLAG_SELECTED, &color); |