| 1975 | } |
| 1976 | |
| 1977 | func (wm *WindowManager) findWindow(window xproto.Window) (bool, int, xproto.Window) { |
| 1978 | // look through all workspaces and windows to find a window (this is for if a window is deleted by a window from another workspace, we need to search for it) |
| 1979 | for i, workspace := range wm.workspaces { |
| 1980 | if i == wm.workspaceIndex { |
| 1981 | continue |
| 1982 | } |
| 1983 | |
| 1984 | for _, frame := range workspace.windowList { |
| 1985 | if frame.id == window { |
| 1986 | return true, i, frame.id |
| 1987 | } |
| 1988 | |
| 1989 | } |
| 1990 | } |
| 1991 | return false, 0, 0 |
| 1992 | } |
| 1993 | |
| 1994 | func (wm *WindowManager) OnUnmapNotify(event xproto.UnmapNotifyEvent) { |
| 1995 | if _, ok := wm.windows[event.Window]; !ok { |