MCPcopy Index your code
hub / github.com/BobdaProgrammer/doWM / switchWorkspace

Method switchWorkspace

wm/window_manager.go:1758–1793  ·  view source on GitHub ↗
(workspace int)

Source from the content-addressed store, hash-verified

1756}
1757
1758func (wm *WindowManager) switchWorkspace(workspace int) {
1759 if workspace > len(wm.workspaces) {
1760 return
1761 }
1762
1763 if workspace == wm.workspaceIndex {
1764 return
1765 }
1766
1767 // unmap all windows in current workspace
1768 for _, frame := range wm.currWorkspace.windowList {
1769 xproto.UnmapWindowChecked(wm.conn, frame.id)
1770 }
1771
1772 // swap workspace
1773 wm.currWorkspace = &wm.workspaces[workspace]
1774 wm.workspaceIndex = workspace
1775
1776 // map all the windows in the other workspace
1777 for _, frame := range wm.currWorkspace.windowList {
1778 xproto.MapWindowChecked(wm.conn, frame.id)
1779 }
1780
1781 wm.conn.Sync()
1782
1783 // update tiling
1784 if !wm.currWorkspace.detachTiling {
1785 if wm.tiling && !wm.currWorkspace.tiling {
1786 wm.enableTiling()
1787 } else if !wm.tiling && wm.currWorkspace.tiling {
1788 wm.disableTiling()
1789 }
1790 }
1791 wm.broadcastWorkspace(workspace)
1792 wm.layoutIndex = wm.currWorkspace.layoutIndex
1793}
1794
1795func (wm *WindowManager) SendWmDelete(conn *xgb.Conn, window xproto.Window) error {
1796 // polite EMWH way of telling the window to delete itself

Callers 1

RunMethod · 0.95

Calls 3

enableTilingMethod · 0.95
disableTilingMethod · 0.95
broadcastWorkspaceMethod · 0.95

Tested by

no test coverage detected