From 99911c3fcfe820a92ff77a15e1be61bc35e71eaa Mon Sep 17 00:00:00 2001 From: Julian Sparber Date: Wed, 14 Sep 2022 12:11:40 +0200 Subject: [PATCH] sidebar: Fix oscillating scrollbar when hovered at the right place This is a hack to fix this till the upstream bug is resolved. See: https://gitlab.gnome.org/GNOME/gtk/-/issues/4938 Fixes: https://gitlab.gnome.org/GNOME/fractal/-/issues/925 --- data/resources/ui/sidebar.ui | 2 +- src/session/sidebar/mod.rs | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/data/resources/ui/sidebar.ui b/data/resources/ui/sidebar.ui index 2f3eb9b8..69b31d73 100644 --- a/data/resources/ui/sidebar.ui +++ b/data/resources/ui/sidebar.ui @@ -148,7 +148,7 @@ - + True never diff --git a/src/session/sidebar/mod.rs b/src/session/sidebar/mod.rs index 843951fc..a32f4cac 100644 --- a/src/session/sidebar/mod.rs +++ b/src/session/sidebar/mod.rs @@ -60,6 +60,8 @@ mod imp { #[template_child] pub headerbar: TemplateChild, #[template_child] + pub scrolled_window: TemplateChild, + #[template_child] pub listview: TemplateChild, #[template_child] pub room_search_entry: TemplateChild, @@ -259,6 +261,13 @@ mod imp { btn.set_popover(Some(account_switcher)); } })); + + // FIXME: Remove this hack once https://gitlab.gnome.org/GNOME/gtk/-/issues/4938 is resolved + self.scrolled_window + .vscrollbar() + .first_child() + .unwrap() + .set_overflow(gtk::Overflow::Hidden); } }