()
| 1688 | } |
| 1689 | |
| 1690 | func (wm *WindowManager) broadcastWorkspaceCount() { |
| 1691 | // EMWH things for bars to show workspaces |
| 1692 | count := wm.workspaceIndex + 1 |
| 1693 | otherCount := 0 |
| 1694 | for i, workspace := range wm.workspaces { |
| 1695 | if len(workspace.windowList) > 0 { |
| 1696 | otherCount = i |
| 1697 | } |
| 1698 | } |
| 1699 | otherCount += 1 |
| 1700 | if otherCount > count { |
| 1701 | count = otherCount |
| 1702 | } |
| 1703 | data := make([]byte, 4) |
| 1704 | binary.LittleEndian.PutUint32(data, uint32(count)) |
| 1705 | |
| 1706 | netNumberAtom, _ := xproto.InternAtom(wm.conn, true, uint16(len("_NET_NUMBER_OF_DESKTOPS")), "_NET_NUMBER_OF_DESKTOPS").Reply() |
| 1707 | cardinalAtom, _ := xproto.InternAtom(wm.conn, true, uint16(len("CARDINAL")), "CARDINAL").Reply() |
| 1708 | |
| 1709 | xproto.ChangePropertyChecked( |
| 1710 | wm.conn, |
| 1711 | xproto.PropModeReplace, |
| 1712 | wm.root, |
| 1713 | netNumberAtom.Atom, |
| 1714 | cardinalAtom.Atom, |
| 1715 | 32, |
| 1716 | 1, |
| 1717 | data, |
| 1718 | ).Check() |
| 1719 | } |
| 1720 | |
| 1721 | func (wm *WindowManager) broadcastWorkspace(num int) { |
| 1722 | // EMWH thing for bars to show workspaces |
no outgoing calls
no test coverage detected