From fc559c3d0152c8adcb6cc01166951456b588069a Mon Sep 17 00:00:00 2001 From: Přemysl Eric Janouch Date: Fri, 7 Jan 2022 07:27:33 +0100 Subject: Work around an annoying GTK+ issue --- fiv-sidebar.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/fiv-sidebar.c b/fiv-sidebar.c index 1e901cc..ec5898c 100644 --- a/fiv-sidebar.c +++ b/fiv-sidebar.c @@ -53,16 +53,29 @@ fiv_sidebar_dispose(GObject *gobject) G_OBJECT_CLASS(fiv_sidebar_parent_class)->dispose(gobject); } +static void +fiv_sidebar_realize(GtkWidget *widget) +{ + GTK_WIDGET_CLASS(fiv_sidebar_parent_class)->realize(widget); + + // Fucking GTK+. With no bookmarks, the revealer takes up space anyway. + FivSidebar *self = FIV_SIDEBAR(widget); + gtk_places_sidebar_set_drop_targets_visible(self->places, TRUE, NULL); + gtk_places_sidebar_set_drop_targets_visible(self->places, FALSE, NULL); +} + static void fiv_sidebar_class_init(FivSidebarClass *klass) { GObjectClass *object_class = G_OBJECT_CLASS(klass); object_class->dispose = fiv_sidebar_dispose; + GtkWidgetClass *widget_class = GTK_WIDGET_CLASS(klass); + widget_class->realize = fiv_sidebar_realize; + // You're giving me no choice, Adwaita. // Your style is hardcoded to match against the class' CSS name. // And I need replicate the internal widget structure. - GtkWidgetClass *widget_class = GTK_WIDGET_CLASS(klass); gtk_widget_class_set_css_name(widget_class, "placessidebar"); // TODO(p): Consider a return value, and using it. -- cgit v1.2.3-70-g09d2