|
|
9c78e9 |
From 044383fe4533c59a0bbd58c977ed2ba5fb5862b8 Mon Sep 17 00:00:00 2001
|
|
|
9c78e9 |
From: Matthias Clasen <mclasen@redhat.com>
|
|
|
9c78e9 |
Date: Fri, 31 May 2019 11:46:19 -0400
|
|
|
9c78e9 |
Subject: [PATCH 1/2] Add a gtk-overlay-scrolling setting
|
|
|
9c78e9 |
|
|
|
9c78e9 |
This is in preparation for letting user opt out of
|
|
|
9c78e9 |
overlay scrolling in the control-center.
|
|
|
9c78e9 |
---
|
|
|
9c78e9 |
gdk/wayland/gdkscreen-wayland.c | 2 +-
|
|
|
9c78e9 |
gdk/x11/gdksettings.c | 1 +
|
|
|
9c78e9 |
gtk/gtksettings.c | 21 ++++++++++++++++++++-
|
|
|
9c78e9 |
3 files changed, 22 insertions(+), 2 deletions(-)
|
|
|
9c78e9 |
|
|
|
9c78e9 |
diff --git a/gdk/wayland/gdkscreen-wayland.c b/gdk/wayland/gdkscreen-wayland.c
|
|
|
9c78e9 |
index 6aff3a5a1a..5e156072f2 100644
|
|
|
9c78e9 |
--- a/gdk/wayland/gdkscreen-wayland.c
|
|
|
9c78e9 |
+++ b/gdk/wayland/gdkscreen-wayland.c
|
|
|
9c78e9 |
@@ -502,6 +502,7 @@ static TranslationEntry translations[] = {
|
|
|
9c78e9 |
{ FALSE, "org.gnome.desktop.interface", "gtk-im-module", "gtk-im-module", G_TYPE_STRING, { .s = "simple" } },
|
|
|
9c78e9 |
{ FALSE, "org.gnome.desktop.interface", "enable-animations", "gtk-enable-animations", G_TYPE_BOOLEAN, { .b = TRUE } },
|
|
|
9c78e9 |
{ FALSE, "org.gnome.desktop.interface", "gtk-enable-primary-paste", "gtk-enable-primary-paste", G_TYPE_BOOLEAN, { .b = TRUE } },
|
|
|
9c78e9 |
+ { FALSE, "org.gnome.desktop.interface", "overlay-scrolling", "gtk-overlay-scrolling", G_TYPE_BOOLEAN, { .b = TRUE } },
|
|
|
9c78e9 |
{ FALSE, "org.gnome.settings-daemon.peripherals.mouse", "double-click", "gtk-double-click-time", G_TYPE_INT, { .i = 400 } },
|
|
|
9c78e9 |
{ FALSE, "org.gnome.settings-daemon.peripherals.mouse", "drag-threshold", "gtk-dnd-drag-threshold", G_TYPE_INT, {.i = 8 } },
|
|
|
9c78e9 |
{ FALSE, "org.gnome.desktop.sound", "theme-name", "gtk-sound-theme-name", G_TYPE_STRING, { .s = "freedesktop" } },
|
|
|
9c78e9 |
diff --git a/gdk/x11/gdksettings.c b/gdk/x11/gdksettings.c
|
|
|
9c78e9 |
index f8bb6d896b..869c239b18 100644
|
|
|
9c78e9 |
--- a/gdk/x11/gdksettings.c
|
|
|
9c78e9 |
+++ b/gdk/x11/gdksettings.c
|
|
|
9c78e9 |
@@ -69,6 +69,7 @@ static const struct {
|
|
|
9c78e9 |
{"Gtk/RecentFilesMaxAge", "gtk-recent-files-max-age"},
|
|
|
9c78e9 |
{"Gtk/RecentFilesEnabled", "gtk-recent-files-enabled"},
|
|
|
9c78e9 |
{"Gtk/KeynavUseCaret", "gtk-keynav-use-caret"},
|
|
|
9c78e9 |
+ {"Gtk/OverlayScrolling", "gtk-overlay-scrolling"},
|
|
|
9c78e9 |
|
|
|
9c78e9 |
/* These are here in order to be recognized, but are not sent to
|
|
|
9c78e9 |
gtk as they are handled internally by gdk: */
|
|
|
9c78e9 |
diff --git a/gtk/gtksettings.c b/gtk/gtksettings.c
|
|
|
9c78e9 |
index 571ae11cd4..b83d9d5561 100644
|
|
|
9c78e9 |
--- a/gtk/gtksettings.c
|
|
|
9c78e9 |
+++ b/gtk/gtksettings.c
|
|
|
9c78e9 |
@@ -224,7 +224,8 @@ enum {
|
|
|
9c78e9 |
PROP_ENABLE_PRIMARY_PASTE,
|
|
|
9c78e9 |
PROP_RECENT_FILES_ENABLED,
|
|
|
9c78e9 |
PROP_LONG_PRESS_TIME,
|
|
|
9c78e9 |
- PROP_KEYNAV_USE_CARET
|
|
|
9c78e9 |
+ PROP_KEYNAV_USE_CARET,
|
|
|
9c78e9 |
+ PROP_OVERLAY_SCROLLING
|
|
|
9c78e9 |
};
|
|
|
9c78e9 |
|
|
|
9c78e9 |
/* --- prototypes --- */
|
|
|
9c78e9 |
@@ -1767,6 +1768,24 @@ gtk_settings_class_init (GtkSettingsClass *class)
|
|
|
9c78e9 |
GTK_PARAM_READWRITE),
|
|
|
9c78e9 |
NULL);
|
|
|
9c78e9 |
g_assert (result == PROP_KEYNAV_USE_CARET);
|
|
|
9c78e9 |
+
|
|
|
9c78e9 |
+ /**
|
|
|
9c78e9 |
+ * GtkSettings:gtk-overlay-scrolling:
|
|
|
9c78e9 |
+ *
|
|
|
9c78e9 |
+ * Whether scrolled windows may use overlayed scrolling indicators.
|
|
|
9c78e9 |
+ * If this is set to %FALSE, scrolled windows will have permanent
|
|
|
9c78e9 |
+ * scrollbars.
|
|
|
9c78e9 |
+ *
|
|
|
9c78e9 |
+ * Since: 3.24.9
|
|
|
9c78e9 |
+ */
|
|
|
9c78e9 |
+ result = settings_install_property_parser (class,
|
|
|
9c78e9 |
+ g_param_spec_boolean ("gtk-overlay-scrolling",
|
|
|
9c78e9 |
+ P_("Whether to use overlay scrollbars"),
|
|
|
9c78e9 |
+ P_("Whether to use overlay scrollbars"),
|
|
|
9c78e9 |
+ TRUE,
|
|
|
9c78e9 |
+ GTK_PARAM_READWRITE),
|
|
|
9c78e9 |
+ NULL);
|
|
|
9c78e9 |
+ g_assert (result == PROP_OVERLAY_SCROLLING);
|
|
|
9c78e9 |
}
|
|
|
9c78e9 |
|
|
|
9c78e9 |
static void
|
|
|
9c78e9 |
--
|
|
|
9c78e9 |
2.23.0
|
|
|
9c78e9 |
|