Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@Lehonti
Copy link
Contributor

@Lehonti Lehonti commented May 3, 2025

See second commit.

The issue was first mentioned in #1382 (comment)

Copy link
Member

@cameronwhite cameronwhite left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! This does fix the issue when clicking on a palette color, but if you click on the primary or secondary color (at the far left of the status bar) a similar issue happens where the color is updated
if that seems more complicated to fix then I'm fine to merge these changes though!


private void OnShrinkButtonClicked (Gtk.Button button, EventArgs args)
{
//var contentArea = this.GetContentAreaBox ();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this commented code could just be removed now

@Lehonti
Copy link
Contributor Author

Lehonti commented May 5, 2025

Thanks! This does fix the issue when clicking on a palette color, but if you click on the primary or secondary color (at the far left of the status bar) a similar issue happens where the color is updated if that seems more complicated to fix then I'm fine to merge these changes though!

Thanks @cameronwhite . It seems to work correctly on my PC. Do you have a screen capture where I can see what you describe?

@cameronwhite
Copy link
Member

Sure, here is what I was doing:

Screen.Recording.2025-05-05.at.7.55.43.PM.mp4

@Lehonti
Copy link
Contributor Author

Lehonti commented May 6, 2025

Thank you @cameronwhite . I was not fully aware that one could change palette colors like that, but now I see how to do it and it behaves as expected on my end.

As for the primary and secondary colors, it's interesting that it behaves incorrectly on your machine, because it works on mine. I am testing Pinta on a virtual machine with Ubuntu Mate 24.04.1 LTS. What about you? It's worth asking, even though nothing here seems to me to be OS-specific (although I haven't looked in depth).

@cameronwhite cameronwhite linked an issue May 7, 2025 that may be closed by this pull request
@cameronwhite
Copy link
Member

I was testing on macOS - I can do a bit of debugging on my end to see what's happening

@cameronwhite
Copy link
Member

I think the problem is that the OnNotify handler can be called sometime during Gtk.Window.Close(), so this can update the active palette color as if the user had clicked outside the palette window while leaving it open.

I'll test and commit a fix - we should be able to remove that event handler when closing like we do for some other events

This ensures that the palette colors aren't updated unexpectedly due to the event being triggered as the dialog is being closed
@cameronwhite cameronwhite merged commit 5c3e488 into PintaProject:master May 7, 2025
6 checks passed
@Lehonti Lehonti deleted the improvement2 branch May 7, 2025 06:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Cancelling the color picker dialog still updates the palette

2 participants