Skip to content
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

Right click popup on channel doesn't open next to cursor & delay on mouseover popup #817

Closed
4 tasks done
bubibubibub opened this issue Aug 12, 2021 · 1 comment
Closed
4 tasks done

Comments

@bubibubibub
Copy link

bubibubibub commented Aug 12, 2021

Checklist

Streamlink Twitch GUI version

v1.12.0

Streamlink version

v2.3.0

Operating system, environment and configuration details

Edition Windows 10 Pro
Version 21H1
Betriebssystembuild 19043.1083

Description

To reproduce, right click any channel in any view. The popup opens either in the upper left corner or at the upper or left border of the window. Started happening after updating from v1.11.0 to v1.12.0.

Also there now is a delay on the mouseover popup on channels in this latest version, which is slightly annoying and wasn't there in v1.11.0.

Debug log

No response

@bastimeyer
Copy link
Member

Thanks for reporting. Looks like there's a bug in the newly used NW.js version, which got bumped from 0.45 to 0.52 in v1.12.0.

The context menu's coordinates get set from the PointerEvent/MouseEvent which gets emitted by the DOM when clicking the content. According to the W3C UIEvents specification, the clientX and clientY properties of this event object are of the type long, which means they are whole numbers. However, according to the W3C CSSOM View Module specification, which extends some of specs of the UIEvents, the coordinates can now be of type double, which means they are not guaranteed to be whole numbers anymore. This must have been added because of screens with DPI scaling and it was then implemented by Chromium.

NW.js doesn't handle this correctly and wants integers for its menu.popup(x, y) method. If non-integers are passed, it'll pop up the context menu at the origin, which is the 0, 0 coordinate, the top left corner of the window.

I didn't notice this on my Arch Linux system and in my Windows 10 VM, because click events yield coordinates with integers. In my macOS Cataline VM, this is different, even though I'm not using a high-DPI screen.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants