app: add app.ID exposed to the platform.

Allow app ID to be set by linger flag -X gioui.org/app.ID=%s so that wayland
can group windows, search for ${gioui.org/app.ID}.desktop file and display
application name. e.g. /usr/share/applications/${gioui.org/app.ID}.desktop
~/.local/share/applications/${appID}.desktop.

ID is set by the gogio tool or manually with the -X linker flag.

Signed-off-by: Marko Kungla <marko.kungla@gmail.com>
This commit is contained in:
Marko Kungla
2022-12-06 20:37:50 +02:00
committed by Elias Naur
parent 42b2174dec
commit a22e0f527a
3 changed files with 25 additions and 3 deletions
+5
View File
@@ -374,6 +374,11 @@ func (d *wlDisplay) createNativeWindow(options []Option) (*window, error) {
w.destroy()
return nil, errors.New("wayland: xdg_surface_get_toplevel failed")
}
id := C.CString(ID)
defer C.free(unsafe.Pointer(id))
C.xdg_toplevel_set_app_id(w.topLvl, id)
cursorTheme := C.CString(os.Getenv("XCURSOR_THEME"))
defer C.free(unsafe.Pointer(cursorTheme))
cursorSize := 32