Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Linux] Implement native color picker. #101546

Merged
merged 1 commit into from
Mar 17, 2025

Conversation

bruvzg
Copy link
Member

@bruvzg bruvzg commented Jan 14, 2025

Implements native color picker on Linux.

Screencast.From.2025-01-14.18-23-18.mp4

Copy link
Member

@YeldhamDev YeldhamDev left a comment

Choose a reason for hiding this comment

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

Tested on KDE Plasma, works as expected.

@bruvzg bruvzg force-pushed the portal_color_picker branch from 3d1c4b8 to 148b03a Compare January 14, 2025 17:59
Copy link
Member

@Calinou Calinou left a comment

Choose a reason for hiding this comment

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

Tested locally on KDE X11 6.2.5 (with and without single-window mode), it doesn't seem to do anything when clicking the pick color button:

color_picker_not_working.mp4

In comparison, it worked on 4.4.dev 24d7451.

@bruvzg bruvzg force-pushed the portal_color_picker branch from 148b03a to 6a7ea7a Compare January 22, 2025 06:58
@syntaxerror247
Copy link
Member

I'm not sure about adding a new method in DisplayServer. Can this be implemented for other OSes too?
Android doesn't have a native widget for it.

@bruvzg
Copy link
Member Author

bruvzg commented Jan 22, 2025

Added availability checks for org.freedesktop.portal.Screenshot (same as #101812).

@bruvzg
Copy link
Member Author

bruvzg commented Jan 22, 2025

I'm not sure about adding a new method in DisplayServer.

D-Bus/FreeDesktop portal is already initialized and polled as part of DisplayServer, so it's a logical place to add it to reuse a lot of existing code.

Can this be implemented for other OSes too?

A far as I can tell, no. None of the other OSes have anything like this (macOS and Windows have only full color picker dialogs), but this is likely the only way to pick from a screen on Wayland.

@Riteo
Copy link
Contributor

Riteo commented Feb 1, 2025

I tested this PR on sway, and it worked fine even on my clunky KISS Linux setup! I'll do a final approval once #101812 is merged, as this PR includes that.

@bruvzg bruvzg force-pushed the portal_color_picker branch from 6a7ea7a to 05ca806 Compare February 3, 2025 14:30
Copy link
Contributor

@Riteo Riteo left a comment

Choose a reason for hiding this comment

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

Tested once again, with successful results, on my funky KISS Linux laptop (sway using xdg-desktop-portal-wlr backend). Code checks out.

LGTM!

@bruvzg bruvzg modified the milestones: 4.x, 4.5 Mar 13, 2025
@Repiteo Repiteo merged commit 49fcd4c into godotengine:master Mar 17, 2025
19 checks passed
@Repiteo
Copy link
Contributor

Repiteo commented Mar 17, 2025

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants