Skip to content

Commit

Permalink
send proper XConfigureRequest upon maximizing a window
Browse files Browse the repository at this point in the history
  • Loading branch information
user committed May 30, 2024
1 parent 95837e0 commit a6ef682
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/events/motionnotify.nim
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ proc handleMotionNotify*(self: var Wm; ev: XMotionEvent): void =
let conf = XConfigureEvent(theType: ConfigureNotify, display: self.dpy,
event: client.window, window: client.window, x: motionInfo.attr.x + (
if motionInfo.start.button == 1: xdiff else: 0), y: motionInfo.attr.y + (
if motionInfo.start.button == 1: ydiff else: 0), width: cint 1.max(
if motionInfo.start.button == 1: ydiff else: 0) + client.frameHeight.int32, width: cint 1.max(
motionInfo.attr.width + (if motionInfo.start.button ==
3: xdiff else: 0)).cuint, height: cint 1.max(
motionInfo.attr.height +
Expand Down
7 changes: 7 additions & 0 deletions src/wm.nim
Original file line number Diff line number Diff line change
Expand Up @@ -1076,6 +1076,13 @@ proc maximizeClient*(
0
)

let conf = XConfigureEvent(theType: ConfigureNotify, display: self.dpy,
event: client.window, window: client.window, x: (strut.left + x.uint).cint,
y: (strut.top + y.uint + client.frameHeight.uint).cint, width: masterWidth.cint,
height: (height - strut.top - strut.bottom - self.config.borderWidth.cuint*2 - client.frameHeight).cint)
discard self.dpy.XSendEvent(client.window, false, StructureNotifyMask, cast[
ptr XEvent](unsafeAddr conf))

discard self.dpy.XSync false

discard self.dpy.XFlush
Expand Down

0 comments on commit a6ef682

Please sign in to comment.