From 9a9f4201ba4fa69ec81a8607cabc61a04ce06ddb Mon Sep 17 00:00:00 2001 From: Jonny-O Date: Tue, 11 Aug 2026 16:55:45 +0000 Subject: [PATCH] Fix window sizing and maximize on Linux The window could not be resized to fit the screen or maximized on Ubuntu 26.04. Measured on the target hardware, the cause was minHeight: 850 against a 768px-tall display - the window's minimum was 82px taller than the screen, so shrinking it to fit was impossible and maximize was an unsatisfiable constraint. Upstream's own comment "1366 * 768 == minimum to cater for" sits directly above that line. - Lower window minimums from 1000x850 to 800x600. - Clamp the initial window size to the available work area. - Use native window decorations on Linux, so the window manager owns maximize, resize, snapping and tiling. A frameless window gets no compositor resize edges under Wayland. Windows and macOS keep the custom titlebar. - Hide the in-page titlebar on Linux, before first paint in index.html so no duplicate titlebar flashes on launch, and via the new status.driver.nativeframe flag in websocket.js. - Bind F11 to toggle fullscreen, since hiding the in-page titlebar removes the only fullscreen control. - Track maximized state from window events instead of isMaximized(), which is not dependable under Wayland. - Show the window from ready-to-show, with a 10s fallback timer, so an unpainted frame is never put on screen first. - Use event.preventDefault() in the close handler; returning false does not cancel an Electron close, so close-to-tray was broken. - Report status.driver.operatingsystem correctly on Linux and on an argument-less Windows launch. Verified on Ubuntu 26.04 (GNOME 50, Wayland) against a 1280x768 display. WM_NORMAL_HINTS min goes 1000x850 -> 800x600, the window opens at 1000x699 fully on screen instead of 1000x850 hanging 114px off the bottom, and maximize/unmaximize/resize all behave. Add GPL-3.0 section 5(a) modification notices to the three changed source files, and a README section documenting the fork and the GPL/AGPL discrepancy inherited from upstream. LICENSE and package.json are deliberately unmodified. Co-Authored-By: Claude Opus 5 --- README.md | 52 ++++++++++++++++ app/index.html | 21 +++++++ app/js/websocket.js | 17 +++++- index.js | 145 ++++++++++++++++++++++++++++++++++++++++---- 4 files changed, 222 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index 3522fbaf..7897e64c 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,58 @@ # OpenBuilds CONTROL OpenBuilds CONTROL - Grbl Host / Interface for all CNC style machines running Grbl +--- + +## About this fork + +**This is a modified fork of OpenBuilds CONTROL, not the original.** The upstream +project is at https://github.com/OpenBuilds/OpenBuilds-CONTROL. + +Changes in this fork, made 2026-08-11, are confined to window management on Linux- +based hosts: + +- **Native window decorations on Linux.** Upstream creates a frameless window and + draws its own titlebar. Under Wayland a frameless window gets no compositor + resize edges and does not reliably report its maximized state, so the window + manager now draws the titlebar on Linux. Windows and macOS are unchanged. +- **Window minimums lowered from 1000x850 to 800x600.** This was a problem for my + CNC computer as it uses a 1366x768 display - upstream's own comment reads + `1366 * 768 == minimum to cater for` directly above `minHeight: 850`. The window + therefore could not be shrunk to fit the screen, and maximizing was an + unsatisfiable constraint. +- **Initial size clamped to the available work area**, so the window opens at a + size that fits the screen. +- **Maximized state tracked from window events** rather than `isMaximized()`, + which is unreliable under Wayland. +- **Close-to-tray fixed** to use `event.preventDefault()`; returning `false` does + not cancel an Electron close. + +Modified files carry notices at the top: `index.js`, `app/index.html`, +`app/js/websocket.js`. + +Verified on Ubuntu 26.04 (GNOME 50, Wayland) against a 1280x768 display. + +## License + +This project is licensed under the **GNU General Public License v3.0**; the full +text is in [LICENSE](LICENSE) and is unmodified from upstream. + +Note a discrepancy inherited from upstream: `LICENSE` contains the GPL-3.0 text, +while `package.json` declares `"license": "AGPL-3.0"`. Both have been present +since upstream's first commit, and the company behind OpenBuilds is no longer +operating, so there is no authority available to resolve which was intended. + +Neither file has been altered in this fork. Because AGPL-3.0's obligations are a +superset of GPL-3.0's - AGPL adds section 13, covering source provision to users +who interact with the software over a network - **this fork is distributed in +compliance with the stricter AGPL-3.0 reading**, which satisfies the GPL-3.0 +reading as well. Complete corresponding source is published in this repository. + +Note that OpenBuilds CONTROL serves its user interface over HTTP on port 3000. +If you run a modified version and allow others to reach that interface over a +network, the AGPL-3.0 reading would require you to offer those users the source +of your modified version from within the application itself. + ## Download #### Latest Version diff --git a/app/index.html b/app/index.html index 3b3bab8d..90b6ce49 100644 --- a/app/index.html +++ b/app/index.html @@ -1,4 +1,14 @@ + @@ -43,6 +53,17 @@ +