diff options
author | B. Stack <bgstack15@gmail.com> | 2021-08-18 15:24:42 -0400 |
---|---|---|
committer | B. Stack <bgstack15@gmail.com> | 2021-08-18 15:24:42 -0400 |
commit | 76447c4a5b6c31f9aec0834353e017eeae77f9c4 (patch) | |
tree | ec9b6ee857805269eae8a63ea89acf3e1bf3a21f /csd__clean-headerbar.patch | |
parent | Update to 3.24.29 (diff) | |
download | gtk3-classic-build-gtk3-76447c4a5b6c31f9aec0834353e017eeae77f9c4.tar.gz gtk3-classic-build-gtk3-76447c4a5b6c31f9aec0834353e017eeae77f9c4.tar.bz2 gtk3-classic-build-gtk3-76447c4a5b6c31f9aec0834353e017eeae77f9c4.zip |
3.24.29 for fc33
Diffstat (limited to 'csd__clean-headerbar.patch')
-rw-r--r-- | csd__clean-headerbar.patch | 82 |
1 files changed, 82 insertions, 0 deletions
diff --git a/csd__clean-headerbar.patch b/csd__clean-headerbar.patch new file mode 100644 index 0000000..09612d4 --- /dev/null +++ b/csd__clean-headerbar.patch @@ -0,0 +1,82 @@ +Index: b/gtk/gtkheaderbar.c +=================================================================== +--- a/gtk/gtkheaderbar.c ++++ b/gtk/gtkheaderbar.c +@@ -300,6 +300,27 @@ _gtk_header_bar_update_window_buttons (G + + priv->titlebar_icon = NULL; + ++ gboolean csd_cleaned_headerbar = (!gtk_style_context_has_class (gtk_widget_get_style_context (toplevel), "csd") && ++ !gtk_style_context_has_class (gtk_widget_get_style_context (toplevel), "solid-csd")); ++ if (csd_cleaned_headerbar) ++ { ++ if (priv->label_box != NULL) ++ { ++ priv->label_box = NULL; ++ priv->title_label = NULL; ++ priv->subtitle_label = NULL; ++ } ++ static gboolean style_added = FALSE; ++ if (!style_added) ++ { ++ style_added = TRUE; ++ GtkCssProvider *provider = gtk_css_provider_new (); ++ gtk_css_provider_load_from_data (provider, ++ "headerbar, .titlebar { border-radius: 0; border-top: 0; box-shadow: none; }", -1, NULL); ++ gtk_style_context_add_provider_for_screen (gtk_widget_get_screen (widget), ++ GTK_STYLE_PROVIDER (provider), GTK_STYLE_PROVIDER_PRIORITY_APPLICATION); ++ } ++ } + if (!priv->shows_wm_decorations) + return; + +@@ -327,6 +348,8 @@ _gtk_header_bar_update_window_buttons (G + gtk_window_get_transient_for (window) == NULL && + gtk_window_get_type_hint (window) == GDK_WINDOW_TYPE_HINT_NORMAL); + ++ if (csd_cleaned_headerbar) ++ layout_desc = strstr (layout_desc, "menu") ? g_strdup ("menu") : g_strdup (""); + tokens = g_strsplit (layout_desc, ":", 2); + if (tokens) + { +@@ -391,9 +414,9 @@ _gtk_header_bar_update_window_buttons (G + atk_object_set_name (accessible, _("Application menu")); + + priv->titlebar_icon = image; +- if (!_gtk_header_bar_update_window_icon (bar, window)) ++ if (csd_cleaned_headerbar || !_gtk_header_bar_update_window_icon (bar, window)) + gtk_image_set_from_icon_name (GTK_IMAGE (priv->titlebar_icon), +- "application-x-executable-symbolic", GTK_ICON_SIZE_MENU); ++ "pan-down-symbolic", GTK_ICON_SIZE_MENU); + } + else if (strcmp (t[j], "minimize") == 0 && + is_sovereign_window) +@@ -1361,6 +1384,7 @@ gtk_header_bar_set_subtitle (GtkHeaderBa + gtk_widget_set_visible (priv->subtitle_sizing_label, priv->has_subtitle || (priv->subtitle && priv->subtitle[0])); + + g_object_notify_by_pspec (G_OBJECT (bar), header_bar_props[PROP_SUBTITLE]); ++ g_object_notify_by_pspec (G_OBJECT (bar), header_bar_props[PROP_TITLE]); + } + + /** +Index: b/gtk/gtkwindow.c +=================================================================== +--- a/gtk/gtkwindow.c ++++ b/gtk/gtkwindow.c +@@ -4174,6 +4174,8 @@ on_titlebar_title_notify (GtkHeaderBar * + const gchar *title; + + title = gtk_header_bar_get_title (titlebar); ++ if (gtk_header_bar_get_subtitle (titlebar)) ++ title = g_strconcat (title, " — ", gtk_header_bar_get_subtitle (titlebar), NULL); + gtk_window_set_title_internal (self, title, FALSE); + } + +@@ -9366,6 +9368,7 @@ static void + gtk_window_do_popup (GtkWindow *window, + GdkEventButton *event) + { ++ if (!window->priv->client_decorated) return; + if (!gdk_window_show_window_menu (_gtk_widget_get_window (GTK_WIDGET (window)), + (GdkEvent *) event)) + gtk_window_do_popup_fallback (window, event); |