Skip to content

Linux: Fix build with dbus=no or threads=no #106175

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion platform/linuxbsd/detect.py
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,7 @@ def configure(env: "SConsEnvironment"):
else:
env.Append(CPPDEFINES=["PULSEAUDIO_ENABLED", "_REENTRANT"])

if env["dbus"]:
if env["dbus"] and env["threads"]: # D-Bus functionality expects threads.
if not env["use_sowrap"]:
if os.system("pkg-config --exists dbus-1") == 0: # 0 means found
env.ParseConfig("pkg-config dbus-1 --cflags --libs")
Expand Down
6 changes: 3 additions & 3 deletions platform/linuxbsd/wayland/display_server_wayland.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1535,14 +1535,14 @@ Key DisplayServerWayland::keyboard_get_keycode_from_physical(Key p_keycode) cons
}

bool DisplayServerWayland::color_picker(const Callable &p_callback) {
#ifdef DBUS_ENABLED
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));
#ifdef DBUS_ENABLED
return portal_desktop->color_picker((ws ? ws->exported_handle : String()), p_callback);
#endif
#else
return false;
#endif
}

void DisplayServerWayland::try_suspend() {
Expand Down
4 changes: 4 additions & 0 deletions platform/linuxbsd/x11/display_server_x11.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3628,6 +3628,7 @@ Key DisplayServerX11::keyboard_get_label_from_physical(Key p_keycode) const {
}

bool DisplayServerX11::color_picker(const Callable &p_callback) {
#ifdef DBUS_ENABLED
WindowID window_id = last_focused_window;

if (!windows.has(window_id)) {
Expand All @@ -3636,6 +3637,9 @@ bool DisplayServerX11::color_picker(const Callable &p_callback) {

String xid = vformat("x11:%x", (uint64_t)windows[window_id].x11_window);
return portal_desktop->color_picker(xid, p_callback);
#else
return false;
#endif
}

DisplayServerX11::Property DisplayServerX11::_read_property(Display *p_display, Window p_window, Atom p_property) {
Expand Down