mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-06 01:45:36 +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"
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
"image"
|
"image"
|
||||||
|
"os"
|
||||||
|
"path/filepath"
|
||||||
"strconv"
|
"strconv"
|
||||||
"sync"
|
"sync"
|
||||||
"time"
|
"time"
|
||||||
@@ -508,6 +510,11 @@ func newX11Window(gioWin Callbacks, opts *Options) error {
|
|||||||
hints.flags = C.InputHint
|
hints.flags = C.InputHint
|
||||||
C.XSetWMHints(dpy, win, &hints)
|
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.utf8string = w.atom("UTF8_STRING", false)
|
||||||
w.atoms.evDelWindow = w.atom("WM_DELETE_WINDOW", false)
|
w.atoms.evDelWindow = w.atom("WM_DELETE_WINDOW", false)
|
||||||
w.atoms.clipboard = w.atom("CLIPBOARD", false)
|
w.atoms.clipboard = w.atom("CLIPBOARD", false)
|
||||||
|
|||||||
Reference in New Issue
Block a user