[gimp/wip/Jehan/layers-dockable-refresh: 61/126] app, libgimp: disable transition for all GtkPopover code we have.




commit 44d503439adf91dc03b566a64b9ceb38c7df88a1
Author: Jehan <jehan girinstud io>
Date:   Wed Feb 10 21:58:23 2021 +0100

    app, libgimp: disable transition for all GtkPopover code we have.
    
    This popping-up|down transition code is so utterly broken that it's
    unusable. Anyone working with fast pace will encounter broken behavior
    where the popup will not appear unless you click a second time, or not
    disappearing immediately, displayed like a ghost of itself (feels like
    a widget exposition bug even). So let's just disable it everywhere.
    
    So I don't care it's marked as deprecated already, this widget is not
    usable without disabling this transitional logics.
    
    I'm not using gtk_popover_set_transitions_enabled() because it will
    produce build warnings unlike setting the property directly.

 app/widgets/gimpitemtreeview.c  | 14 ++++++++++++++
 app/widgets/gimplayertreeview.c |  5 ++++-
 libgimp/gimpproceduredialog.c   |  3 +++
 3 files changed, 21 insertions(+), 1 deletion(-)
---
diff --git a/app/widgets/gimpitemtreeview.c b/app/widgets/gimpitemtreeview.c
index ab23893855..5e331ea2a2 100644
--- a/app/widgets/gimpitemtreeview.c
+++ b/app/widgets/gimpitemtreeview.c
@@ -558,6 +558,20 @@ gimp_item_tree_view_constructed (GObject *object)
   /* Lock popover. */
   item_view->priv->lock_popover = gtk_popover_new (GTK_WIDGET (tree_view->view));
   gtk_popover_set_modal (GTK_POPOVER (item_view->priv->lock_popover), TRUE);
+  /* This property is marked as deprecated in GTK already at time when I
+   * first wrote this code. Yet the whole transition delaying code is
+   * utterly broken. When working on fast pace, we end up with a popup
+   * which won't disappear before a second, or the opposite, a popup
+   * which refuses to pop up forcing you to click a second time. It just
+   * feels completely broken, yet it's apparently not a bug, only some
+   * weird design decision to make some kind of transitional animation.
+   * We can fix some of these broken behavior in our code by using
+   * gtk_widget_show|hide() instead of gtk_popover_popup|down() but this
+   * deprecated function is necessary for all the GTK internal calls.
+   */
+  g_object_set (item_view->priv->lock_popover,
+                "transitions-enabled", TRUE,
+                NULL);
   g_signal_connect (item_view->priv->lock_popover,
                     "button-press-event",
                     G_CALLBACK (gimp_item_tree_view_popover_button_press),
diff --git a/app/widgets/gimplayertreeview.c b/app/widgets/gimplayertreeview.c
index ba7fbbf852..1aa7262ded 100644
--- a/app/widgets/gimplayertreeview.c
+++ b/app/widgets/gimplayertreeview.c
@@ -448,6 +448,9 @@ gimp_layer_tree_view_constructed (GObject *object)
 
   layer_view->priv->link_popover = gtk_popover_new (layer_view->priv->link_button);
   gtk_popover_set_modal (GTK_POPOVER (layer_view->priv->link_popover), TRUE);
+  g_object_set (layer_view->priv->link_popover,
+                "transitions-enabled", TRUE,
+                NULL);
   gtk_menu_button_set_popover (GTK_MENU_BUTTON (layer_view->priv->link_button),
                                layer_view->priv->link_popover);
 
@@ -1314,7 +1317,7 @@ static void
 gimp_layer_tree_view_new_link_exit (GimpLayerTreeView *view)
 {
   if (gimp_layer_tree_view_new_link_clicked (view))
-    gtk_popover_popdown (GTK_POPOVER (view->priv->link_popover));
+    gtk_widget_hide (view->priv->link_popover);
 }
 
 static gboolean
diff --git a/libgimp/gimpproceduredialog.c b/libgimp/gimpproceduredialog.c
index 9a2a032d43..17ad525e26 100644
--- a/libgimp/gimpproceduredialog.c
+++ b/libgimp/gimpproceduredialog.c
@@ -1654,6 +1654,9 @@ gimp_procedure_dialog_run (GimpProcedureDialog *dialog)
                                                            response);
 
               dialog->priv->reset_popover = gtk_popover_new (button);
+              g_object_set (dialog->priv->reset_popover,
+                            "transitions-enabled", TRUE,
+                            NULL);
 
               vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 4);
               gtk_container_set_border_width (GTK_CONTAINER (vbox), 4);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]