Send requested size in all configure events

Authored by davidedmundson on Oct 8 2018, 10:01 PM.



Previously when updating the state we would send a configure event with
the size 0,0. This means the client chooses the size. For regular window
this works as most toolkits treat this to mean the size that we
previously requested. It's not explicit in the spec either way.

For maximised windows it's a problem, the spec clearly states that when
maximised clients must follow the size given. Telling the client to be
0,0 doesn't make sense.

By always sending our last requested size we remove any ambiguity.

Test Plan

Maximised some windows and changed focus
WAYLAND_DEBUG showed we weren't sending a configure with 0,0
after startup

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.Oct 8 2018, 10:01 PM
Restricted Application added a project: KWin. · View Herald TranscriptOct 8 2018, 10:01 PM
Restricted Application added a subscriber: kwin. · View Herald Transcript
davidedmundson requested review of this revision.Oct 8 2018, 10:01 PM
zzag added a subscriber: zzag.Oct 9 2018, 4:53 PM
zzag added inline comments.

Shouldn't we initialize m_requestedClientSize here? (just out of curiosity)

davidedmundson added inline comments.Oct 9 2018, 5:12 PM

I don't see a reason to.

It's a protocol error to send a buffer before receiving a configure request so XdgShell code will never be in this path anyway.

But also if we haven't explicitly requested a size, there's no reason not to continue letting the client keep picking the size. Mixing requested and current state is where we open ourselves to races that I want to avoid.

I should technically unset in unmap though .

zzag accepted this revision.Oct 9 2018, 5:28 PM

Please add "[wayland]" to the subject line.


The last sentence is hard to understand.

This revision is now accepted and ready to land.Oct 9 2018, 5:28 PM
This revision was automatically updated to reflect the committed changes.