From 25145e4131e731baf323476df27fea443cdde014 Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: Tue, 28 Apr 2020 05:42:29 -0400 Subject: [PATCH] import gtk3-3.22.30-5.el8 --- ...-Add-a-gtk-overlay-scrolling-setting.patch | 79 +++++++++++++++++++ ...ow-respect-overlay-scrolling-setting.patch | 50 ++++++++++++ SPECS/gtk3.spec | 10 ++- 3 files changed, 138 insertions(+), 1 deletion(-) create mode 100644 SOURCES/0001-Add-a-gtk-overlay-scrolling-setting.patch create mode 100644 SOURCES/0002-scrolled-window-respect-overlay-scrolling-setting.patch diff --git a/SOURCES/0001-Add-a-gtk-overlay-scrolling-setting.patch b/SOURCES/0001-Add-a-gtk-overlay-scrolling-setting.patch new file mode 100644 index 0000000..8047d8b --- /dev/null +++ b/SOURCES/0001-Add-a-gtk-overlay-scrolling-setting.patch @@ -0,0 +1,79 @@ +From 044383fe4533c59a0bbd58c977ed2ba5fb5862b8 Mon Sep 17 00:00:00 2001 +From: Matthias Clasen +Date: Fri, 31 May 2019 11:46:19 -0400 +Subject: [PATCH 1/2] Add a gtk-overlay-scrolling setting + +This is in preparation for letting user opt out of +overlay scrolling in the control-center. +--- + gdk/wayland/gdkscreen-wayland.c | 2 +- + gdk/x11/gdksettings.c | 1 + + gtk/gtksettings.c | 21 ++++++++++++++++++++- + 3 files changed, 22 insertions(+), 2 deletions(-) + +diff --git a/gdk/wayland/gdkscreen-wayland.c b/gdk/wayland/gdkscreen-wayland.c +index 6aff3a5a1a..5e156072f2 100644 +--- a/gdk/wayland/gdkscreen-wayland.c ++++ b/gdk/wayland/gdkscreen-wayland.c +@@ -502,6 +502,7 @@ static TranslationEntry translations[] = { + { FALSE, "org.gnome.desktop.interface", "gtk-im-module", "gtk-im-module", G_TYPE_STRING, { .s = "simple" } }, + { FALSE, "org.gnome.desktop.interface", "enable-animations", "gtk-enable-animations", G_TYPE_BOOLEAN, { .b = TRUE } }, + { FALSE, "org.gnome.desktop.interface", "gtk-enable-primary-paste", "gtk-enable-primary-paste", G_TYPE_BOOLEAN, { .b = TRUE } }, ++ { FALSE, "org.gnome.desktop.interface", "overlay-scrolling", "gtk-overlay-scrolling", G_TYPE_BOOLEAN, { .b = TRUE } }, + { FALSE, "org.gnome.settings-daemon.peripherals.mouse", "double-click", "gtk-double-click-time", G_TYPE_INT, { .i = 400 } }, + { FALSE, "org.gnome.settings-daemon.peripherals.mouse", "drag-threshold", "gtk-dnd-drag-threshold", G_TYPE_INT, {.i = 8 } }, + { FALSE, "org.gnome.desktop.sound", "theme-name", "gtk-sound-theme-name", G_TYPE_STRING, { .s = "freedesktop" } }, +diff --git a/gdk/x11/gdksettings.c b/gdk/x11/gdksettings.c +index f8bb6d896b..869c239b18 100644 +--- a/gdk/x11/gdksettings.c ++++ b/gdk/x11/gdksettings.c +@@ -69,6 +69,7 @@ static const struct { + {"Gtk/RecentFilesMaxAge", "gtk-recent-files-max-age"}, + {"Gtk/RecentFilesEnabled", "gtk-recent-files-enabled"}, + {"Gtk/KeynavUseCaret", "gtk-keynav-use-caret"}, ++ {"Gtk/OverlayScrolling", "gtk-overlay-scrolling"}, + + /* These are here in order to be recognized, but are not sent to + gtk as they are handled internally by gdk: */ +diff --git a/gtk/gtksettings.c b/gtk/gtksettings.c +index 571ae11cd4..b83d9d5561 100644 +--- a/gtk/gtksettings.c ++++ b/gtk/gtksettings.c +@@ -224,7 +224,8 @@ enum { + PROP_ENABLE_PRIMARY_PASTE, + PROP_RECENT_FILES_ENABLED, + PROP_LONG_PRESS_TIME, +- PROP_KEYNAV_USE_CARET ++ PROP_KEYNAV_USE_CARET, ++ PROP_OVERLAY_SCROLLING + }; + + /* --- prototypes --- */ +@@ -1767,6 +1768,24 @@ gtk_settings_class_init (GtkSettingsClass *class) + GTK_PARAM_READWRITE), + NULL); + g_assert (result == PROP_KEYNAV_USE_CARET); ++ ++ /** ++ * GtkSettings:gtk-overlay-scrolling: ++ * ++ * Whether scrolled windows may use overlayed scrolling indicators. ++ * If this is set to %FALSE, scrolled windows will have permanent ++ * scrollbars. ++ * ++ * Since: 3.24.9 ++ */ ++ result = settings_install_property_parser (class, ++ g_param_spec_boolean ("gtk-overlay-scrolling", ++ P_("Whether to use overlay scrollbars"), ++ P_("Whether to use overlay scrollbars"), ++ TRUE, ++ GTK_PARAM_READWRITE), ++ NULL); ++ g_assert (result == PROP_OVERLAY_SCROLLING); + } + + static void +-- +2.23.0 + diff --git a/SOURCES/0002-scrolled-window-respect-overlay-scrolling-setting.patch b/SOURCES/0002-scrolled-window-respect-overlay-scrolling-setting.patch new file mode 100644 index 0000000..e62b8e8 --- /dev/null +++ b/SOURCES/0002-scrolled-window-respect-overlay-scrolling-setting.patch @@ -0,0 +1,50 @@ +From 26b24916c8570a73bdc9d7a736584ceb68384c81 Mon Sep 17 00:00:00 2001 +From: Matthias Clasen +Date: Fri, 31 May 2019 11:51:20 -0400 +Subject: [PATCH 2/2] scrolled window: respect overlay-scrolling setting + +If the gtk-overlay-scrolling setting is FALSE, +don't use overlay scrollbars. +--- + gtk/gtkscrolledwindow.c | 10 +++++++++- + 1 file changed, 9 insertions(+), 1 deletion(-) + +diff --git a/gtk/gtkscrolledwindow.c b/gtk/gtkscrolledwindow.c +index d52ccf646c..b2dc1d1c79 100644 +--- a/gtk/gtkscrolledwindow.c ++++ b/gtk/gtkscrolledwindow.c +@@ -704,6 +704,9 @@ gtk_scrolled_window_class_init (GtkScrolledWindowClass *class) + * is present. Otherwise, they are overlayed on top of the content, + * as narrow indicators. + * ++ * Note that overlay scrolling can also be globally disabled, with ++ * the #GtkSettings::gtk-overlay-scrolling setting. ++ * + * Since: 3.16 + */ + properties[PROP_OVERLAY_SCROLLING] = +@@ -4163,6 +4166,7 @@ gtk_scrolled_window_map (GtkWidget *widget) + GTK_WIDGET_CLASS (gtk_scrolled_window_parent_class)->map (widget); + + gtk_scrolled_window_update_animating (scrolled_window); ++ gtk_scrolled_window_update_use_indicators (scrolled_window); + } + + static void +@@ -4439,8 +4443,12 @@ gtk_scrolled_window_update_use_indicators (GtkScrolledWindow *scrolled_window) + { + GtkScrolledWindowPrivate *priv = scrolled_window->priv; + gboolean use_indicators; ++ GtkSettings *settings = gtk_widget_get_settings (GTK_WIDGET (scrolled_window)); ++ gboolean overlay_scrolling; ++ ++ g_object_get (settings, "gtk-overlay-scrolling", &overlay_scrolling, NULL); + +- use_indicators = priv->overlay_scrolling; ++ use_indicators = overlay_scrolling && priv->overlay_scrolling; + + if (g_strcmp0 (g_getenv ("GTK_OVERLAY_SCROLLING"), "0") == 0) + use_indicators = FALSE; +-- +2.23.0 + diff --git a/SPECS/gtk3.spec b/SPECS/gtk3.spec index d5a57d6..35ab417 100644 --- a/SPECS/gtk3.spec +++ b/SPECS/gtk3.spec @@ -22,7 +22,7 @@ Name: gtk3 Version: 3.22.30 -Release: 4%{?dist} +Release: 5%{?dist} Summary: GTK+ graphical user interface library License: LGPLv2+ @@ -34,6 +34,9 @@ Patch1: 0001-a11y-Check-X11-display-at-runtime.patch Patch2: 0001-a11y-Check-display-in-grab_cell_focus.patch # ehbz#1723836 Patch3: 0001-a11y-Include-window-management-buttons-in-headerbar.patch +# rhbz#1736742 +Patch4: 0001-Add-a-gtk-overlay-scrolling-setting.patch +Patch5: 0002-scrolled-window-respect-overlay-scrolling-setting.patch BuildRequires: pkgconfig(atk) >= %{atk_version} BuildRequires: pkgconfig(atk-bridge-2.0) @@ -176,6 +179,8 @@ the functionality of the installed %{name} package. %patch1 -p1 %patch2 -p1 %patch3 -p1 +%patch4 -p1 +%patch5 -p1 %build export CFLAGS='-fno-strict-aliasing %optflags' @@ -334,6 +339,9 @@ gtk-query-immodules-3.0-%{__isa_bits} --update-cache &>/dev/null || : %{_datadir}/installed-tests %changelog +* Thu Nov 21 2019 Benjamin Otte - 3.22.30-5 +- Add setting for turning off overlay scrollbars (rhbz#1736742) + * Thu Aug 15 2019 Benjamin Otte - 3.22.30-4 - Include headerbar buttons in accessibility (rhbz#1723836)