Skip to content

Rotation argument has no effect(vertical display, horizontal digitizer) #282

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

Closed
Taha-Firoz opened this issue Aug 28, 2022 · 9 comments · Fixed by #323
Closed

Rotation argument has no effect(vertical display, horizontal digitizer) #282

Taha-Firoz opened this issue Aug 28, 2022 · 9 comments · Fixed by #323
Assignees
Labels
bug Something isn't working

Comments

@Taha-Firoz
Copy link

I'm in a peculiar position where I have a display which is vertical on it's main axis and the digitizer, i suspect, is landscape/horizontal

===================================
display mode:
  resolution: 800 x 1280
  refresh rate: 60Hz
  physical size: 107mm x 170mm
  flutter device pixel ratio: 1.967536
===================================

I've run the flutter gallery application with -r 270, -r 90, -o landscape_left, -o landscape_right and this is what it looks like regardless of any -r I pass. I'm sure it's a clash between the orientations of the display and touchscreen, however flutter-pi doesn't react to any different rotations I provide. Any idea how to fix 😭

flutter-pi touchscreen incorrect orientation

flutter-pi-bug.mp4
@ardera
Copy link
Owner

ardera commented Aug 28, 2022

The rotation/orientation argument rotates both the graphics and the touch input, so you can't use it to fix a misaligned touchscreen.

However there's another way to fix it: #164 (comment)

And I wrote an app to fix it as well: https://github.com/ardera/flutter_libinput_calibrator

@Taha-Firoz
Copy link
Author

Okay I'll look into the calibrator but the display still doesn't rotate even though I passed in the rotate argument with 90/270

@ardera
Copy link
Owner

ardera commented Aug 28, 2022

Ah, okay; that's a bug then yeah
I'll fix it

@ardera ardera added the bug Something isn't working label Aug 28, 2022
@ardera ardera self-assigned this Aug 28, 2022
@Taha-Firoz
Copy link
Author

So won't the touchscreen still have problems if I add the rotate option even after I've calibrated it because all the libinput events would have the rotation applied to them or does that function differently? Also does the rotation option force the app into landscape or do we still have to do the set chrome orientation preference thing.

@Taha-Firoz
Copy link
Author

Okay no I understand now, I'll set the udev rotation matrix so when I start the app with the rotate option the libinput events will already be rotated before they reach flutter-pi.

@ardera
Copy link
Owner

ardera commented Aug 29, 2022

Okay no I understand now, I'll set the udev rotation matrix so when I start the app with the rotate option the libinput events will already be rotated before they reach flutter-pi.

Exactly, yeah flutter-pi gets its input events from libinput and libinput will rotate them internally when it sees the udev property.

@Taha-Firoz
Copy link
Author

Okay Thank you so much! I got the touch working but now I just need it to rotate. Do I need to set the rotation preference thing inside of the application itself or can flutter-pi force it to rotate.

@ardera
Copy link
Owner

ardera commented Aug 31, 2022

you can set it inside the application (SystemChrome.setPreferredOrientations) but the flutter-pi rotation / orientation option can also set a default which is respected 99% of the time (if it wasn't bugged that is). Or you can use RotatedBox of course

@Taha-Firoz
Copy link
Author

Are you sure it's bugged, is there anyway I can force it on flutter gallery?

@ardera ardera linked a pull request Aug 18, 2023 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants