Skip to content

Commit e9e8ddc

Browse files
committed
Linux: Fix build with dbus=no or threads=no
1 parent 8f78e75 commit e9e8ddc

File tree

3 files changed

+8
-4
lines changed

3 files changed

+8
-4
lines changed

platform/linuxbsd/detect.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -336,7 +336,7 @@ def configure(env: "SConsEnvironment"):
336336
else:
337337
env.Append(CPPDEFINES=["PULSEAUDIO_ENABLED", "_REENTRANT"])
338338

339-
if env["dbus"]:
339+
if env["dbus"] and env["threads"]: # D-Bus functionality expects threads.
340340
if not env["use_sowrap"]:
341341
if os.system("pkg-config --exists dbus-1") == 0: # 0 means found
342342
env.ParseConfig("pkg-config dbus-1 --cflags --libs")

platform/linuxbsd/wayland/display_server_wayland.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1535,14 +1535,14 @@ Key DisplayServerWayland::keyboard_get_keycode_from_physical(Key p_keycode) cons
15351535
}
15361536

15371537
bool DisplayServerWayland::color_picker(const Callable &p_callback) {
1538+
#ifdef DBUS_ENABLED
15381539
WindowID window_id = MAIN_WINDOW_ID;
15391540
// TODO: Use window IDs for multiwindow support.
1540-
15411541
WaylandThread::WindowState *ws = wayland_thread.wl_surface_get_window_state(wayland_thread.window_get_wl_surface(window_id));
1542-
#ifdef DBUS_ENABLED
15431542
return portal_desktop->color_picker((ws ? ws->exported_handle : String()), p_callback);
1544-
#endif
1543+
#else
15451544
return false;
1545+
#endif
15461546
}
15471547

15481548
void DisplayServerWayland::try_suspend() {

platform/linuxbsd/x11/display_server_x11.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3628,6 +3628,7 @@ Key DisplayServerX11::keyboard_get_label_from_physical(Key p_keycode) const {
36283628
}
36293629

36303630
bool DisplayServerX11::color_picker(const Callable &p_callback) {
3631+
#ifdef DBUS_ENABLED
36313632
WindowID window_id = last_focused_window;
36323633

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

36373638
String xid = vformat("x11:%x", (uint64_t)windows[window_id].x11_window);
36383639
return portal_desktop->color_picker(xid, p_callback);
3640+
#else
3641+
return false;
3642+
#endif
36393643
}
36403644

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

0 commit comments

Comments
 (0)