[Bf-blender-cvs] [64a114d11c9] blender-v3.4-release: GHOST/Wayland: add build option to set the XDG app-id

Campbell Barton noreply at git.blender.org
Wed Nov 16 02:33:16 CET 2022


Commit: 64a114d11c9c03fb336625ad20b6563dc6b923bf
Author: Campbell Barton
Date:   Wed Nov 16 11:15:10 2022 +1100
Branches: blender-v3.4-release
https://developer.blender.org/rB64a114d11c9c03fb336625ad20b6563dc6b923bf

GHOST/Wayland: add build option to set the XDG app-id

Add WITH_GHOST_WAYLAND_APP_ID so people making custom builds may
differentiate the blender instance by version/branch etc.

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

M	CMakeLists.txt
M	intern/ghost/CMakeLists.txt
M	intern/ghost/intern/GHOST_WindowWayland.cpp

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

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 30a186318ce..9f6217d4ce8 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -257,6 +257,12 @@ if(UNIX AND NOT (APPLE OR HAIKU))
 
     option(WITH_GHOST_WAYLAND_DYNLOAD  "Enable runtime dynamic WAYLAND libraries loading" ON)
     mark_as_advanced(WITH_GHOST_WAYLAND_DYNLOAD)
+
+    set(WITH_GHOST_WAYLAND_APP_ID "" CACHE STRING "\
+The application ID used for Blender (use default when an empty string), \
+this can be used to differentiate Blender instances by version or branch for example."
+    )
+    mark_as_advanced(WITH_GHOST_WAYLAND_APP_ID)
   endif()
 endif()
 
diff --git a/intern/ghost/CMakeLists.txt b/intern/ghost/CMakeLists.txt
index 5c559072625..599d5304cac 100644
--- a/intern/ghost/CMakeLists.txt
+++ b/intern/ghost/CMakeLists.txt
@@ -393,6 +393,11 @@ elseif(WITH_GHOST_X11 OR WITH_GHOST_WAYLAND)
     unset(INC_DST)
 
     add_definitions(-DWITH_GHOST_WAYLAND)
+
+    if(NOT WITH_GHOST_WAYLAND_APP_ID STREQUAL "")
+      add_definitions(-DWITH_GHOST_WAYLAND_APP_ID=${WITH_GHOST_WAYLAND_APP_ID})
+    endif()
+
   endif()
 
   if(WITH_INPUT_NDOF)
diff --git a/intern/ghost/intern/GHOST_WindowWayland.cpp b/intern/ghost/intern/GHOST_WindowWayland.cpp
index 63fed9a8172..07fbbc12d31 100644
--- a/intern/ghost/intern/GHOST_WindowWayland.cpp
+++ b/intern/ghost/intern/GHOST_WindowWayland.cpp
@@ -823,7 +823,13 @@ GHOST_WindowWayland::GHOST_WindowWayland(GHOST_SystemWayland *system,
    * simply called `blender.desktop`, so the it's important to follow that name.
    * Other distributions such as SNAP & FLATPAK may need to change this value T101779.
    * Currently there isn't a way to configure this, we may want to support that. */
-  const char *xdg_app_id = "blender";
+  const char *xdg_app_id = (
+#ifdef WITH_GHOST_WAYLAND_APP_ID
+      STRINGIFY(WITH_GHOST_WAYLAND_APP_ID)
+#else
+      "blender"
+#endif
+  );
 
 #ifdef WITH_GHOST_WAYLAND_LIBDECOR
   if (use_libdecor) {



More information about the Bf-blender-cvs mailing list