Stefan Schimanski wrote:
Here is a series of patches
1) which add an open-in-window mode (enabled on Mac by default)
That's fine.
2) which keep LyX running, even after closing the last window on Mac
Not fine, see below.
3) which close a window when the last tab is closed on Mac
That should be a preference too (default to true on Mac).
3) which add a preference option to change (1)
For (2) I keep the GuiView with id 0 in memory and only hide it. It is
then reused when the user requests another window.
That's wrong as the GuiView with id 0 may be closed _before_ id 1. If
you want to go this way, you should hide the last visible GuiView
instead. BUT, I don't think you should go this way:
I think a new GuiView should be created on demand. You want to modify
case QEvent::FileOpen() in GuiApplication::event(). I created this entry
to fix file opening by double-clicking on Mac when LyX is not started
(see comment in source code). To recap my thinking:
- If LyX is already started but there is no GuiView avalaible,
LFUN_FILE_OPEN should take care of creating one.
=> This means that GuiApplication::dispatch() should handle
LFUN_FILE_OPEN instead of GuiView.
- If LyX is already started and there is a current GuiView and you want
to open a file; two options:
1. create a new GuiView for the file: this is you feature 1),
2. open the file in current GuiView.
- If LyX is not yet started and the user double-click on icon to open a
file, QEvent::FileOpen() should be acknowledged and delayed.
I think you can manage from here.
Abdel.