-
Notifications
You must be signed in to change notification settings - Fork 86
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Map touch inputs to the single enabled display when the 'last' multi-display mode is in use #388
base: master
Are you sure you want to change the base?
Map touch inputs to the single enabled display when the 'last' multi-display mode is in use #388
Conversation
…y mode is in use This ensures that for the situation where there is only a single display in use we can use the touch input devices correctly automatically.
I thought that without mapping reported by the (touch) input, it was mapped to the whole output layout. Consequently, if you only have one display enabled, it should be always right. |
That is true, which means it works fine if the output has not transforms applied to it. However, as it's not actually linked to the output itself, it doesn't take into account any transforms which are active on the display. This means that if you have a rotated or flipped display, the touch will be applied in the wrong location. In our situation we allow have touch displays which can change orientation and rotation so we need to account for that. This PR makes the link between the input device and the output device properly so transforms are taken into account. |
@matt-oakes This comment from @emersion gives some ideas for input to output mapping. You PR is a very special case of the heuristic solution I guess. |
I've just looked again at the When an absolute touch event comes in, it gets the mapped output and transforms it. When getting the mapped output, it first checks the We can set this by calling I think this actually is the correct behaviour for Does that sound like the correct behaviour to you too? |
@joggee-fr Just following up on this proposed change. Does the above sound like the correct behaviour to you? |
I'm confused - in |
That is correct, but because Cage is not currently calling Because of this, the touch event will be handled, but the To resolve this, I am proposing a different and simplier change than this PR. If Cage is in "last display mode" ( I'm happy to change this PR to get this working and provide a video of the behaviour before and after to make it clear what the issue is and what the fix will do. |
It seems the PR can at least be extended to manage every cases where only one output is available, not only when using |
Yes, that would be the case. We'd just need to handle the case where a second output becomes enabled so it doens't map incorrectly. |
I'm not certain if this is something you will want to merge as-is, but it was a useful patch for us to resolve issues with touch input devices which do not report which display out they map to.
In our situation we run with
-m last
, so there is only ever a single enabled display. This PR detects this situation and automatically maps the touch and pointer inputs to this enabled display.This avoids the need for pre-configuring this using udev rules (I beleive this is considered deprecated anyway?) and allows Cage to automatically work with any touch input device and output display automatically.
I have made sure this works both when the input devices are signalled as added before the outputs and when either the inputs or outputs change.
Related to #243.
Similar in idea to #167 and #193.