Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 933688 Details for
Bug 1111136
Tabs panel backgorund is completely transparent when transparency is turned on.
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
Transparency for gnome-terminal 3.13
gnome-terminal-3.13-transparency.patch (text/plain), 18.85 KB, created by
Egmont Koblinger
on 2014-09-02 10:34:30 UTC
(
hide
)
Description:
Transparency for gnome-terminal 3.13
Filename:
MIME Type:
Creator:
Egmont Koblinger
Created:
2014-09-02 10:34:30 UTC
Size:
18.85 KB
patch
obsolete
>diff --git a/src/org.gnome.Terminal.gschema.xml b/src/org.gnome.Terminal.gschema.xml >index 011bb34..9afcb66 100644 >--- a/src/org.gnome.Terminal.gschema.xml >+++ b/src/org.gnome.Terminal.gschema.xml >@@ -318,6 +318,16 @@ > <default>'narrow'</default> > <summary>Whether ambiguous-width characters are narrow or wide when using UTF-8 encoding</summary> > </key> >+ <key name="use-transparent-background" type="b"> >+ <default>false</default> >+ <summary>Whether to use a transparent background</summary> >+ </key> >+ <key name="background-transparency-percent" type="i"> >+ <default>50</default> >+ <range min="0" max="100"/> >+ <summary>Adjust the amount of transparency</summary> >+ <description>A value between 0 and 100, where 0 is opaque and 100 is fully transparent.</description> >+ </key> > </schema> > > <!-- Keybinding settings --> >diff --git a/src/profile-editor.c b/src/profile-editor.c >index c3bc959..b6249fb 100644 >--- a/src/profile-editor.c >+++ b/src/profile-editor.c >@@ -1081,6 +1081,16 @@ terminal_profile_edit (GSettings *profile, > gtk_builder_get_object (builder, "rewrap-on-resize-checkbutton"), > "active", G_SETTINGS_BIND_GET | G_SETTINGS_BIND_SET); > >+ g_settings_bind (profile, TERMINAL_PROFILE_USE_TRANSPARENT_BACKGROUND, >+ gtk_builder_get_object (builder, "use-transparent-background"), >+ "active", G_SETTINGS_BIND_GET | G_SETTINGS_BIND_SET); >+ g_settings_bind (profile, TERMINAL_PROFILE_USE_TRANSPARENT_BACKGROUND, >+ gtk_builder_get_object (builder, "background-transparent-scale-box"), >+ "sensitive", G_SETTINGS_BIND_GET | G_SETTINGS_BIND_NO_SENSITIVITY); >+ g_settings_bind (profile, TERMINAL_PROFILE_BACKGROUND_TRANSPARENCY_PERCENT, >+ gtk_builder_get_object (builder, "background-transparent-adjustment"), >+ "value", G_SETTINGS_BIND_GET | G_SETTINGS_BIND_SET); >+ > /* Compatibility options */ > w = (GtkWidget *) gtk_builder_get_object (builder, "encoding-combobox"); > init_encodings_combo (w); >diff --git a/src/profile-preferences.ui b/src/profile-preferences.ui >index 06d91e5..b48fe09 100644 >--- a/src/profile-preferences.ui >+++ b/src/profile-preferences.ui >@@ -23,6 +23,11 @@ > <property name="step_increment">1</property> > <property name="page_increment">100</property> > </object> >+ <object class="GtkAdjustment" id="background-transparent-adjustment"> >+ <property name="upper">100</property> >+ <property name="step_increment">1</property> >+ <property name="page_increment">10</property> >+ </object> > <object class="GtkListStore" id="model1"> > <columns> > <!-- column-name gchararray --> >@@ -1101,6 +1106,93 @@ > <property name="position">1</property> > </packing> > </child> >+ <child> >+ <object class="GtkBox" id="use-transparent-background-box"> >+ <property name="visible">True</property> >+ <property name="can_focus">False</property> >+ <property name="orientation">horizontal</property> >+ <property name="spacing">12</property> >+ <child> >+ <object class="GtkCheckButton" id="use-transparent-background"> >+ <property name="label" translatable="yes">Use t_ransparent background</property> >+ <property name="visible">True</property> >+ <property name="can_focus">True</property> >+ <property name="receives_default">False</property> >+ <property name="use_underline">True</property> >+ <property name="xalign">0</property> >+ <property name="draw_indicator">True</property> >+ </object> >+ <packing> >+ <property name="expand">False</property> >+ <property name="fill">False</property> >+ <property name="position">0</property> >+ </packing> >+ </child> >+ <child> >+ <object class="GtkBox" id="background-transparent-scale-box"> >+ <property name="visible">True</property> >+ <property name="can_focus">False</property> >+ <property name="orientation">horizontal</property> >+ <property name="spacing">6</property> >+ <child> >+ <object class="GtkLabel" id="background-transparent-min-label"> >+ <property name="visible">True</property> >+ <property name="can_focus">False</property> >+ <property name="xalign">0.5</property> >+ <property name="label" translatable="yes">none</property> >+ <style> >+ <class name="dim-label"/> >+ </style> >+ </object> >+ <packing> >+ <property name="expand">False</property> >+ <property name="fill">False</property> >+ <property name="position">0</property> >+ </packing> >+ </child> >+ <child> >+ <object class="GtkScale" id="background-transparent-scale"> >+ <property name="visible">True</property> >+ <property name="can_focus">True</property> >+ <property name="adjustment">background-transparent-adjustment</property> >+ <property name="draw_value">False</property> >+ </object> >+ <packing> >+ <property name="expand">True</property> >+ <property name="fill">True</property> >+ <property name="position">1</property> >+ </packing> >+ </child> >+ <child> >+ <object class="GtkLabel" id="background-transparent-max-label"> >+ <property name="visible">True</property> >+ <property name="can_focus">False</property> >+ <property name="xalign">0.5</property> >+ <property name="label" translatable="yes">full</property> >+ <style> >+ <class name="dim-label"/> >+ </style> >+ </object> >+ <packing> >+ <property name="expand">False</property> >+ <property name="fill">False</property> >+ <property name="position">2</property> >+ </packing> >+ </child> >+ </object> >+ <packing> >+ <property name="expand">True</property> >+ <property name="fill">True</property> >+ <property name="position">1</property> >+ </packing> >+ </child> >+ </object> >+ <packing> >+ <property name="expand">True</property> >+ <property name="fill">True</property> >+ <property name="position">2</property> >+ </packing> >+ </child> > </object> > </child> > </object> >diff --git a/src/terminal-schemas.h b/src/terminal-schemas.h >index ce92340..ae4999f 100644 >--- a/src/terminal-schemas.h >+++ b/src/terminal-schemas.h >@@ -63,6 +63,9 @@ G_BEGIN_DECLS > #define TERMINAL_PROFILE_USE_THEME_COLORS_KEY "use-theme-colors" > #define TERMINAL_PROFILE_VISIBLE_NAME_KEY "visible-name" > >+#define TERMINAL_PROFILE_USE_TRANSPARENT_BACKGROUND "use-transparent-background" >+#define TERMINAL_PROFILE_BACKGROUND_TRANSPARENCY_PERCENT "background-transparency-percent" >+ > #define TERMINAL_SETTING_CONFIRM_CLOSE_KEY "confirm-close" > #define TERMINAL_SETTING_DEFAULT_SHOW_MENUBAR_KEY "default-show-menubar" > #define TERMINAL_SETTING_DARK_THEME_KEY "dark-theme" >diff --git a/src/terminal-screen.c b/src/terminal-screen.c >index e3309f8..7585963 100644 >--- a/src/terminal-screen.c >+++ b/src/terminal-screen.c >@@ -748,7 +748,9 @@ terminal_screen_profile_changed_cb (GSettings *profile, > prop_name == I_(TERMINAL_PROFILE_BACKGROUND_COLOR_KEY) || > prop_name == I_(TERMINAL_PROFILE_BOLD_COLOR_SAME_AS_FG_KEY) || > prop_name == I_(TERMINAL_PROFILE_BOLD_COLOR_KEY) || >- prop_name == I_(TERMINAL_PROFILE_PALETTE_KEY)) >+ prop_name == I_(TERMINAL_PROFILE_PALETTE_KEY) || >+ prop_name == I_(TERMINAL_PROFILE_USE_TRANSPARENT_BACKGROUND) || >+ prop_name == I_(TERMINAL_PROFILE_BACKGROUND_TRANSPARENCY_PERCENT)) > update_color_scheme (screen); > > if (!prop_name || prop_name == I_(TERMINAL_PROFILE_AUDIBLE_BELL_KEY)) >@@ -807,6 +809,7 @@ update_color_scheme (TerminalScreen *screen) > GdkRGBA fg, bg, bold, theme_fg, theme_bg; > GdkRGBA *boldp; > GtkStyleContext *context; >+ gboolean transparent; > > context = gtk_widget_get_style_context (widget); > gtk_style_context_get_color (context, GTK_STATE_FLAG_NORMAL, &theme_fg); >@@ -826,6 +829,17 @@ update_color_scheme (TerminalScreen *screen) > else > boldp = NULL; > >+ transparent = g_settings_get_boolean (profile, TERMINAL_PROFILE_USE_TRANSPARENT_BACKGROUND); >+ if (transparent) >+ { >+ gint transparency_percent; >+ >+ transparency_percent = g_settings_get_int (profile, TERMINAL_PROFILE_BACKGROUND_TRANSPARENCY_PERCENT); >+ bg.alpha = 1.0 - (transparency_percent / 100.0); >+ } >+ else >+ bg.alpha = 1.0; >+ > colors = terminal_g_settings_get_rgba_palette (priv->profile, TERMINAL_PROFILE_PALETTE_KEY, &n_colors); > vte_terminal_set_colors (VTE_TERMINAL (screen), &fg, &bg, > colors, n_colors); >diff --git a/src/terminal-window.c b/src/terminal-window.c >index 90b58d3..c5b5b7d 100644 >--- a/src/terminal-window.c >+++ b/src/terminal-window.c >@@ -1152,6 +1152,23 @@ position_menu_under_widget (GtkMenu *menu, > } > > static void >+terminal_window_update_transparency (TerminalWindow *window) >+{ >+ TerminalWindowPrivate *priv = window->priv; >+ gboolean is_transparent = FALSE; >+ >+ if (priv->active_screen) >+ { >+ GSettings *profile; >+ >+ profile = terminal_screen_get_profile (priv->active_screen); >+ is_transparent = g_settings_get_boolean (profile, TERMINAL_PROFILE_USE_TRANSPARENT_BACKGROUND); >+ } >+ >+ gtk_widget_set_app_paintable (GTK_WIDGET (window), is_transparent); >+} >+ >+static void > terminal_set_profile_toggled_callback (GtkToggleAction *action, > TerminalWindow *window) > { >@@ -1170,6 +1187,8 @@ terminal_set_profile_toggled_callback (GtkToggleAction *action, > g_signal_handlers_block_by_func (priv->active_screen, G_CALLBACK (profile_set_callback), window); > terminal_screen_set_profile (priv->active_screen, profile); > g_signal_handlers_unblock_by_func (priv->active_screen, G_CALLBACK (profile_set_callback), window); >+ >+ terminal_window_update_transparency (window); > } > > static void >@@ -1213,7 +1232,26 @@ profile_visible_name_notify_cb (GSettings *profile, > } > > static void >-disconnect_profiles_from_actions_in_group (GtkActionGroup *action_group) >+profile_background_transparency_notify_cb (GSettings *profile, >+ const char *key, >+ gpointer user_data) >+{ >+ TerminalWindow *window = user_data; >+ TerminalWindowPrivate *priv = window->priv; >+ GSettings *active_profile; >+ >+ if (priv->active_screen) >+ active_profile = terminal_screen_get_profile (priv->active_screen); >+ else >+ active_profile = NULL; >+ >+ if (profile == active_profile) >+ terminal_window_update_transparency (window); >+} >+ >+static void >+disconnect_profiles_from_actions_in_group (TerminalWindow *window, >+ GtkActionGroup *action_group) > { > GList *actions, *l; > >@@ -1228,6 +1266,7 @@ disconnect_profiles_from_actions_in_group (GtkActionGroup *action_group) > continue; > > g_signal_handlers_disconnect_by_func (profile, G_CALLBACK (profile_visible_name_notify_cb), action); >+ g_signal_handlers_disconnect_by_func (profile, G_CALLBACK (profile_background_transparency_notify_cb), window); > } > g_list_free (actions); > } >@@ -1288,7 +1327,7 @@ terminal_window_update_set_profile_menu (TerminalWindow *window) > > if (priv->profiles_action_group != NULL) > { >- disconnect_profiles_from_actions_in_group (priv->profiles_action_group); >+ disconnect_profiles_from_actions_in_group (window, priv->profiles_action_group); > gtk_ui_manager_remove_action_group (priv->ui_manager, > priv->profiles_action_group); > priv->profiles_action_group = NULL; >@@ -1344,6 +1383,8 @@ terminal_window_update_set_profile_menu (TerminalWindow *window) > profile_visible_name_notify_cb (profile, TERMINAL_PROFILE_VISIBLE_NAME_KEY, GTK_ACTION (profile_action)); > g_signal_connect (profile, "changed::" TERMINAL_PROFILE_VISIBLE_NAME_KEY, > G_CALLBACK (profile_visible_name_notify_cb), profile_action); >+ g_signal_connect (profile, "changed::" TERMINAL_PROFILE_USE_TRANSPARENT_BACKGROUND, >+ G_CALLBACK (profile_background_transparency_notify_cb), window); > g_signal_connect (profile_action, "toggled", > G_CALLBACK (terminal_set_profile_toggled_callback), window); > >@@ -1381,6 +1422,8 @@ terminal_window_create_new_terminal_action (TerminalWindow *window, > profile_visible_name_notify_cb (profile, TERMINAL_PROFILE_VISIBLE_NAME_KEY, action); > g_signal_connect (profile, "changed::" TERMINAL_PROFILE_VISIBLE_NAME_KEY, > G_CALLBACK (profile_visible_name_notify_cb), action); >+ g_signal_connect (profile, "changed::" TERMINAL_PROFILE_USE_TRANSPARENT_BACKGROUND, >+ G_CALLBACK (profile_background_transparency_notify_cb), window); > g_signal_connect (action, "activate", callback, window); > > gtk_action_group_add_action (priv->new_terminal_action_group, action); >@@ -1406,7 +1449,7 @@ terminal_window_update_new_terminal_menus (TerminalWindow *window) > > if (priv->new_terminal_action_group != NULL) > { >- disconnect_profiles_from_actions_in_group (priv->new_terminal_action_group); >+ disconnect_profiles_from_actions_in_group (window, priv->new_terminal_action_group); > gtk_ui_manager_remove_action_group (priv->ui_manager, > priv->new_terminal_action_group); > priv->new_terminal_action_group = NULL; >@@ -2180,6 +2223,20 @@ terminal_window_realize (GtkWidget *widget) > } > > static gboolean >+terminal_window_draw (GtkWidget *widget, >+ cairo_t *cr) >+{ >+ GtkStyleContext *context = gtk_widget_get_style_context (widget); >+ int width = gtk_widget_get_allocated_width (widget); >+ int height = gtk_widget_get_allocated_height (widget); >+ >+ gtk_render_background (context, cr, 0, 0, width, height); >+ gtk_render_frame (context, cr, 0, 0, width, height); >+ >+ return GTK_WIDGET_CLASS (terminal_window_parent_class)->draw (widget, cr); >+} >+ >+static gboolean > terminal_window_state_event (GtkWidget *widget, > GdkEventWindowState *event) > { >@@ -2529,6 +2586,8 @@ terminal_window_init (TerminalWindow *window) > TerminalWindowPrivate *priv; > TerminalApp *app; > TerminalSettingsList *profiles_list; >+ GdkScreen *screen; >+ GdkVisual *visual; > GtkActionGroup *action_group; > GtkAction *action; > GtkUIManager *manager; >@@ -2544,6 +2603,11 @@ terminal_window_init (TerminalWindow *window) > > gtk_widget_init_template (GTK_WIDGET (window)); > >+ screen = gtk_widget_get_screen (GTK_WIDGET (window)); >+ visual = gdk_screen_get_rgba_visual (screen); >+ if (visual != NULL) >+ gtk_widget_set_visual (GTK_WIDGET (window), visual); >+ > uuid_generate (u); > uuid_unparse (u, uuidstr); > priv->uuid = g_strdup (uuidstr); >@@ -2709,6 +2773,7 @@ terminal_window_class_init (TerminalWindowClass *klass) > > widget_class->show = terminal_window_show; > widget_class->realize = terminal_window_realize; >+ widget_class->draw = terminal_window_draw; > widget_class->window_state_event = terminal_window_state_event; > widget_class->screen_changed = terminal_window_screen_changed; > widget_class->style_updated = terminal_window_style_updated; >@@ -2749,9 +2814,9 @@ terminal_window_dispose (GObject *object) > } > > if (priv->profiles_action_group != NULL) >- disconnect_profiles_from_actions_in_group (priv->profiles_action_group); >+ disconnect_profiles_from_actions_in_group (window, priv->profiles_action_group); > if (priv->new_terminal_action_group != NULL) >- disconnect_profiles_from_actions_in_group (priv->new_terminal_action_group); >+ disconnect_profiles_from_actions_in_group (window, priv->new_terminal_action_group); > > app = terminal_app_get (); > profiles_list = terminal_app_get_profiles_list (app); >@@ -2869,6 +2934,7 @@ profile_set_callback (TerminalScreen *screen, > return; > > terminal_window_update_set_profile_menu_active_profile (window); >+ terminal_window_update_transparency (window); > } > > static void >@@ -3245,6 +3311,7 @@ mdi_screen_switched_cb (TerminalMdiContainer *container, > terminal_window_update_copy_sensitivity (screen, window); > terminal_window_update_zoom_sensitivity (window); > terminal_window_update_search_sensitivity (screen, window); >+ terminal_window_update_transparency (window); > } > > static void
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 1111136
:
910342
| 933688