How to keep UNO applications connected after closing LibreOffice

Samuel Mehrbrodt Samuel.Mehrbrodt at cib.de
Tue Sep 20 12:35:16 UTC 2016


Am 20.09.2016 um 11:56 schrieb Stephan Bergmann:

On 09/20/2016 08:30 AM, Samuel Mehrbrodt wrote:


Am 19.09.2016 um 17:29 schrieb Stephan Bergmann:


On 09/19/2016 05:17 PM, Samuel Mehrbrodt wrote:


It turned out we need to implement both. The first option was fine when
only closing the window - but we also want to be able to close the
visible frames with "File->Exit" while keeping the process running.


Do we?  I think there is probably a difference in what we can imply as
user-expected behavior between closing the last window (via "Window -
Close Window" or whatever desktop-environment--specific trigger) and
terminating LO (via "File - Exit LibreOffice").



Well, with my patches, there will be a difference. Closing the window
will leave the process running, and chosing File->Exit will kill the
process.

What I did change in my second patch is the behavior of File->Exit when
using the TerminationVetoException.
Before it prevented closing the windows *and* terminating the process -
after my patch it only prevents termination.



But throwing a TerminationVetoException isn't something that the user
will be aware of.  Today, when doing "File - Exit LibreOffice", the user
is made aware that terminating LO does not work (because of external
connections and TerminationVetoExceptions) by the fact that its windows
will not close (whether or not that is a good way of communicating this
to the user).  In the future, the user would no longer be made aware
(while I think they should be, in whatever form).

I understand your point. On the other hand, the name TerminationVetoException suggests that it prevents termination - nothing more.
If people still want to prevent closing windows they can always use CloseVetoException.

As an external application developer, I just want to make sure that nobody can exit the soffice process, but I want users to still be able to use the "normal" LibreOffice installation as they are used to.
For the user it would be a bug that they cannot close the last window. He doesn't know that there is some other application that demands a running office instance.

But even with my patch, you can still have the behavior that you describe (the user should notice that the process keeps running). You just need to also throw the CloseVetoException:

Maybe this table explains it a bit:

Wanted behavior
        Before my patch
        After my patch

I want to forbid closing windows
        CloseVetoException
        CloseVetoException

I want to forbid terminating the Office (but allow closing windows)
        ?? -> Nothing here
        TerminationVetoException

I want to forbid terminating the Office and closing windows
        TerminationVetoException
        TerminationVetoException + CloseVetoException


I can't see any real downside of this, except that maybe some people need to make some changes in their application if they want the same behavior as before.
Anyway, if you have any other suggestion how to achieve this, I'm open for it.

Thanks
Samuel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/libreoffice/attachments/20160920/425165ae/attachment.html>


More information about the LibreOffice mailing list