Strut sanity checking: ignore struts which would exclude a complete screen
ClosedPublic

Authored by graesslin on Apr 11 2016, 3:29 PM.

Details

Summary

Mostly meant for multi-screen setups: we don't want that a strut set on
a window on screen 0 results in screen 1 completely being excluded. Even
if that's strictly seen a client bug, it's better to just ignore the
strut from KWin's side.

The sanity check is implemented in Client::adjustedClientArea.

From a pure standard point of view this change is a EWMH violation and
thus can cause regressions: struts by clients no longer working.

A test case for struts is added, including some invalid combinations
whose strut is ignored with this change.

Diff Detail

Repository
R108 KWin
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
graesslin updated this revision to Diff 3279.Apr 11 2016, 3:29 PM
graesslin retitled this revision from to Strut sanity checking: ignore struts which would exclude a complete screen.
graesslin updated this object.
graesslin edited the test plan for this revision. (Show Details)
graesslin added a reviewer: Plasma.
Restricted Application added a project: Plasma. · View Herald TranscriptApr 11 2016, 3:29 PM
Restricted Application added a subscriber: plasma-devel. · View Herald Transcript

Was this something that was happening?

Could the following hypothetical situation occur:

  • user plugs in a screen
  • plasma gets notified and updates struts to something valid
  • kwin ignores it because it's screen updates are on a delay
  • kwin gets updates about screen changes

Was this something that was happening?

Not exactly this was happening, but something rather similar inspired the change: https://bugs.kde.org/show_bug.cgi?id=361342

In fact I hoped to be able to work around the mentioned bug as I thought it results in a complete screen being removed, but that's not exactly the situation.

Could the following hypothetical situation occur:

  • user plugs in a screen
  • plasma gets notified and updates struts to something valid
  • kwin ignores it because it's screen updates are on a delay
  • kwin gets updates about screen changes

yes that could happen, but would be good if that's the case. If in step 3 KWin would not ignore the strut it might result in all windows getting resized to very small. Step 4 results in an re-evaluation of all struts, so if it's valid it will be applied again.

davidedmundson accepted this revision.Apr 12 2016, 1:56 PM
davidedmundson added a reviewer: davidedmundson.

Step 4 results in an re-evaluation of all struts

That's what I was trying to ask in a roundabout way. Cool.

This revision is now accepted and ready to land.Apr 12 2016, 1:56 PM
This revision was automatically updated to reflect the committed changes.