[wayland] Place all toplevels before the first configure

Authored by davidedmundson on Apr 4 2019, 12:42 AM.



Currently popups get positioned once at the initial configure, to set
the correct size and again when they are mapped.

Toplevels are currently only positioned when they are mapped. This works
for all cases where the the toplevel defines its own size, but not if
the window should have an initial size set by the placement strategy or
window rules. Most notably the maximised placement strategy used on
plasma mobile.

Being out of sync and resizing later currently causes a positioning bug
when plasma mobile is used with XdgShell.

This patch repositions all top levels that don't have a position set
through the plasma interface.

Test Plan

Relevant unit test

Diff Detail

R108 KWin
Automatic diff as part of commit; lint not applicable.
Automatic diff as part of commit; unit tests not applicable.
davidedmundson created this revision.Apr 4 2019, 12:42 AM
Restricted Application added a project: KWin. · View Herald TranscriptApr 4 2019, 12:42 AM
Restricted Application added a subscriber: kwin. · View Herald Transcript
davidedmundson requested review of this revision.Apr 4 2019, 12:42 AM
bshah accepted this revision as: bshah.Apr 4 2019, 6:07 AM
This revision is now accepted and ready to land.Apr 4 2019, 6:07 AM
zzag added a subscriber: zzag.Apr 4 2019, 6:46 PM
zzag added inline comments.

Does it compile?

zzag added a comment.Apr 4 2019, 6:54 PM

This change breaks Cascade placement policy.



zzag added a comment.Apr 4 2019, 6:56 PM

Side note: It seems like placement policies are not covered by any test. :(

Urgh, that cascade issue is a bit sucky. I assumed all placement operations were deterministic.

I can do a "lazy" fix by just making it not place any invalid windows (this patch).
Arguably we could do this in all placement strategies that only move the window for speed purposes.

  • Don't cascade invalid windows
This revision was automatically updated to reflect the committed changes.