Merge lp:~robertcarr/mir/focus-tell-dont-ask into lp:mir
Status: | Superseded |
---|---|
Proposed branch: | lp:~robertcarr/mir/focus-tell-dont-ask |
Merge into: | lp:mir |
Prerequisite: | lp:~robertcarr/mir/socket-messenger-reporting |
Diff against target: |
345 lines (+106/-100) 9 files modified
include/server/mir/shell/application_session.h (+6/-0) include/server/mir/shell/default_focus_mechanism.h (+2/-2) include/server/mir/shell/session.h (+5/-0) include/test/mir_test_doubles/mock_shell_session.h (+3/-0) include/test/mir_test_doubles/stub_shell_session.h (+8/-0) src/server/shell/application_session.cpp (+39/-3) src/server/shell/default_focus_mechanism.cpp (+10/-18) tests/acceptance-tests/test_client_focus_notification.cpp (+3/-1) tests/unit-tests/shell/test_default_focus_mechanism.cpp (+30/-76) |
To merge this branch: | bzr merge lp:~robertcarr/mir/focus-tell-dont-ask |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Daniel van Vugt | Needs Fixing | ||
Alan Griffiths | Abstain | ||
PS Jenkins bot (community) | continuous-integration | Approve | |
Alexandros Frantzis | Pending | ||
kevin gunn | Pending | ||
Review via email: mp+187943@code.launchpad.net |
This proposal supersedes a proposal from 2013-09-26.
This proposal has been superseded by a proposal from 2013-09-30.
Commit message
Handle tracking the last focused surface inside the ApplicationSession
Description of the change
Fixed error in ApplicationSess
Targeting to development-branch
===
Solve some of the races around focus by applying 'tell-dont-ask' in relation to internal Session state and the Focus Mechanism. Now the focus mechanism doesn't have to hold an (unsafe) shared_ptr to the last focused surface. It's ok for the Session to hold this weak_ptr, as it only attempts to lock it when holding surfaces_mutex.
This branch requires: https:/
As it will cause unfocus messages to be sent in the "connection dropped without disconnect case"(i.e. many of the protobuf tool tests which fail to call disconnect) very likely to lead to a broken pipe error.
== Old Description ==
Fix the races around focus. Essentially these stem from that holding std::shared_
So this branch changes ApplicationSession to not destroy the surface explicitly and instead rely on ~msh::Surface, which means that you really can hold a safe pointer. I think this as a reasonable choice, as the shell might want to do similar things, i.e. continue to animate a surface after a session has closed it.
==
New approach relies on ApplicationSession to hold the last focused ptr...WIP
Unmerged revisions
- 1088. By Robert Carr
-
Fix error in relinquish focus
- 1087. By Robert Carr
-
Merge socket-
messenger- reporitng - 1086. By Robert Carr
-
Merge development-branch
- 1085. By Robert Carr
-
Typo
- 1084. By Robert Carr
-
application_
session: Introduce default_ surface_ locked to dedupe some code - 1083. By Robert Carr
-
Merge fix-1226139
- 1082. By Robert Carr
-
More cleanup
- 1081. By Robert Carr
-
Merge trunk
- 1080. By Robert Carr
-
Cleanup
- 1079. By Robert Carr
-
Mutex for surface
I was able to run the stress test with continuous cursor input for the full ten minute run. There is also good reason to believe this fixes: https:/ /bugs.launchpad .net/mir/ +bug/1220845
The exception in ~SessionMediator can be triggered if session_ manager- >close_ session throws (due to this focus race), causing SessionMediator ::disconnect to fail to reset it's session member-variable pointer. This exception is caught in frontend. However now in ~SessionMediator the pointer has not been reset so it closes the session again throwing an Invalid Session exception. causing the session to be closed again in ~