Merge lp:~alan-griffiths/miral/fix-1668651 into lp:miral
| Status: | Merged |
|---|---|
| Approved by: | Gerry Boland on 2017-03-02 |
| Approved revision: | 536 |
| Merged at revision: | 525 |
| Proposed branch: | lp:~alan-griffiths/miral/fix-1668651 |
| Merge into: | lp:miral |
| Diff against target: |
430 lines (+120/-41) 10 files modified
miral-shell/decoration_provider.cpp (+8/-8) miral-shell/decoration_provider.h (+0/-2) miral-shell/shell_main.cpp (+6/-2) miral-shell/titlebar_window_manager.cpp (+3/-9) miral-shell/titlebar_window_manager.h (+5/-1) miral/CMakeLists.txt (+2/-1) miral/internal_client.cpp (+61/-9) miral/join_client_threads.h (+24/-0) miral/runner.cpp (+11/-2) miral/symbols.map (+0/-7) |
| To merge this branch: | bzr merge lp:~alan-griffiths/miral/fix-1668651 |
| Related bugs: |
| Reviewer | Review Type | Date Requested | Status |
|---|---|---|---|
| Gerry Boland | 2017-03-01 | Approve on 2017-03-02 | |
|
Review via email:
|
|||
Commit Message
miral-shell shutdown was a mess. Fixed.
Description of the Change
miral-shell shutdown was a mess.
After fixing the segfault, the server closed down first leading to SIGHUP causing the server to shutdown with EXIT_FAILURE.
So changed the lifecycle callback.
Then operations on the decorations "client" were failing (because the connection had closed). So made it possible for the shell main() to join the client threads.
The server now closes cleanly.
Not sure this is the cleanest code, so any suggestions are welcome.
| Alan Griffiths (alan-griffiths) wrote : | # |
| Alan Griffiths (alan-griffiths) wrote : | # |
> That affects 16.04LTS (Mir 0.21) but is "only" a crash on exit. I don't think
> we need to block. (But I'll think about possible solutions.)
Found a solution
| Alan Griffiths (alan-griffiths) wrote : | # |
I've considered maintaining an internal list of InternalClientR
That would simplify the main() functions (miral-kiosk needs nothing, miral-shell just needs the hook to close the decorations provider).
It would also be possible to introduce a mechanism to notify internal clients of a close request by supplying overloads that provide a callback for this purpose.
But all that is providing convenience for simple usecases when the mechanisms provided here are needed to address the general case.

Note that on versions of Mir prior to 0.24 closing the server with a signal (e.g. SIGTERM) still leads to a segfault. That's because we lack mir::server: :add_stop_ callback( ) - or any way to hook into that mechanism for closing the server.
That affects 16.04LTS (Mir 0.21) but is "only" a crash on exit. I don't think we need to block. (But I'll think about possible solutions.)