Skip to content

Commit

Permalink
fix: use cross platform sticky state
Browse files Browse the repository at this point in the history
  • Loading branch information
leukipp committed Oct 30, 2023
1 parent bf40374 commit 455055f
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions store/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -303,9 +303,10 @@ func (c *Client) Restore(original bool) {
}

// Restore window states
for _, state := range c.Original.States {
for _, state := range c.Latest.States {
if common.IsInList(state, []string{"_NET_WM_STATE_STICKY"}) {
ewmh.WmStateReq(X, c.Win.Id, 1, state)
ewmh.WmDesktopSet(X, c.Win.Id, ^uint(0))
}
}

Expand Down Expand Up @@ -486,7 +487,8 @@ func GetInfo(w xproto.Window) *Info {

// Window desktop and screen (window workspace location)
deskNum, err := ewmh.WmDesktopGet(X, w)
if err != nil || deskNum > DeskCount {
sticky := deskNum > DeskCount
if err != nil || sticky {
deskNum = CurrentDesktopGet(X)
}
location = Location{
Expand All @@ -505,6 +507,9 @@ func GetInfo(w xproto.Window) *Info {
if err != nil {
states = []string{}
}
if sticky && !common.IsInList("_NET_WM_STATE_STICKY", states) {
states = append(states, "_NET_WM_STATE_STICKY")
}

// Window geometry (dimensions of the window)
geom, err := xwindow.New(X, w).DecorGeometry()
Expand Down

0 comments on commit 455055f

Please sign in to comment.