Skip to content

Commit

Permalink
fix(#1): bspwm overrides the position after xcb_window_map
Browse files Browse the repository at this point in the history
  • Loading branch information
moolen committed Sep 15, 2018
1 parent c2a08ea commit d887b4f
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (
"github.com/BurntSushi/xgb"
"github.com/BurntSushi/xgb/xproto"
"github.com/BurntSushi/xgbutil"
"github.com/BurntSushi/xgbutil/ewmh"
"github.com/BurntSushi/xgbutil/icccm"
"github.com/BurntSushi/xgbutil/keybind"
"github.com/BurntSushi/xgbutil/mousebind"
Expand Down Expand Up @@ -167,11 +168,20 @@ func loop(screens []*screen, permitEscape bool, customPassword string) error {
return err
}

err = ewmh.WmStateReq(Xu, win.Id, ewmh.StateToggle,
"_NET_WM_STATE_FULLSCREEN")
if err != nil {
return err
}

// Paint our image before mapping.
ximg.XSurfaceSet(win.Id)
ximg.XDraw()
ximg.XPaint(win.Id)
win.Map()

// some WM override this position after mapping
win.Move(screen.X(), screen.Y())
}

// main loop
Expand Down

0 comments on commit d887b4f

Please sign in to comment.