[Xfce4-commits] [apps/xfce4-terminal] 01/01: Make vte transparency work in Gnome under both X11 and Wayland

noreply at xfce.org noreply at xfce.org
Thu Sep 15 13:57:35 CEST 2016


This is an automated email from the git hooks/post-receive script.

f2404 pushed a commit to branch master
in repository apps/xfce4-terminal.

commit e1d6fd3d497508e293240ce2d9835db42aa7cc5f
Author: Igor <f2404 at yandex.ru>
Date:   Thu Sep 15 14:57:30 2016 +0300

    Make vte transparency work in Gnome under both X11 and Wayland
---
 terminal/terminal-window.c | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/terminal/terminal-window.c b/terminal/terminal-window.c
index 1be6131..9ebc583 100644
--- a/terminal/terminal-window.c
+++ b/terminal/terminal-window.c
@@ -342,6 +342,9 @@ terminal_window_init (TerminalWindow *window)
   if (visual != NULL)
     gtk_widget_set_visual (GTK_WIDGET (window), visual);
 
+  /* required for vte transparency support: see https://bugzilla.gnome.org/show_bug.cgi?id=729884 */
+  gtk_widget_set_app_paintable (window, TRUE);
+
   window->action_group = gtk_action_group_new ("terminal-window");
   gtk_action_group_set_translation_domain (window->action_group,
                                            GETTEXT_PACKAGE);
@@ -1575,6 +1578,10 @@ static void
 terminal_window_action_show_menubar (GtkToggleAction *action,
                                      TerminalWindow  *window)
 {
+  GtkStyleContext *context;
+  GtkStateFlags    state;
+  GdkRGBA          bg;
+
   terminal_return_if_fail (GTK_IS_UI_MANAGER (window->ui_manager));
 
   terminal_window_size_push (window);
@@ -1586,6 +1593,12 @@ terminal_window_action_show_menubar (GtkToggleAction *action,
           window->menubar = gtk_ui_manager_get_widget (window->ui_manager, "/main-menu");
           gtk_box_pack_start (GTK_BOX (window->vbox), window->menubar, FALSE, FALSE, 0);
           gtk_box_reorder_child (GTK_BOX (window->vbox), window->menubar, 0);
+
+          /* make menubar opaque */
+          context = gtk_widget_get_style_context (GTK_WIDGET (window));
+          state = gtk_widget_get_state_flags (GTK_WIDGET (window));
+          gtk_style_context_get_background_color (context, state, &bg);
+          gtk_widget_override_background_color (window->menubar, state, &bg);
         }
 
       gtk_widget_show (window->menubar);

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Xfce4-commits mailing list