Make keyboard focus a pointer constraints necessity
ClosedPublic

Authored by romangg on Jun 12 2018, 9:45 AM.

Details

Summary

This patch changes KWin's pointer constraining behavior by only allowing
constraints if the surface has keyboard focus. In case the client activation
state changes, it rechecks it.

Test Plan

Manually with the pointer constraints test application and opening the
launcher by pressing meta. Also amended autotest.

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.
romangg created this revision.Jun 12 2018, 9:45 AM
Restricted Application added a project: KWin. · View Herald TranscriptJun 12 2018, 9:45 AM
Restricted Application added a subscriber: kwin. · View Herald Transcript
romangg requested review of this revision.Jun 12 2018, 9:45 AM

Is this a rule in the spec or one you've come up with?

romangg added inline comments.Jun 12 2018, 9:53 AM
pointer_input.cpp
629

I compare here the pointer focus surface with the keyboard focus surface. It might make more sense to compare the activated client with the client of the pointer focus surface, since I connected to the clientActivated signal.

I tried it out and the new autotest works as well. Any opinions on this?

Is this a rule in the spec or one you've come up with?

The spec says nothing about keyboard focus or activated clients. That's a rule I came up with, but it seems very natural to me. If a client is not active, you don't want your cursor to be controlled by it. It's very obvious if you try to open the launcher while being constrained in your current client.

In general the compositor is allowed to take away constraints whenever it pleases.

graesslin added inline comments.
pointer_input.cpp
629

Client would be better as there might be weird multi surface situations.

romangg updated this revision to Diff 36285.Jun 18 2018, 6:15 PM
romangg marked 2 inline comments as done.
  • Compare with active client
graesslin accepted this revision.Jun 23 2018, 7:27 AM
This revision is now accepted and ready to land.Jun 23 2018, 7:27 AM
This revision was automatically updated to reflect the committed changes.