PlacementStrategy ignores the surface type and state

Bug #1357259 reported by Daniel d'Andrada
10
This bug affects 2 people
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

summary: - PlacementStrategy::place() should be given the surface type and state
+ PlacementStrategy ignores the surface type and state
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

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_fullscreen 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.

Changed in mir:
status: New → Confirmed
assignee: nobody → Daniel van Vugt (vanvugt)
tags: added: enhancement
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

When this is all implemented, I'm not sure "PlacementStrategy" will still exist. So maybe we need to describe the problem without mentioning that class.

Revision history for this message
Gerry Boland (gerboland) wrote :

Orientation too please :)

Revision history for this message
Gerry Boland (gerboland) wrote :

>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.

That's exactly what we're doing now. Currently unity8 isn't deciding intelligently the surface geometry in the Placement Strategy, just making it fullscreen. Only when it has drawn a frame did we resize (as that's when we add it to our scene, and thus its correct geometry is set). But I've branches under review now that gives our scene the ability to decide geometry at PlacementStrategy time.

This bug came about because we foresaw that we'd be lacking enough information to always decide correctly. So we'd need to know as much info about this new surface before it is created: the state, type, parent surface, fullscreen property, and anything else it supplies. In return, shell will want to set the surface's orientation. Perhaps other things too.

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Alright so you could fix this bug entirely in Unity8 right now. Although there is definitely functionality in Mir still missing. That's the area of WM I'm going to focus on again after the current bug fix and optimization efforts for the phone.

Changed in unity8:
status: New → Confirmed
kevin gunn (kgunn72)
Changed in mir:
importance: Undecided → High
Revision history for this message
Gerry Boland (gerboland) wrote :

Yep, this bug relates only to the missing functionality we saw in Mir.

Michał Sawicz (saviq)
Changed in unity8 (Ubuntu):
status: New → Confirmed
Michał Sawicz (saviq)
no longer affects: unity8
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Is this bug still valid after PlacementStrategy is deleted? We removed it in r2694 (scheduled for release in Mir 0.14.0).

Changed in mir:
status: Confirmed → Incomplete
assignee: Daniel van Vugt (vanvugt) → Alan Griffiths (alan-griffiths)
Revision history for this message
Alan Griffiths (alan-griffiths) wrote :

This was obsoleted in Mir 0.14 (LP doesn't seem to have a way to set a milestone that passed months ago.)

Changed in mir:
status: Incomplete → Fix Released
tags: added: visual-quality
Changed in unity8 (Ubuntu):
status: Confirmed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.