termux-x11 icon indicating copy to clipboard operation
termux-x11 copied to clipboard

[Bug]: Incorrect Mouse Interaction bounds with Non-Native Resolution

Open zuixalias opened this issue 11 months ago • 6 comments

Problem description

When the display resolution mode is set to a non-native resolution in the Output -> Display resolution mode setting, mouse cursor positioning and interaction with screen boundaries are incorrect.

The issue is observed when using a mouse as the input device. Touch input for cursor movement appears to function correctly: https://mega.nz/file/Fd5D2RBb#vG8vZ-WqkVaB2tuZKJ0wO3QsS1EI5UDoLyfzRAstvAQ

(I'm yet to test for any config issues on my side, this is an initial report)

What steps will reproduce the bug?

  • Set Preferences -> output -> Display resolution mode to exact
  • Move the cursor inside the graphical session to observe the issue

What is the expected behavior?

No response

zuixalias avatar Jan 29 '25 15:01 zuixalias

Is it a physical mouse?

twaik avatar Jan 29 '25 16:01 twaik

Probably you should post output of termux-x11-preference list command, I can not reproduce the bug.

twaik avatar Jan 29 '25 16:01 twaik

Is it a physical mouse?

Yes

Output of termux-x11-preference list:

Click to expand
"hideCutout"="true"
"displayStretch"="false"
"notificationButton1Action"="exit"
"forceOrientation"="no"
"adjustResolution"="true"
"tapToMove"="false"
"enableAccessibilityServiceAutomatically"="false"
"backButtonAction"="toggle soft keyboard"
"adjustHeightForEK"="false"
"notificationTapAction"="open preferences"
"showAdditionalKbd"="false"
"stylusButtonContactModifierMode"="false"
"additionalKbdVisible"="true"
"opacityEKBar"="100"
"displayResolutionCustom"="1280x1024"
"stylusIsMouse"="false"
"clipboardEnable"="true"
"extra_keys_config"="[['ESC','/',{key: '-', popup: '|'},'HOME','UP','END','PGUP','PREFERENCES'], ['TAB','CTRL','ALT','LEFT','DOWN','RIGHT','PGDN','KEYBOARD']]"
"pauseKeyInterceptingWithEsc"="false"
"mediaKeysAction"="no action"
"preferScancodes"="true"
"storeSecondaryDisplayPreferencesSeparately"="false"
"showIMEWhileExternalConnected"="false"
"useTermuxEKBarBehaviour"="false"
"showMouseHelper"="false"
"transformCapturedPointer"="No"
"displayResolutionExact"="1920x1080"
"keepScreenOn"="true"
"pointerCapture"="false"
"swipeDownAction"="toggle additional key bar"
"touchMode"="Trackpad"
"dexMetaKeyCapture"="false"
"scaleTouchpad"="true"
"hardwareKbdScancodesWorkaround"="false"
"notificationButton0Action"="open preferences"
"volumeUpAction"="no action"
"fullscreen"="true"
"enableGboardCJK"="false"
"Reseed"="true"
"PIP"="false"
"capturedPointerSpeedFactor"="100"
"displayResolutionMode"="native"
"swipeUpAction"="no action"
"filterOutWinkey"="false"
"displayScale"="100"
"volumeDownAction"="no action"
"showStylusClickOverride"="false"

Observations from a little testing:

  • The issue only occurs with a physical mouse; touch input (finger gestures) works fine
  • The issue only happens when using exact or custom resolution settings. It does not occur with native or scaled resolution modes
  • Rotating the screen (switching to vertical and back to horizontal) makes the issue more pronounced - after rotation, the mouse cursor becomes restricted, unable to move beyond certain right and bottom boundaries

Possible cause (speculative):

When using exact or custom resolutions, the graphical session is centered on the display, however, the input boundary checks (determining whether the cursor is within valid screen space) may still be using non-centered or differently scaled bounds. This mismatch between the graphical session’s rendered position and the cursor’s allowed movement range could be causing the restriction.

zuixalias avatar Jan 29 '25 19:01 zuixalias

I can't use the mouse by touch and bluetooth mouse, I can't control the screen, the only controllable time is only one or two seconds after refreshing, how to solve this problem, what is the problem?

alice112358133aa0 avatar Mar 15 '25 14:03 alice112358133aa0

Unfortunately I still can not reproduce the problem. Is it still reproducible?

twaik avatar Apr 09 '25 18:04 twaik

Unfortunately I still can not reproduce the problem. Is it still reproducible?

I have finished that. I forgot to give it enough permissions, which caused it to be killed in the background, so I could only use the mouse for 1-2 seconds, and that wasn't a problem with the software

alice112358133aa0 avatar Apr 11 '25 11:04 alice112358133aa0