-
-
Notifications
You must be signed in to change notification settings - Fork 154
🐛 Fix poll error on Niri in tablet mode #1247
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
base: main
Are you sure you want to change the base?
Conversation
🐛 Fix poll error on Niri in tablet mode
…5s for tablet mode)
Schneegans
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks again! This looks good already! I just added a few suggestions below.
|
|
||
| /** | ||
| * How long the WLRoots backend will wait before spawning the menu if it can't find the | ||
| * the pointer and you're using a mouse |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| * the pointer and you're using a mouse | |
| * the pointer and you're using touch input |
| // Set timeout options | ||
| this.mouseTimeout = generalSettings.get('wlrootsPointerGetTimeoutMouse'); | ||
| this.touchTimeout = generalSettings.get('wlrootsPointerGetTimeoutTouch'); | ||
| this.defaultBehavior = generalSettings.get('wlrootsPointerGetTimeoutDefaultBehavior'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a reason why you put this initialization into the NiriBackend but use the values in the base class? This is a bit weird, I think.
Getting those values is very fast. I would suggest to just keep a reference to the general settings in the wlroots backend and read the values when needed. Then there's also no need to re-initialize the backend.
| public mouseTimeout: number = 0; | ||
| public touchTimeout: number = 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As mentioned above, those are not really needed.
| public mouseTimeout: number = 0; | |
| public touchTimeout: number = 0; |
| const data = native.getPointerPositionAndWorkAreaSize( | ||
| this.mouseTimeout, | ||
| this.touchTimeout | ||
| ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here I would read the settings before. Something like this:
| const data = native.getPointerPositionAndWorkAreaSize( | |
| this.mouseTimeout, | |
| this.touchTimeout | |
| ); | |
| const data = native.getPointerPositionAndWorkAreaSize( | |
| this.generalSettings.get('wlrootsPointerGetTimeoutMouse'), | |
| this.generalSettings.get('wlrootsPointerGetTimeoutTouch') | |
| ); |
Fix poll error on Niri in tablet mode.
Should address #1246 by checking for capabilities and only hooking a pointer handler when there is a pointer.
Also adds a touch handler (note, events are only received if the touchscreen is pressed, so if no touches are detected within the timeout period of 500ms, the default position will be used)