Skip to content

Commit

Permalink
feat: extended sticky window support #22
Browse files Browse the repository at this point in the history
  • Loading branch information
leukipp committed Dec 10, 2023
1 parent 817fae4 commit 6959990
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion desktop/tracker.go
Original file line number Diff line number Diff line change
Expand Up @@ -375,15 +375,27 @@ func (tr *Tracker) handleWorkspaceChange(c *store.Client) {
}

func (tr *Tracker) onStateUpdate(aname string) {
workspacesChanged := store.DeskCount*store.ScreenCount != uint(len(tr.Workspaces))
viewportChanged := common.IsInList(aname, []string{"_NET_NUMBER_OF_DESKTOPS", "_NET_DESKTOP_LAYOUT", "_NET_DESKTOP_GEOMETRY", "_NET_DESKTOP_VIEWPORT", "_NET_WORKAREA"})
clientsChanged := common.IsInList(aname, []string{"_NET_CLIENT_LIST_STACKING", "_NET_ACTIVE_WINDOW"})

workspacesChanged := store.DeskCount*store.ScreenCount != uint(len(tr.Workspaces))
workspaceChanged := common.IsInList(aname, []string{"_NET_CURRENT_DESKTOP"})

// Number of desktops or screens changed
if workspacesChanged {
tr.Reset()
}

// Active desktop changed
if workspaceChanged {
for _, c := range tr.Clients {
sticky := common.IsInList("_NET_WM_STATE_STICKY", c.Latest.States)
if sticky && c.Latest.Location.DeskNum != store.CurrentDesk {
ewmh.WmDesktopSet(store.X, c.Win.Id, ^uint(0))
}
}
}

// Viewport changed or clients changed
if viewportChanged || clientsChanged {
tr.Update()
Expand Down

0 comments on commit 6959990

Please sign in to comment.