[wayland] Apply window rules only to xdg-shell clients
ClosedPublic

Authored by zzag on Feb 28 2019, 12:17 PM.

Details

Summary

There are rules that have to be applied only once, e.g. every Remember
and Apply Initially rule, as well rules that need to configure the client,
e.g. size, etc. In the best scenario the compositor would evaluate such
rules when the client is about to be mapped.

This change limits window rules only to xdg-shell clients because right
now only this protocol lets compositors to intervene in the client
initialization process. Also, it makes things a bit easier for us on the
compositor side.

xdg-shell protocol satisfies most of ours requirements to implement window
rules, but not all of them. If the client is about to be mapped for the
second time and its size is forced by a rule, then compositor may need
to configure it. Currently, xdg-shell protocol doesn't have any mechanism
that a client could use to notify the compositor about its intent to map.

Diff Detail

Repository
R108 KWin
Lint
Lint OK
Unit
No Unit Test Coverage
Build Status
Buildable 8989
Build 9007: arc lint + arc unit
zzag created this revision.Feb 28 2019, 12:17 PM
Restricted Application added a project: KWin. · View Herald TranscriptFeb 28 2019, 12:17 PM
Restricted Application added a subscriber: kwin. · View Herald Transcript
zzag requested review of this revision.Feb 28 2019, 12:17 PM
zzag updated this revision to Diff 52813.Feb 28 2019, 12:34 PM

Make diff a bit nicer

zzag updated this revision to Diff 52837.Feb 28 2019, 4:25 PM

Rebase

zzag edited the summary of this revision. (Show Details)Feb 28 2019, 4:47 PM
zzag edited the summary of this revision. (Show Details)Feb 28 2019, 4:57 PM
zzag edited the summary of this revision. (Show Details)Feb 28 2019, 5:06 PM

Currently, xdg-shell protocol doesn't have any mechanism that a client could use to notify the compositor about its intent to map.

Yeah, it's messy. No toolkit actually does it.

For popups it is forbidden.

For toplevels I believe the design is as follows:

  • first committed empty buffer we unmap and do nothing
  • next committed empty buffer we send a configure event (as there's a rule you have to resend xdg shell state)
  • next committed surface has a buffer \o/

Which works in theory, but relies on extremely well behaving clients (unlike plasma-integration which injects random surface commit events)

shell_client.cpp
1880

Maybe we want to exclude anything with m_plasmaShellSurface.

Even if it works well in kwin it has potential to allow us to mess up plasma.

zzag updated this revision to Diff 53413.Mar 8 2019, 8:19 AM

inline comment

davidedmundson accepted this revision.Mar 17 2019, 8:39 PM
This revision is now accepted and ready to land.Mar 17 2019, 8:39 PM
This revision was automatically updated to reflect the committed changes.