| 1876 | } |
| 1877 | |
| 1878 | func (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 | |
| 1896 | func (wm *WindowManager) setNetWorkArea() { |
| 1897 | atomWorkArea, err := xproto.InternAtom(wm.conn, true, uint16(len("_NET_WORKAREA")), "_NET_WORKAREA").Reply() |