From 4c7b847c00c20232d62213cda22f08636c8abe1b Mon Sep 17 00:00:00 2001 From: Murray Stevenson <50844517+murraystevenson@users.noreply.github.com> Date: Mon, 9 Feb 2026 15:38:22 -0800 Subject: [PATCH 1/2] Window : Do not constrain windows that are entirely offscreen We currently have a bug in __constrainToScreen where windows that are entirely offscreen will be offset by their width and height, potentially moving them even further offscreen. Rather than constraining offscreen windows in this commit, for testing purposes I'm leaving them at their original position and logging some info with the hope to track down an odd configuration issue at Cinesite. --- python/GafferUI/Window.py | 33 +++++++++++++++++++++------------ 1 file changed, 21 insertions(+), 12 deletions(-) diff --git a/python/GafferUI/Window.py b/python/GafferUI/Window.py index 385388e2a2e..ec857ef7f09 100644 --- a/python/GafferUI/Window.py +++ b/python/GafferUI/Window.py @@ -40,6 +40,8 @@ import warnings import imath +import IECore + import GafferUI import Gaffer @@ -299,22 +301,29 @@ def __constrainToScreen( self, position ) : windowRect = self._qtWidget().frameGeometry() windowRect.moveTo( position ) - # Determine the offset and which direction to move to stay on screen, - # based on this size difference and which co-ordinate changed in the - # intersected frame + if windowRect.intersects( screenRect ) : - intersection = windowRect.intersected( screenRect ) - difference = windowRect.size() - intersection.size() + # Determine the offset and which direction to move to stay on screen, + # based on this size difference and which co-ordinate changed in the + # intersected frame - signX = -1 if intersection.left() == windowRect.left() else 1 - signY = -1 if intersection.top() == windowRect.top() else 1 + intersection = windowRect.intersected( screenRect ) + difference = windowRect.size() - intersection.size() - offset = QtCore.QPoint( - signX * difference.width(), - signY * difference.height() - ) + signX = -1 if intersection.left() == windowRect.left() else 1 + signY = -1 if intersection.top() == windowRect.top() else 1 + + offset = QtCore.QPoint( + signX * difference.width(), + signY * difference.height() + ) + + newPosition = position + offset + + else : - newPosition = position + offset + IECore.msg( IECore.Msg.Level.Warning, "Window.__constrainToScreen", "Window is outside screen's available geometry. screen: {} screenRect: {} windowRect: {}".format( screen.name(), screenRect, windowRect ) ) + newPosition = position # Bottom-right corrections may have moved us off to the top-left, # constrain to the screen origin. From a67b15873dc5f6e3116ba5f62f69c72094338721 Mon Sep 17 00:00:00 2001 From: Murray Stevenson <50844517+murraystevenson@users.noreply.github.com> Date: Mon, 9 Feb 2026 15:40:44 -0800 Subject: [PATCH 2/2] PopupWindow : Log popup positioning --- python/GafferUI/PopupWindow.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/python/GafferUI/PopupWindow.py b/python/GafferUI/PopupWindow.py index 73009eb77fd..c849a34f8aa 100644 --- a/python/GafferUI/PopupWindow.py +++ b/python/GafferUI/PopupWindow.py @@ -72,7 +72,9 @@ def popup( self, center = None, parent = None ) : self.setVisible( True ) size = self._qtWidget().sizeHint() + print( "PopupWindow.popup : Attempting to move popup to {}".format( center - imath.V2i( size.width() / 2, size.height() / 2 ) ) ) self.setPosition( center - imath.V2i( size.width() / 2, size.height() / 2 ) ) + print( "PopupWindow.popup : Popup moved to {}".format( self.getPosition() ) ) ## Reimplemented from Widget to report the parent passed to `popup()`. def parent( self ) :