From 23f7546e1f3e98fc863a7382463feb550d52c838 Mon Sep 17 00:00:00 2001 From: Luca Toniolo <10792599+grandixximo@users.noreply.github.com> Date: Tue, 16 Jun 2026 10:01:00 +0800 Subject: [PATCH] touchy: open at a sensible minimum window height Touchy sizes its window to the active notebook tab's preferred size on first map. The Startup tab is the smallest of the six (just the MPG wheel and Cycle Start), so the window opens around 984 by 274 pixels and the other tabs (Status, Auto, Preferences) are clipped until the user resizes manually. Floor the initial height at 500 pixels in _fit_to_monitor's default branch so all tabs are usable out of the box, capped at the work area so we never open off-screen. A 600 pixel touchscreen panel with a top and bottom bar still has the room; on a smaller display the existing monitor cap keeps the window on-screen. The minimum size request is untouched, so the user can still resize smaller. --- src/emc/usr_intf/touchy/touchy.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/emc/usr_intf/touchy/touchy.py b/src/emc/usr_intf/touchy/touchy.py index bd36c0b3d61..a45cf9c4026 100755 --- a/src/emc/usr_intf/touchy/touchy.py +++ b/src/emc/usr_intf/touchy/touchy.py @@ -851,10 +851,13 @@ def _fit_to_monitor(self, win, event, scroller, child): # Open at the content size, capped to the screen; this avoids an # off-screen window without forcing a screen-sized minimum. A # user-saved geometry (window_geometry pref) takes precedence. + # Floor the height at 500 px: the Startup tab is the smallest + # and would otherwise size the window to ~270 px tall and clip + # all the other tabs. if self.window_geometry == "default": nat = child.get_preferred_size()[1] - win.resize(min(nat.width, area.width), - min(nat.height, area.height)) + target_h = min(max(nat.height, 500), area.height) + win.resize(min(nat.width, area.width), target_h) GLib.idle_add(self._offer_fit, child, area) except Exception: pass