You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-04 12:00:25 +00:00
Merge pull request #101546 from bruvzg/portal_color_picker
[Linux] Implement native color picker.
This commit is contained in:
@@ -222,6 +222,9 @@ bool DisplayServerWayland::has_feature(Feature p_feature) const {
|
||||
case FEATURE_NATIVE_DIALOG_FILE_MIME: {
|
||||
return (portal_desktop && portal_desktop->is_supported() && portal_desktop->is_file_chooser_supported());
|
||||
} break;
|
||||
case FEATURE_NATIVE_COLOR_PICKER: {
|
||||
return (portal_desktop && portal_desktop->is_supported() && portal_desktop->is_screenshot_supported());
|
||||
} break;
|
||||
#endif
|
||||
|
||||
#ifdef SPEECHD_ENABLED
|
||||
@@ -1169,6 +1172,14 @@ Key DisplayServerWayland::keyboard_get_keycode_from_physical(Key p_keycode) cons
|
||||
return key;
|
||||
}
|
||||
|
||||
bool DisplayServerWayland::color_picker(const Callable &p_callback) {
|
||||
WindowID window_id = MAIN_WINDOW_ID;
|
||||
// TODO: Use window IDs for multiwindow support.
|
||||
|
||||
WaylandThread::WindowState *ws = wayland_thread.wl_surface_get_window_state(wayland_thread.window_get_wl_surface(window_id));
|
||||
return portal_desktop->color_picker((ws ? ws->exported_handle : String()), p_callback);
|
||||
}
|
||||
|
||||
void DisplayServerWayland::try_suspend() {
|
||||
// Due to various reasons, we manually handle display synchronization by
|
||||
// waiting for a frame event (request to draw) or, if available, the actual
|
||||
@@ -1329,7 +1340,7 @@ void DisplayServerWayland::process_events() {
|
||||
|
||||
#ifdef DBUS_ENABLED
|
||||
if (portal_desktop) {
|
||||
portal_desktop->process_file_dialog_callbacks();
|
||||
portal_desktop->process_callbacks();
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
Reference in New Issue
Block a user