MCPcopy Create free account
hub / github.com/BobdaProgrammer/doWM / setNetActiveWindow

Method setNetActiveWindow

wm/window_manager.go:1878–1894  ·  view source on GitHub ↗
(win xproto.Window)

Source from the content-addressed store, hash-verified

1876}
1877
1878func (wm *WindowManager) setNetActiveWindow(win xproto.Window) {
1879 atomActiveWin, _ := xproto.InternAtom(wm.conn, true, uint16(len("_NET_ACTIVE_WINDOW")), "_NET_ACTIVE_WINDOW").Reply()
1880
1881 // Convert uint32 to []byte
1882 buf := new(bytes.Buffer)
1883 binary.Write(buf, binary.LittleEndian, win)
1884
1885 xproto.ChangeProperty(wm.conn,
1886 xproto.PropModeReplace,
1887 wm.root, // Set on the root window
1888 atomActiveWin.Atom, // _NET_ACTIVE_WINDOW
1889 xproto.AtomWindow, // Type: WINDOW
1890 32, // Format: 32-bit
1891 1, // Only one window
1892 buf.Bytes(), // Here's the []byte version
1893 )
1894}
1895
1896func (wm *WindowManager) setNetWorkArea() {
1897 atomWorkArea, err := xproto.InternAtom(wm.conn, true, uint16(len("_NET_WORKAREA")), "_NET_WORKAREA").Reply()

Callers 1

OnEnterNotifyMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected