git.lucas.co / hou-control
SideFX Houdini customization package
git clone https://git.lucas.co/hou-control.git

commit35780a70dcc91576140b6ceb49490846e9064a40
parent745bb1f776
authorLucas Galante <[email protected]>
date2026-09-11 14:54
hc: float the spreadsheet panel as a dialog too

Same tiling-WM problem as HC Settings: the Toggle Spreadsheet floater
came up as a normal toplevel and got the main window's tile. newFloatingPane
now takes an optional size -- passed to createFloatingPanel() and then to
floatWindow() -- and toggleSpreadsheet asks for 1400x900. The New Floating
Pane dialog still passes no size, so those stay full working panes with
Houdini's default behaviour.

Co-Authored-By: Claude Opus 5 <[email protected]>

 python3.13libs/hc/hcsession.py | 33 +++++++++++++++++++++++++++++----
 1 file changed, 29 insertions(+), 4 deletions(-)

diff --git a/python3.13libs/hc/hcsession.py b/python3.13libs/hc/hcsession.py
index b1fb162..410d059 100644
--- a/python3.13libs/hc/hcsession.py
+++ b/python3.13libs/hc/hcsession.py
@@ -12,6 +12,7 @@ from .hccommands import command
 
 
 SETTINGS_PANEL_SIZE = (720, 600)
+SPREADSHEET_PANEL_SIZE = (1400, 900)
 
 
 def floatWindow(window, size=None):
@@ -321,8 +322,12 @@ class HCSession:
                         hou.ui.setStatusMessage("Closed Spreadsheet")
                         return
 
-        # If not found, open a new floating one with DetailsView
-        self.newFloatingPane(hou.paneTabType.DetailsView)
+        # If not found, open a new floating one with DetailsView. It asks to
+        # be floated: like HC Settings, a tiling WM would otherwise give the
+        # spreadsheet the same tile -- and so the same size -- as the main
+        # Houdini window.
+        self.newFloatingPane(hou.paneTabType.DetailsView,
+                             size=SPREADSHEET_PANEL_SIZE)
         hou.ui.setStatusMessage("Opened Spreadsheet")
 
     @command("Refresh Split Handles")
@@ -781,11 +786,31 @@ class HCSession:
         anchor_geometry = pane.qtScreenGeometry()
         return self._paneTabTypeDialog("New Tab", pane.newTab, anchor_geometry=anchor_geometry)
 
-    def newFloatingPane(self, tab_type):
-        panel = self.desktop().createFloatingPanel(tab_type, immediate=True)
+    def newFloatingPane(self, tab_type, size=None):
+        """Create a floating panel holding one tab of `tab_type`.
+
+        Pass `size` for a panel that should be a free-floating utility window
+        rather than another tile: it is handed to createFloatingPanel() and the
+        toplevel is marked as a dialog (see floatWindow), without which a
+        tiling WM resizes it to the main window's tile. Left None, the panel
+        keeps Houdini's default behaviour -- which is what the New Floating
+        Pane dialog wants, since those are full working panes.
+        """
+        kwargs = {"immediate": True}
+        if size is not None:
+            kwargs["size"] = size
+        panel = self.desktop().createFloatingPanel(tab_type, **kwargs)
         panel.attachToDesktop(True)
         for pane in panel.panes():
             HCPane(pane).initializeObject(pane)
+        if size is not None:
+            tabs = panel.paneTabs()
+            window = tabs[0].qtParentWindow() if tabs else None
+            if window is not None:
+                floatWindow(window, size=size)
+                window.show()
+                window.raise_()
+                window.activateWindow()
         hou.ui.setStatusMessage('Created new floating pane', hou.severityType.Message)
         return panel