Skip to content

Conversation

@make-42
Copy link
Contributor

@make-42 make-42 commented Jan 3, 2026

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)

Copy link
Contributor

@Schneegans Schneegans left a 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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* the pointer and you're using a mouse
* the pointer and you're using touch input

Comment on lines +65 to +68
// Set timeout options
this.mouseTimeout = generalSettings.get('wlrootsPointerGetTimeoutMouse');
this.touchTimeout = generalSettings.get('wlrootsPointerGetTimeoutTouch');
this.defaultBehavior = generalSettings.get('wlrootsPointerGetTimeoutDefaultBehavior');
Copy link
Contributor

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.

Comment on lines +36 to +37
public mouseTimeout: number = 0;
public touchTimeout: number = 0;
Copy link
Contributor

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.

Suggested change
public mouseTimeout: number = 0;
public touchTimeout: number = 0;

Comment on lines +91 to +94
const data = native.getPointerPositionAndWorkAreaSize(
this.mouseTimeout,
this.touchTimeout
);
Copy link
Contributor

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:

Suggested change
const data = native.getPointerPositionAndWorkAreaSize(
this.mouseTimeout,
this.touchTimeout
);
const data = native.getPointerPositionAndWorkAreaSize(
this.generalSettings.get('wlrootsPointerGetTimeoutMouse'),
this.generalSettings.get('wlrootsPointerGetTimeoutTouch')
);

@Schneegans Schneegans linked an issue Jan 16, 2026 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Poll Error in get Pointer when launching Kando in Tablet Mode

2 participants