PlacementStrategy ignores the surface type and state
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Mir |
Fix Released
|
High
|
Alan Griffiths | ||
unity8 (Ubuntu) |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
The surface type and state are important bits of information when deciding the placement of a surface.
Without this information a poor initial placement might be done causing a surface to resized and repositioned right after it, once the window manager finally has knowledge of all the properties of the surface.
This is happening right now with unity8 as surfaces get unnecessarily resized right after creation, which causes visual glitches as you can see the window "contorting" right after being launched and resizing a surface is a reasonably costly operation. We have worked around it by holding up on displaying the surface until it has finally settled down (i.e. we keep the splash screen for longer).
Related branches
- Daniel van Vugt: Approve
- PS Jenkins bot (community): Approve (continuous-integration)
-
Diff: 531 lines (+62/-246)13 files modifiedplayground/demo-shell/CMakeLists.txt (+0/-1)
playground/demo-shell/default_placement_strategy.cpp (+0/-58)
playground/demo-shell/default_placement_strategy.h (+0/-55)
playground/demo-shell/default_window_manager.cpp (+22/-5)
playground/demo-shell/default_window_manager.h (+4/-4)
playground/demo-shell/demo_shell.cpp (+1/-11)
src/include/server/mir/scene/placement_strategy.h (+0/-45)
tests/acceptance-tests/throwback/test_client_cursor_api.cpp (+4/-36)
tests/include/mir_test_framework/declarative_placement_window_manage_policy.h (+18/-20)
tests/integration-tests/test_session.cpp (+0/-1)
tests/mir_test_framework/CMakeLists.txt (+1/-1)
tests/mir_test_framework/declarative_placement_window_manage_policy.cpp (+12/-8)
tests/unit-tests/scene/test_surface_controller.cpp (+0/-1)
summary: |
- PlacementStrategy::place() should be given the surface type and state + PlacementStrategy ignores the surface type and state |
Changed in mir: | |
importance: | Undecided → High |
Changed in unity8 (Ubuntu): | |
status: | New → Confirmed |
no longer affects: | unity8 |
tags: | added: visual-quality |
Changed in unity8 (Ubuntu): | |
status: | Confirmed → Fix Released |
Confirmed. I know it is important for placement/size to be determined by surface type and state (also affected by things like decoration sizes too). We just haven't wired up any of that state information to the placement/sizing logic yet.
When this is done, you will for example be able to set mir_surface_ state_fullscree n instead of having to specify explicit surface dimensions.
I am wondering however if any part of what you experience in Unity8 is caused by Unity8. Because Mir has no "late resizing" that it will trigger itself. The late resizing would be coming from Unity8. Mir does no resizing except when explicitly requested by the shell. So you could avoid it by creating the surface with correct dimensions, which means any subsequent resize request from Unity8 to the same dimensions will be a no-op.