mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-01 23:55:39 +00:00
app/internal/window: set WM_CLASS to binary name
WM_CLASS is used by Linux desktops to provide hints for window grouping, icons to show and startup notifications. https://specifications.freedesktop.org/desktop-entry-spec/latest/ar01s06.html This patch set the WM_CLASS to the binary name. Signed-off-by: Jason <sourcehut@sweatyballs.es>
This commit is contained in:
@@ -26,6 +26,8 @@ import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"image"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"strconv"
|
||||
"sync"
|
||||
"time"
|
||||
@@ -508,6 +510,11 @@ func newX11Window(gioWin Callbacks, opts *Options) error {
|
||||
hints.flags = C.InputHint
|
||||
C.XSetWMHints(dpy, win, &hints)
|
||||
|
||||
name := C.CString(filepath.Base(os.Args[0]))
|
||||
defer C.free(unsafe.Pointer(name))
|
||||
wmhints := C.XClassHint{name, name}
|
||||
C.XSetClassHint(dpy, win, &wmhints)
|
||||
|
||||
w.atoms.utf8string = w.atom("UTF8_STRING", false)
|
||||
w.atoms.evDelWindow = w.atom("WM_DELETE_WINDOW", false)
|
||||
w.atoms.clipboard = w.atom("CLIPBOARD", false)
|
||||
|
||||
Reference in New Issue
Block a user