diff --git a/drivers/gles3/rasterizer_gles3.cpp b/drivers/gles3/rasterizer_gles3.cpp index c05bb55c02bb..c048e9bf3767 100644 --- a/drivers/gles3/rasterizer_gles3.cpp +++ b/drivers/gles3/rasterizer_gles3.cpp @@ -78,15 +78,6 @@ #include "platform_gl.h" -#if EGL_ENABLED -#if GLAD_ENABLED -#include "thirdparty/glad/glad/egl.h" -#else -#include -#include -#endif // GLAD_ENABLED -#endif // EGL_ENABLED - #if defined(MINGW_ENABLED) || defined(_MSC_VER) #define strcpy strcpy_s #endif diff --git a/platform/linuxbsd/key_mapping_xkb.cpp b/platform/linuxbsd/key_mapping_xkb.cpp index 9b8e4c8def98..905005c28199 100644 --- a/platform/linuxbsd/key_mapping_xkb.cpp +++ b/platform/linuxbsd/key_mapping_xkb.cpp @@ -350,8 +350,10 @@ xkb_keycode_t KeyMappingXKB::get_xkb_keycode(Key p_keysym) { Key KeyMappingXKB::get_keycode(xkb_keysym_t p_keysym) { // Kinda bruteforce.. could optimize. - if (p_keysym < 0x100) // Latin 1, maps 1-1 + // Latin 1, maps 1-1 + if (p_keysym < 0x100) { return (Key)p_keysym; + } // Look for special key. for (int idx = 0; _xkb_keysym_to_keycode[idx].keysym != 0; idx++) { diff --git a/platform/linuxbsd/wayland/display_server_wayland.cpp b/platform/linuxbsd/wayland/display_server_wayland.cpp index 9c8d4e391d7c..a7f55b4ad1af 100644 --- a/platform/linuxbsd/wayland/display_server_wayland.cpp +++ b/platform/linuxbsd/wayland/display_server_wayland.cpp @@ -159,37 +159,37 @@ String DisplayServerWayland::get_name() const { #ifdef SPEECHD_ENABLED bool DisplayServerWayland::tts_is_speaking() const { - ERR_FAIL_COND_V(!tts, false); + ERR_FAIL_NULL_V(tts, false); return tts->is_speaking(); } bool DisplayServerWayland::tts_is_paused() const { - ERR_FAIL_COND_V(!tts, false); + ERR_FAIL_NULL_V(tts, false); return tts->is_paused(); } TypedArray DisplayServerWayland::tts_get_voices() const { - ERR_FAIL_COND_V(!tts, TypedArray()); + ERR_FAIL_NULL_V(tts, TypedArray()); return tts->get_voices(); } void DisplayServerWayland::tts_speak(const String &p_text, const String &p_voice, int p_volume, float p_pitch, float p_rate, int p_utterance_id, bool p_interrupt) { - ERR_FAIL_COND(!tts); + ERR_FAIL_NULL(tts); tts->speak(p_text, p_voice, p_volume, p_pitch, p_rate, p_utterance_id, p_interrupt); } void DisplayServerWayland::tts_pause() { - ERR_FAIL_COND(!tts); + ERR_FAIL_NULL(tts); tts->pause(); } void DisplayServerWayland::tts_resume() { - ERR_FAIL_COND(!tts); + ERR_FAIL_NULL(tts); tts->resume(); } void DisplayServerWayland::tts_stop() { - ERR_FAIL_COND(!tts); + ERR_FAIL_NULL(tts); tts->stop(); } diff --git a/platform/linuxbsd/wayland/wayland_thread.cpp b/platform/linuxbsd/wayland/wayland_thread.cpp index 76f658cc44ad..34898b104af9 100644 --- a/platform/linuxbsd/wayland/wayland_thread.cpp +++ b/platform/linuxbsd/wayland/wayland_thread.cpp @@ -1114,17 +1114,17 @@ void WaylandThread::_xdg_toplevel_on_wm_capabilities(void *data, struct xdg_topl switch (*capability) { case XDG_TOPLEVEL_WM_CAPABILITIES_MAXIMIZE: { ws->can_maximize = true; - }; break; + } break; case XDG_TOPLEVEL_WM_CAPABILITIES_FULLSCREEN: { ws->can_fullscreen = true; - }; break; + } break; case XDG_TOPLEVEL_WM_CAPABILITIES_MINIMIZE: { ws->can_minimize = true; - }; break; + } break; default: { - }; break; + } break; } } } @@ -2713,7 +2713,10 @@ void WaylandThread::seat_state_set_hint(SeatState *p_ss, int p_x, int p_y) { } zwp_locked_pointer_v1_set_cursor_position_hint(p_ss->wp_locked_pointer, wl_fixed_from_int(p_x), wl_fixed_from_int(p_y)); - wl_surface_commit(p_ss->pointed_surface); + + if (p_ss->pointed_surface) { + wl_surface_commit(p_ss->pointed_surface); + } } void WaylandThread::seat_state_confine_pointer(SeatState *p_ss) { @@ -3215,7 +3218,7 @@ void WaylandThread::window_set_idle_inhibition(DisplayServer::WindowID p_window_ if (p_enable) { if (ws.registry->wp_idle_inhibit_manager && !ws.wp_idle_inhibitor) { - ERR_FAIL_COND(!ws.wl_surface); + ERR_FAIL_NULL(ws.wl_surface); ws.wp_idle_inhibitor = zwp_idle_inhibit_manager_v1_create_inhibitor(ws.registry->wp_idle_inhibit_manager, ws.wl_surface); } } else { @@ -3337,7 +3340,7 @@ Error WaylandThread::init() { KeyMappingXKB::initialize(); wl_display = wl_display_connect(nullptr); - ERR_FAIL_COND_V_MSG(!wl_display, ERR_CANT_CREATE, "Can't connect to a Wayland display."); + ERR_FAIL_NULL_V_MSG(wl_display, ERR_CANT_CREATE, "Can't connect to a Wayland display."); thread_data.wl_display = wl_display; @@ -3345,7 +3348,7 @@ Error WaylandThread::init() { wl_registry = wl_display_get_registry(wl_display); - ERR_FAIL_COND_V_MSG(!wl_registry, ERR_UNAVAILABLE, "Can't obtain the Wayland registry global."); + ERR_FAIL_NULL_V_MSG(wl_registry, ERR_UNAVAILABLE, "Can't obtain the Wayland registry global."); registry.wayland_thread = this; @@ -3354,12 +3357,12 @@ Error WaylandThread::init() { // Wait for registry to get notified from the compositor. wl_display_roundtrip(wl_display); - ERR_FAIL_COND_V_MSG(!registry.wl_shm, ERR_UNAVAILABLE, "Can't obtain the Wayland shared memory global."); - ERR_FAIL_COND_V_MSG(!registry.wl_compositor, ERR_UNAVAILABLE, "Can't obtain the Wayland compositor global."); - ERR_FAIL_COND_V_MSG(!registry.wl_subcompositor, ERR_UNAVAILABLE, "Can't obtain the Wayland subcompositor global."); - ERR_FAIL_COND_V_MSG(!registry.wl_data_device_manager, ERR_UNAVAILABLE, "Can't obtain the Wayland data device manager global."); - ERR_FAIL_COND_V_MSG(!registry.wp_pointer_constraints, ERR_UNAVAILABLE, "Can't obtain the Wayland pointer constraints global."); - ERR_FAIL_COND_V_MSG(!registry.xdg_wm_base, ERR_UNAVAILABLE, "Can't obtain the Wayland XDG shell global."); + ERR_FAIL_NULL_V_MSG(registry.wl_shm, ERR_UNAVAILABLE, "Can't obtain the Wayland shared memory global."); + ERR_FAIL_NULL_V_MSG(registry.wl_compositor, ERR_UNAVAILABLE, "Can't obtain the Wayland compositor global."); + ERR_FAIL_NULL_V_MSG(registry.wl_subcompositor, ERR_UNAVAILABLE, "Can't obtain the Wayland subcompositor global."); + ERR_FAIL_NULL_V_MSG(registry.wl_data_device_manager, ERR_UNAVAILABLE, "Can't obtain the Wayland data device manager global."); + ERR_FAIL_NULL_V_MSG(registry.wp_pointer_constraints, ERR_UNAVAILABLE, "Can't obtain the Wayland pointer constraints global."); + ERR_FAIL_NULL_V_MSG(registry.xdg_wm_base, ERR_UNAVAILABLE, "Can't obtain the Wayland XDG shell global."); if (!registry.xdg_decoration_manager) { #ifdef LIBDECOR_ENABLED