2zw

2zw - X11 Windowmanager

Files | Log | Commits | Refs | README


8b39953

Author: erikbackman

Date: 2024-02-10

Subject: Remember window attributes when going fullscreen

Diff

commit 8b399535775069a4b0dcc3c619cf8493a3dc1ee7
Author: erikbackman <erikbackman@users.noreply.github.com>
Date:   Sat Feb 10 14:48:31 2024 +0100

    Remember window attributes when going fullscreen

diff --git a/src/main.zig b/src/main.zig
index 998bfe6..04b0efb 100644
--- a/src/main.zig
+++ b/src/main.zig
@@ -394,6 +394,11 @@ fn winFullscreen() void {
         if (!c.full) {
             var attributes: C.XWindowAttributes = undefined;
             _ = C.XGetWindowAttributes(display, c.w, &attributes);
+            node.data.wx = attributes.x;
+            node.data.wy = attributes.y;
+            node.data.ww = attributes.width;
+            node.data.wh = attributes.height;
+
             _ = C.XMoveResizeWindow(display, c.w, 0, 0, screenW, screenH);
             node.data.full = true;
         } else {