mirror of
https://github.com/koreader/koreader.git
synced 2025-08-10 00:52:38 +00:00
SDL: set WM_CLASS on Wayland/X11 (#9280)
This commit is contained in:
@@ -1,8 +1,16 @@
|
||||
local Event = require("ui/event")
|
||||
local Generic = require("device/generic/device")
|
||||
local SDL = require("ffi/SDL2_0")
|
||||
local ffi = require("ffi")
|
||||
local logger = require("logger")
|
||||
|
||||
-- SDL computes WM_CLASS on X11/Wayland based on process's binary name.
|
||||
-- Some desktop environments rely on WM_CLASS to name the app and/or to assign the proper icon.
|
||||
if jit.os == "Linux" or jit.os == "BSD" or jit.os == "POSIX" then
|
||||
if not os.getenv("SDL_VIDEO_WAYLAND_WMCLASS") then ffi.C.setenv("SDL_VIDEO_WAYLAND_WMCLASS", "KOReader", 1) end
|
||||
if not os.getenv("SDL_VIDEO_X11_WMCLASS") then ffi.C.setenv("SDL_VIDEO_X11_WMCLASS", "KOReader", 1) end
|
||||
end
|
||||
|
||||
local function yes() return true end
|
||||
local function no() return false end
|
||||
local function notOSX() return jit.os ~= "OSX" end
|
||||
|
||||
Reference in New Issue
Block a user