[Bf-blender-cvs] [b51d337adc1] master: GHOST/Wayland: print all dynamic loading failure when using Wayland

Campbell Barton noreply at git.blender.org
Tue Oct 11 02:15:57 CEST 2022


Commit: b51d337adc135ab3358fc562f70712a07a58ef52
Author: Campbell Barton
Date:   Tue Oct 11 11:07:03 2022 +1100
Branches: master
https://developer.blender.org/rBb51d337adc135ab3358fc562f70712a07a58ef52

GHOST/Wayland: print all dynamic loading failure when using Wayland

Previously only failure to dynamically load libdecor would report a
warning. Now report failure to load all Wayland libraries.

This was done because Wayland libraries (besides libdecor) are likely to
be installed on systems running Wayland. However it makes it difficult
to troubleshoot failure to load Wayland on systems with libdecor.

Only silence Wayland dynamic loading warnings when Wayland isn't running.

===================================================================

M	intern/ghost/intern/GHOST_SystemWayland.cpp

===================================================================

diff --git a/intern/ghost/intern/GHOST_SystemWayland.cpp b/intern/ghost/intern/GHOST_SystemWayland.cpp
index 7feb6713d03..7e56ed0affb 100644
--- a/intern/ghost/intern/GHOST_SystemWayland.cpp
+++ b/intern/ghost/intern/GHOST_SystemWayland.cpp
@@ -4320,20 +4320,13 @@ bool GHOST_SystemWayland::window_cursor_grab_set(const GHOST_TGrabCursorMode mod
 #ifdef WITH_GHOST_WAYLAND_DYNLOAD
 bool ghost_wl_dynload_libraries()
 {
-  /* Only report when `libwayland-client` is not found when building without X11,
-   * which will be used as a fallback. */
 #  ifdef WITH_GHOST_X11
-  bool verbose = false;
-#    ifdef WITH_GHOST_WAYLAND_LIBDECOR
-  /* When running in Wayland, let the user know if libdecor is the only reason WAYLAND
-   * could not be used. Otherwise it's not obvious why X11 is used as a fallback. */
-  bool verbose_libdecor = getenv("WAYLAND_DISPLAY") != nullptr;
-#    endif
+  /* When running in WAYLAND, let the user know when a missing library is the only reason
+   * WAYLAND could not be used. Otherwise it's not obvious why X11 is used as a fallback.
+   * Otherwise when X11 is used, reporting WAYLAND library warnings is unwelcome noise. */
+  bool verbose = getenv("WAYLAND_DISPLAY") != nullptr;
 #  else
   bool verbose = true;
-#    ifdef WITH_GHOST_WAYLAND_LIBDECOR
-  bool verbose_libdecor = true;
-#    endif
 #  endif /* !WITH_GHOST_X11 */
 
 #  ifdef WITH_GHOST_WAYLAND_LIBDECOR
@@ -4344,7 +4337,7 @@ bool ghost_wl_dynload_libraries()
       wayland_dynload_cursor_init(verbose) && /* `libwayland-cursor`. */
       wayland_dynload_egl_init(verbose) &&    /* `libwayland-egl`. */
 #  ifdef WITH_GHOST_WAYLAND_LIBDECOR
-      (libdecor_init = wayland_dynload_libdecor_init(verbose_libdecor)) && /* `libdecor-0`. */
+      (libdecor_init = wayland_dynload_libdecor_init(verbose)) && /* `libdecor-0`. */
 #  endif
       true) {
     return true;



More information about the Bf-blender-cvs mailing list