浏览代码

linux: Fix ibus support on Wayland/XWayland

Ethan Lee 4 年之前
父节点
当前提交
5ceb674426
共有 1 个文件被更改,包括 6 次插入1 次删除
  1. 6 1
      src/core/linux/SDL_ibus.c

+ 6 - 1
src/core/linux/SDL_ibus.c

@@ -257,7 +257,12 @@ IBus_GetDBusAddressFilename(void)
     }
     
     if (!*host) {
-        host = "unix";
+        const char *session = SDL_getenv("XDG_SESSION_TYPE");
+        if (session != NULL && SDL_strcmp(session, "wayland") == 0) {
+            host = "unix-wayland";
+        } else {
+            host = "unix";
+        }
     }
         
     SDL_memset(config_dir, 0, sizeof(config_dir));