aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPřemysl Eric Janouch <p@janouch.name>2022-01-07 07:27:33 +0100
committerPřemysl Eric Janouch <p@janouch.name>2022-01-07 07:28:05 +0100
commitfc559c3d0152c8adcb6cc01166951456b588069a (patch)
tree2e4f35c16829375cf8ef30c829851682a927af4a
parent6869816cc4ab1330645044dabc6b3bfc6844e553 (diff)
downloadfiv-fc559c3d0152c8adcb6cc01166951456b588069a.tar.gz
fiv-fc559c3d0152c8adcb6cc01166951456b588069a.tar.xz
fiv-fc559c3d0152c8adcb6cc01166951456b588069a.zip
Work around an annoying GTK+ issue
-rw-r--r--fiv-sidebar.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/fiv-sidebar.c b/fiv-sidebar.c
index 1e901cc..ec5898c 100644
--- a/fiv-sidebar.c
+++ b/fiv-sidebar.c
@@ -54,15 +54,28 @@ fiv_sidebar_dispose(GObject *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.