From 6b6eba9bd108dc326f2e67bc73c36f0eb8f2f500 Mon Sep 17 00:00:00 2001 From: Victor Kareh Date: Fri, 15 May 2026 16:53:25 -0400 Subject: applet: force menubar background to transparent The GtkMenuBar used by the indicator applet picks up opaque background styling from GTK themes via the .menubar CSS class, causing it to not follow the panel's background color or transparency. This was previously worked around in mate-themes, but third-party themes still had the issue. Add a GtkCssProvider to reset the menubar background to transparent, using the same pattern as other mate-panel applets (clock, window-list, workspace-switcher). Fixes #17 --- src/applet-main.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'src/applet-main.c') diff --git a/src/applet-main.c b/src/applet-main.c index a5f6662..64c6287 100644 --- a/src/applet-main.c +++ b/src/applet-main.c @@ -1072,6 +1072,19 @@ applet_fill_cb (MatePanelApplet * applet, const gchar * iid G_GNUC_UNUSED, packdirection); gtk_widget_set_can_focus (menubar, TRUE); gtk_widget_set_name(GTK_WIDGET (menubar), "fast-user-switch-menubar"); + + GtkCssProvider *css_provider = gtk_css_provider_new (); + gtk_css_provider_load_from_data (css_provider, + "#fast-user-switch-menubar {\n" + "background-color: transparent;\n" + "background-image: none;\n" + "}", + -1, NULL); + gtk_style_context_add_provider (gtk_widget_get_style_context (menubar), + GTK_STYLE_PROVIDER (css_provider), + GTK_STYLE_PROVIDER_PRIORITY_APPLICATION); + g_object_unref (css_provider); + g_signal_connect(menubar, "button-press-event", G_CALLBACK(menubar_press), NULL); g_signal_connect_after(menubar, "draw", G_CALLBACK(menubar_on_draw), menubar); g_signal_connect(applet, "change-orient", -- cgit v1.2.1