(event xproto.UnmapNotifyEvent)
| 1992 | } |
| 1993 | |
| 1994 | func (wm *WindowManager) OnUnmapNotify(event xproto.UnmapNotifyEvent) { |
| 1995 | if _, ok := wm.windows[event.Window]; !ok { |
| 1996 | ok, index, frame := wm.findWindow(event.Event) |
| 1997 | if !ok { |
| 1998 | slog.Info("couldn't unmap since window wasn't in clients") |
| 1999 | fmt.Println(event.Window) |
| 2000 | return |
| 2001 | } else { |
| 2002 | // when I wrote this, only god and I knew what was going on, now only god knows |
| 2003 | |
| 2004 | wm.currWorkspace = &wm.workspaces[index] |
| 2005 | remove(&wm.currWorkspace.windowList, frame) |
| 2006 | delete(wm.windows, frame) |
| 2007 | fmt.Println("frame") |
| 2008 | fmt.Println(frame) |
| 2009 | fmt.Println("index") |
| 2010 | fmt.Println(index) |
| 2011 | wm.currWorkspace = &wm.workspaces[wm.workspaceIndex] |
| 2012 | wm.UnFrame(frame, true) |
| 2013 | wm.fitToLayout() |
| 2014 | return |
| 2015 | } |
| 2016 | } |
| 2017 | |
| 2018 | if event.Event == wm.root { |
| 2019 | slog.Info("Ignore UnmapNotify for reparented pre-existing window") |
| 2020 | fmt.Println(event.Window) |
| 2021 | return |
| 2022 | } |
| 2023 | |
| 2024 | wm.UnFrame(event.Window, false) |
| 2025 | wm.fitToLayout() |
| 2026 | } |
| 2027 | |
| 2028 | func (wm *WindowManager) UnFrame(w xproto.Window, unmapped bool) { |
| 2029 |
no test coverage detected