CSSTUDIO-1997 Add option to open most recently focused tab when closing a tab#2759
Conversation
|
This is quite intuitive, I would even be in favour of making the default |
I'd go even further: Make that THE behavior. No added preference, that's just how it'll be. For the implementation, I'm worried that |
Can tabs be closed without invoking the event handler set by |
|
I have now made the behavior the only behavior. |
I'm not 100% sure: Is that only called when clicking the 'x' on the tab? Or also when closing the window? Regarding setOnCloseRequest, you add that call in DockItem line ~179, but there's also a call around line 597 for addCloseCheck which will now be disabled because |
…us` in OnClose event handler of `DockItem`.
You are right that the OnCloseRequest event-handler is not called when closing the window. I have added the following code to However, isn't the whole
That is a good point! In the PR #2758 (CSSTUDIO-1987 New "Unsaved Changes" confirmation dialog) I have changed this behavior: instead the close-request handler is installed unconditionally in the constructor of For the time being, I have now modified I propose that this temporary fix be merged in this PR, and that I then combine the two event-handlers into one event-handler that is installed unconditionally in the constructor of |
OK, let's merge this one first, then you update the other and test it for a little while, then we merge the other. |
That sounds like a plan! |
|
With the new fixes in place, are there still concerns about memory leakages? And are there any other concerns? Or can I go ahead and merge this version? |
|
Go ahead |
This merge-request adds the option
org.phoebus.ui/open_previous_tab_when_closing_tabto Phoebus. Whenorg.phoebus.ui/open_previous_tab_when_closing_tab=trueis set (the default isfalse), then Phoebus will set the focus on the most recently focused tab when closing the active tab. If a tab is closed that is not active, the focus remains unchanged.