[gimp/wip/Jehan/issue-498-quick-brush-edit: 164/164] app: stop alt-right click brush size change when releasing Alt first.




commit ed6b167f4ec4c54a6e077f5b8bbd774ad569c1bd
Author: Jehan <jehan girinstud io>
Date:   Tue Feb 15 12:18:42 2022 +0100

    app: stop alt-right click brush size change when releasing Alt first.
    
    Until now, it was only stopiing when releasing right click, but it's
    actually more accurate when releasing the Alt key first as the button is
    on the mouse/stylus (so releasing it can provoke small hand moves,
    especially visible with stylus, I think). Now it stops whatever is
    released first.

 app/display/gimpdisplayshell-tool-events.c | 19 ++++++++++++-------
 1 file changed, 12 insertions(+), 7 deletions(-)
---
diff --git a/app/display/gimpdisplayshell-tool-events.c b/app/display/gimpdisplayshell-tool-events.c
index 3da66e585d..c9d65d9ce8 100644
--- a/app/display/gimpdisplayshell-tool-events.c
+++ b/app/display/gimpdisplayshell-tool-events.c
@@ -536,7 +536,6 @@ gimp_display_shell_canvas_tool_events (GtkWidget        *canvas,
               }
             else if (mod_state == GDK_MOD1_MASK)
               {
-                shell->mod1_settings = TRUE;
                 gimp_display_shell_start_scrolling (shell, event, state,
                                                     bevent->x, bevent->y);
               }
@@ -1101,15 +1100,21 @@ gimp_display_shell_canvas_tool_events (GtkWidget        *canvas,
 
         active_tool = tool_manager_get_active (gimp);
 
-        if (gimp_display_shell_key_to_state (kevent->keyval) == GDK_MOD1_MASK &&
-            shell->picked_layer)
+        if (gimp_display_shell_key_to_state (kevent->keyval) == GDK_MOD1_MASK)
           {
-            GimpStatusbar *statusbar;
+            if (shell->picked_layer)
+              {
+                GimpStatusbar *statusbar;
 
-            statusbar = gimp_display_shell_get_statusbar (shell);
-            gimp_statusbar_pop_temp (statusbar);
+                statusbar = gimp_display_shell_get_statusbar (shell);
+                gimp_statusbar_pop_temp (statusbar);
 
-            shell->picked_layer = NULL;
+                shell->picked_layer = NULL;
+              }
+            else if (shell->mod1_settings)
+              {
+                gimp_display_shell_stop_scrolling (shell, event);
+              }
           }
 
         if ((state & GDK_BUTTON1_MASK)      &&


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