Colour picker issue.
Posted
#1
(In Topic #1190)
Guru

<IMG src="https://www.cogier.com/gambas/ColourPicker.png">
</IMG>
Posted
Guru

And changed the code.
Here is the code from FColorChooser in gb.form …
Code (gambas)
- SetColor(iColor)
- RaiseActivate
- ' hTimer.Stop
- ' $hZoom = Null
- ' panColor.Refresh
- ' panGrab.Mouse = Mouse.Cross
- ' 'panGrab.Cursor = New Cursor(txtHexa.Picture, 0, txtHexa.Picture.H - 1)
- ' panGrab.Show
- ' panGrab_MouseMove
- ' panGrab.Grab
- ' $hZoom = Null
- ' panColor.Refresh 'SetColor(hPict.Image[0, 0])
- ' panGrab.Hide
As you can see the desktop portal method is not as involved.
the commented out old code uses grab and stuff to monitor the mouse movement.
the Desktop.PickColor does not.
Posted
Guru

Benoit changed the color picker to use desktop portal
I'm not sure I understand what the 'desktop portal' means. How do I pick the specific pixel I want and what is the point of an empty box?
Posted
Guru

And I agree, it not as good like that, Maybe ask Ben to put it back as it was.
I'm pretty sure portal ScreenShot does not work on all systems (Fedora iirc)
Posted
Guru

gb.form ColorChooser shows color for color picker again. (d3cc23da) · Commits · Bruce Steers / gambas · GitLab
I do not know if Benoit removed the feature for a reason (possibly it does not work on wayland)
I messaged the M/L pointing to that commit, maybe Ben will add it or do it his own way or not do it because of wayland?
Only time will tell…..
Posted
Guru

Posted
Guru

because of how crap wayland is.
Screenshot and PickColor from desktop portal do not work the same,
they have very few options and demand interaction.
like the screenshot method that with x11 can get any bit of the screen , with portal all it does is open a screenshot dialog.
then Ben has worked around it by copying part of the image after grabbing the whole screen.
Code (gambas)
- hScreenshot = DesktopPortal.Screenshot()
so basically the color being seen as you move the mouse in ColorChooser.class has been ruined by wayland because each call to Desktop.Screenshot to get the pixels will now open the screenshot dialog
It will still work on x11 but Benoit says any x11 specific code in gb.desktop will slowly disappear and use desktop portal instead!
God I hate wayland, it sucks so very badly that now it's even making gambas worse.
Damn that's sucky , really really sucky
Posted
Guru

ColorChooser, re-enable seeing the color under the pointer when picking color with x11. (!337) · Merge requests · Gambas / gambas · GitLab
This one uses the method to show the color in the color box only if using x11 as currently gb.desktop is set to use desktop.portal ONLY if on wayland.
The desktop portal PickColor method shows a nice little magnifying glass for the cursor that displays the color as you move.
So currently if using wayland you CAN see the color in the cursor but if using x there is nothing
So if Ben accepts this then it will work again for X11 systems.
Or if he changes x11 to use portal then we'll have the magnifying glass for a cursor showing color anyway.
Posted
Guru

He's not commented on the merge request. (i just gave him a nudge)
If you want your gambas to do it and you compile then you could replace this file in your branch's /comp/src/gb.form/.src/Color folder and recompile.
comp/src/gb.form/.src/Color/FColorChooser.class · 10d24da31489d07a97055b3d5e189c0e30b77d61 · Gambas / gambas · GitLab
1 guest and 0 members have just viewed this.



