[gimp/gimp-2-10] app: increase idle priority for hiding on-hover tool-group menu



commit 3212da715b09d79535e2287706ffac2e7579f75e
Author: Ell <ell_se yahoo com>
Date:   Sun Jun 28 12:05:28 2020 +0300

    app: increase idle priority for hiding on-hover tool-group menu
    
    In GimpToolButton, when in "show menu on hover" mode, increase the
    idle priority for hiding the the tool-group menu upon button/menu
    leave-notify.  Make the priority one step below the normal event
    priority, so that a subsequent button/menu enter-notify event
    canceling the idle is processed beforehand, while the idle is
    otherwise still processed before ordinary lower-priority sources,
    in particular, before projection rendering timeouts.

 app/widgets/gimptoolbutton.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)
---
diff --git a/app/widgets/gimptoolbutton.c b/app/widgets/gimptoolbutton.c
index e18dd09d7e..d5d8587f8b 100644
--- a/app/widgets/gimptoolbutton.c
+++ b/app/widgets/gimptoolbutton.c
@@ -711,9 +711,10 @@ gimp_tool_button_leave_notify (GtkWidget        *widget,
         {
           if (! tool_button->priv->menu_idle_id)
             {
-              tool_button->priv->menu_idle_id = g_idle_add (
+              tool_button->priv->menu_idle_id = g_idle_add_full (
+                G_PRIORITY_DEFAULT + 1,
                 (GSourceFunc) gimp_tool_button_menu_idle,
-                tool_button);
+                tool_button, NULL);
             }
         }
       else
@@ -948,9 +949,10 @@ gimp_tool_button_menu_leave_notify (GtkMenu          *menu,
       if (tool_button->priv->show_menu_on_hover &&
           ! tool_button->priv->menu_idle_id)
         {
-          tool_button->priv->menu_idle_id = g_idle_add (
+          tool_button->priv->menu_idle_id = g_idle_add_full (
+            G_PRIORITY_DEFAULT + 1,
             (GSourceFunc) gimp_tool_button_menu_idle,
-            tool_button);
+            tool_button, NULL);
         }
     }
 


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