| 1938 | } |
| 1939 | |
| 1940 | func (wm *WindowManager) setNetClientList() { |
| 1941 | atomClientList, _ := xproto.InternAtom(wm.conn, true, uint16(len("_NET_CLIENT_LIST")), "_NET_CLIENT_LIST").Reply() |
| 1942 | |
| 1943 | buf := new(bytes.Buffer) |
| 1944 | for _, info := range wm.windows { |
| 1945 | _ = binary.Write(buf, binary.LittleEndian, info.Client) |
| 1946 | } |
| 1947 | |
| 1948 | xproto.ChangeProperty(wm.conn, |
| 1949 | xproto.PropModeReplace, |
| 1950 | wm.root, |
| 1951 | atomClientList.Atom, |
| 1952 | xproto.AtomWindow, |
| 1953 | 32, |
| 1954 | uint32(len(wm.windows)), |
| 1955 | buf.Bytes(), |
| 1956 | ) |
| 1957 | } |
| 1958 | func (wm *WindowManager) OnEnterNotify(event xproto.EnterNotifyEvent) { |
| 1959 | // set focus when we enter a window and change border color |
| 1960 | err := xproto.SetInputFocusChecked(wm.conn, xproto.InputFocusPointerRoot, event.Event, xproto.TimeCurrentTime).Check() |