Jump to content

Tools shortcut keys stop working due to incorrect Colors window field focus handling


Recommended Posts

Prompted by this slightly confusing report https://forums.getpaint.net/topic/125342-cursor-selects-value-on-clicking-color-window I have been able to find a set of steps to reproduce the problem of the Tools shortcuts not working after the user interacts with the Colors window in a particular way.

Expected Behaviour

After clicking on the Color Wheel or on other parts of the Colors window, the Tools shortcut keys should always still work.

 

Actual Behaviour

After interacting with the Colors window in the way described in 'Steps to demonstrate incorrect behaviour' below, focus is wrongly given to one of the color entry fields, which results in the Tools shortcut keys no longer working until the user clicks on the Canvas/Editing Window.


Version tested 5.0.12 on Windows 11

 

Steps to demonstrate CORRECT behaviour:

 

Initial Setup
1. Run paint.net and display the Tools window, and the Colors window in its expanded state.

2. Close paint.net

3. Run paint.net again. The Tools & Colors windows are displayed at startup.

 - As expected, none of the entry fields (i.e R, G, B, H, S, V, Alpha) has focus.

 - As expected, pressing the Tools shortcut keys S and G swaps between the Rectangle Select and Gradient tools.

 

Repro Steps

1.  Click in one of the color entry fields (for example the R field).

 - The R field is given focus as shown by the blue underline on Windows 11 (or blue outline Windows 10).

2. Click in the Color Wheel (or anywhere else in the Colors window)

 - The R field no longer has focus

3. Press the Tools shortcut keys S and G

 - As expected, the active tool swaps between the Rectangle Select and Gradient tools.

 


Steps to demonstrate INCORRECT behaviour:

 

Initial Setup

Follow the same Initial Setup steps as described above.

 

Repro Steps

1.  Click the :WindowColors: icon to hide the Colors window.

2.  Click the :WindowColors: icon to display the Colors window.  It is the act of redisplaying the Colors window that triggers the bug.

3. Click in one of the color entry fields (for example the R field).

 - The R field is given focus as shown by the blue underline on Windows 11 (or blue outline Windows 10).

4. Click in the Color Wheel (or anywhere else in the Colors window)

 - Note that the R field still has has focus. This is the bug. The field should not still have focus.

5. Press the Tools shortcut keys S and G

 - The shortcut keys are swallowed by the R field so they no longer swap between the Rectangle Select and Gradient tools.


Try to correct the situation

6. Click on the Canvas/Editing Window

 - The Colors window R field no longer has focus

7. Press the Tools shortcut keys S and G

 - As expected, the active tool swaps between the Rectangle Select and Gradient tools.

 

But the bug reoccurs if you interact with the Colors window again

8. Click in the Color Wheel (or anywhere else in the Colors window)

 - Note that focus is returned to the R field. This should not happen.

9. Press the Tools shortcut keys S and G

 - The shortcut keys are swallowed by the R field so they no longer swap between the Rectangle Select and Gradient tools.



Additional Info
Note that this bug, which is triggered by hiding and redisplaying the Colors window, has some similarity with this bug, which is triggered by hiding and redisplaying the Tools window:  https://forums.getpaint.net/topic/124320-tools-shortcut-keys-stop-working-if-you-click-in-the-colors-window-after-hiding-the-tools-window/

 

 

 

Link to comment
Share on other sites

@Rick Brewster I've found other unexpected focus behaviour in the Colors window.

 

This might get swept up in your fix for the problem described above but I'm reporting it here so it can be checked when you investigate the above.

 

This problem does not prevent the Tools shortcuts from working; it's more of a UI quirk, but it probably points to some incorrect focus handling code that might be related to the above bug.

 

Expected Behaviour

Clicking on the background (or certain other areas) of the Colors window should not momentarily give focus to a color entry field.

 

Actual Behaviour

Clicking on the background (or certain other areas) of the Colors window in the way described in 'Repro Steps' below, momentarily gives focus to a color entry field.

 

Initial Setup

1. Run paint.net and display the Colors window in its expanded state.

2. Close paint.net

3. Run paint.net again. The Colors windows is displayed at startup.

 - As expected, none of the entry fields (i.e R, G, B, H, S, V, Alpha) has focus.

 

Repro Steps

1. Click in one of the color entry fields (for example the R field).

 - The R field is given focus as shown by the blue underline on Windows 11 (or blue outline Windows 10).

2. Click in the Color Wheel

 - The R field no longer has focus

3. Click on the background of the Colors window (or on the Primary/Secondary color control, the Swap Pri/Sec icon, or the reset to black/white icon, but not on the Color Wheel or the Palette area)

 - The R field is given focus for the duration of the mouse button being held down. This should not happen.

 

 

The following screen video shows focus momentary being given to the R field when clicking on the background but not when clicking on the Color Wheel.

Note that the 🟢 highlight at the pointer shows when the mouse is clicked.

 

Colors-focus-bug.gif

 

 

 

 

  • You're a Smart Cookie! 1
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...