Discussion:
(Regression in r37057 by "tommaso") Crash on quit when fullscreen and AdvFind dialog open.
(too old to reply)
Tommaso Cucinotta
2011-01-04 23:21:30 UTC
Permalink
'''\CF\Ae\[Right]L\Cq'''\[!Loop]
1) Press Cntl-Shift-F to open the AdvFind dialog (KK: \CF)
2) Press F11 to go Fullscreen (KK: \Ae)
3) Press Cntl-Q to quit... (KK: \Cq)
I then get the following crash.
Arch: x86_64
Revision: 37080
Regression in r37057
Ok, let's give up with the assumption that the Adv Search dialog can
only be open when a main document exists and is open. In fact the
following sequence is sufficient for violating it:
1) C-N (new doc)
2) C-S-f (Adv Search panel)
3) C-w (close doc)

[ and now we have the Adv Search panel open with no document open ]

Even though I don't understand why it doesn't crash now if I do 4)
Alt-Tab twice (probably the showEvent() is not triggered in this simple
scenario), anyway, the attached patch should prevent any further
potential misbehavior like this.

If anyone likes it, I'll commit it.

Bye,

T.
Jean-Marc Lasgouttes
2011-01-05 10:46:52 UTC
Permalink
Post by Tommaso Cucinotta
Ok, let's give up with the assumption that the Adv Search dialog can
only be open when a main document exists and is open. In fact the
1) C-N (new doc)
2) C-S-f (Adv Search panel)
3) C-w (close doc)
Don't we have a way to have document-dialog close automatically in this
case?

JMarc
Tommaso Cucinotta
2011-01-05 14:42:19 UTC
Permalink
Post by Jean-Marc Lasgouttes
Post by Tommaso Cucinotta
Ok, let's give up with the assumption that the Adv Search dialog can
only be open when a main document exists and is open. In fact the
1) C-N (new doc)
2) C-S-f (Adv Search panel)
3) C-w (close doc)
Don't we have a way to have document-dialog close automatically in
this case?
Just to mention that this is not specific of Adv Search. For example, if
you don't
create a new document nor open any one, LyX has the "TOC" button disabled
and so I cannot show the TOC dialog.
However:

1) C-N
2) press the "TOC" Button in the toolbar
3) C-w (close doc)

and now I have the TOC dialog open with no documents open in LyX.

T.
Vincent van Ravesteijn
2011-01-05 15:05:42 UTC
Permalink
Post by Tommaso Cucinotta
Post by Jean-Marc Lasgouttes
Post by Tommaso Cucinotta
Ok, let's give up with the assumption that the Adv Search dialog can
only be open when a main document exists and is open.
I prefer to give up. See also below.
Post by Tommaso Cucinotta
Post by Jean-Marc Lasgouttes
Don't we have a way to have document-dialog close automatically in
this case?
We only do that for dialogs that are buffer-dependent and which have an
inset associated with them. Thus closing the document, will destroy the
inset and will close the related dialog.
Post by Tommaso Cucinotta
Just to mention that this is not specific of Adv Search. For example,
if you don't
create a new document nor open any one, LyX has the "TOC" button disabled
and so I cannot show the TOC dialog.
Yes, this could be enabled as well, just a matter of taste.
Post by Tommaso Cucinotta
1) C-N
2) press the "TOC" Button in the toolbar
3) C-w (close doc)
and now I have the TOC dialog open with no documents open in LyX.
This is correct and I just recently fixed the fact that the outliner
closed when closing a document with a TOC inset in it.

I prefer docked widgets to be allowed without a document open. If you
are used to working with the outliner, you want the oultiner open
always. So if you close your document and open it again, you don't want
to manually show the outliner over and over again.

A side-effect also was that we don't remember the outliner visibility
status on exit, because all documents were closed on exit and also the
outliner then. I think you want the find-replace widget also to be
remembered to the next session ?

So, I would just suggest that leaving the widget open but disenabled is
the wanted behaviour.

Vincent
Tommaso Cucinotta
2011-01-05 15:13:57 UTC
Permalink
Post by Vincent van Ravesteijn
A side-effect also was that we don't remember the outliner visibility
status on exit, because all documents were closed on exit and also the
outliner then. I think you want the find-replace widget also to be
remembered to the next session ?
I wish I knew how to do that. What should I look at ?
Post by Vincent van Ravesteijn
So, I would just suggest that leaving the widget open but disenabled
is the wanted behaviour.
Yes, except that we have the "Search all manuals" scope which, in
principle, may be triggered without any doc open :-) -- in principle.

T.
Vincent van Ravesteijn
2011-01-06 08:51:23 UTC
Permalink
Post by Tommaso Cucinotta
Post by Vincent van Ravesteijn
A side-effect also was that we don't remember the outliner visibility
status on exit, because all documents were closed on exit and also the
outliner then. I think you want the find-replace widget also to be
remembered to the next session ?
I wish I knew how to do that. What should I look at ?
You should look at r37121 (http://www.lyx.org/trac/changeset/37121).

In principle this works out-of-the-box because the settings are
restored by Qt. However, the parameter of the dialog name you give to
the constructor of DockView should match the name you use as the
parameter for LFUN_DIALOG_SHOW. That is "findreplaceadv".

Then, you only need to build the dialog before Qt is coming into
action to restore the geometry/visibility.

Vincent
Vincent van Ravesteijn
2011-01-06 08:58:23 UTC
Permalink
Post by Vincent van Ravesteijn
In principle this works out-of-the-box because the settings are
restored by Qt.
What I forgot to say is:

If you also want to remember the settings in the dialog, like
word-wrap, case-sensitivity and so on, you need to implement the
following two functions:

- void FindAndReplace::restoreSession()
- void FindAndReplace::saveSession() const

See for instance the corresponding functions in GuiViewSource.

Vincent
Vincent van Ravesteijn
2011-01-06 08:59:13 UTC
Permalink
Post by Vincent van Ravesteijn
In principle this works out-of-the-box because the settings are
restored by Qt.
Last,

Have you ever thought about a search history ?

Vincent

Abdelrazak Younes
2011-01-06 07:32:23 UTC
Permalink
Post by Vincent van Ravesteijn
Post by Jean-Marc Lasgouttes
Post by Tommaso Cucinotta
Ok, let's give up with the assumption that the Adv Search dialog can
only be open when a main document exists and is open.
I prefer to give up. See also below.
Me too.
Post by Vincent van Ravesteijn
Post by Jean-Marc Lasgouttes
Don't we have a way to have document-dialog close automatically in
this case?
We only do that for dialogs that are buffer-dependent and which have
an inset associated with them. Thus closing the document, will destroy
the inset and will close the related dialog.
Only for GuiDialog connected dialogs. InsetDialog based dialog will not
close, they will disable themselves.

Abdel.
Tommaso Cucinotta
2011-01-05 15:10:14 UTC
Permalink
Post by Tommaso Cucinotta
If anyone likes it, I'll commit it.
Anyway, being a fix of a crash, I thought it is ok to commit anycase
(r37115).
(if later we come up with a means for closing the dialog when last
doc is closed, then this code is harmless).

T.
Loading...