@@ -1349,6 +1349,7 @@ on revIDEInitialiseIDELibrary
13491349 revIDEPropertyLibraryInitialise
13501350
13511351 ideSubscribe "ideExtensionsChanged"
1352+ ideSubscribe "ideDesktopChanged"
13521353end revIDEInitialiseIDELibrary
13531354
13541355on ideExtensionsChanged
@@ -9678,8 +9679,9 @@ command revIDESuspendDevelopmentTools
96789679 put tClosedStacksList into gREVRestore ["stacks" ]
96799680
96809681 -- Reset the windowBoundingRect
9681- put the windowBoundingRect into gREVRestore ["windowBoundingRect" ]
9682- set the windowBoundingRect to 0 ,0 ,item 3 to 4 of the windowBoundingRect
9682+ local tWindowRect
9683+ put revIDEStackScreenRect(the short name of the topStack, true ) into tWindowRect
9684+ set the windowBoundingRect to tWindowRect
96839685
96849686 -- Show the restore dialog
96859687 lock recent
@@ -9746,7 +9748,7 @@ command revIDERestoreDevelopmentTools
97469748 set the defaultMenuBar to the long id of group "revMenuBar" of stack revIDEPaletteToStackName("menubar" )
97479749 set the width of stack "revMenuBar" to the width of stack "revMenuBar" + 1 -- bug 1806
97489750 set the width of stack "revMenuBar" to the width of stack "revMenuBar" - 1
9749- set the windowBoundingRect to gREVRestore [ "windowBoundingRect" ]
9751+ ideSetWindowBoundingRect
97509752 choose gREVRestore ["tool" ]
97519753
97529754 -- Restore the script debug mode
@@ -12222,3 +12224,42 @@ end ideShouldShowUpgradeOptions
1222212224private function hasConnection
1222312225 return url("http://google.com/" ) is not empty
1222412226end hasConnection
12227+
12228+ on ideDesktopChanged
12229+ ideSetWindowBoundingRect
12230+ end ideDesktopChanged
12231+
12232+ /* *
12233+
12234+ Update the window bounding rect for the current IDE palette layout
12235+
12236+ */
12237+
12238+ command ideSetWindowBoundingRect
12239+ local tMenuBar
12240+ put revIDEPaletteToStackName("menubar" ) into tMenuBar
12241+
12242+ local tTools
12243+ put revIDEPaletteToStackName("tools" ) into tTools
12244+
12245+ local tToolsSlop
12246+ put the width of stack tTools + 50 into tToolsSlop
12247+
12248+ local tWindowRect
12249+ put revIDEStackScreenRect(tMenuBar , true ) into tWindowRect
12250+ if tWindowRect is not empty then
12251+ if the screen of stack tTools is the screen of stack tMenubar then
12252+ if the right of stack tTools < (item 1 of tWindowRect + tToolsSlop ) then
12253+ put the right of stack tTools + 5 into item 1 of tWindowRect
12254+ else if the left of stack tTools > (item 3 of tWindowRect - tToolsSlop ) then
12255+ put the left of stack tTools - 5 into item 3 of tWindowRect
12256+ end if
12257+ end if
12258+
12259+ -- revMenubar may not be visible on macOS with text and icons off
12260+ if the visible of stack tMenubar then
12261+ put the bottom of stack tMenuBar + 5 into item 2 of tWindowRect
12262+ end if
12263+ set the windowBoundingRect to tWindowRect
12264+ end if
12265+ end ideSetWindowBoundingRect
0 commit comments