Prior to this change, secondary windows could be minimized by
right-clicking on the title bar, but not maximized. Maximizing is
very useful for multi-monitor setups. The popup menu includes restore
as well. To enable these actions directly from the titlebar without
navigating a popup, the 'ToolWindow' style would have to be removed
because it inhibits the standard system buttons.
Prior to this change, 'workspaceWidth' was not retrieved with screen
coordinates so the width was sometimes wrong depending on which monitor
of a virtual screen the window was on. Sometimes the 'maxWidth'
calculated from this was negative which led to a very bad place.
When you select 'Dont Save' on the close dialog of secondary windows,
the projectSource is left with changes and no SourceViewPanel, and then
VerifyModifiedBuffers will fail. This fix uses refactored code from
CloseDocument, 'RevertSourceViewPanel', to revert changes on close.
When closing secondary IDE Windows that have changes for inactive
sourceViewPanels the current logic checks 'mWidgetWindow' against
the window to decide if it should be included in the close query.
Inactive tabs always have null mWidgetWindows so the changes are
not seen. This fixes the 'Save' button case for inactive
SourceViewPanels by using per-window visitors.
In order to fix an issue with closing secondary windows with changed,
inactive 'SourceViewPanel's we need a way to visit the tabs of just a
specific Window. The current 'SecondaryAllowClose' logic that relies
on checking 'mWidgetWindow' is broken. This commit just introduces the
needed utility methods and refactors the all-window methods to use them.
When you close an inactive IDE tab, the 'nextTab' is null instead of the
already active one. This then results in the entire pane closing even
with tabs remaining. Ensuring nextTab is always valid keeps the pane open.
This may fix issue #619 as the behavior described is similar.