Skip to content
This repository has been archived by the owner on Jun 26, 2021. It is now read-only.

Mouse position offset and "resize lag" #59

Closed
gdelazzari opened this issue Feb 6, 2018 · 3 comments
Closed

Mouse position offset and "resize lag" #59

gdelazzari opened this issue Feb 6, 2018 · 3 comments

Comments

@gdelazzari
Copy link

While trying the samples I noticed that the library sees the mouse position something like 30 pixels above the real position (i.e. in the counter or button example if I click in the middle of the button nothing happens, but if I keep the mouse under it the button changes to the hover color and I can click it).

I attached a screenshot to show how far I can go while still being able to push the button (as you can see, even with the cursor that far away, the button is displaying with the hover color). There's clearly something wrong here... I still haven't looked at the library code, but maybe some piece of code is subtracting the window titlebar height from the raw mouse position on the window and it messes up?

limn-mouse-offset

I'm running KDE Plasma 5 on Arch Linux, with the Arc theme (not sure if it matters, but given the nature of the problem it could be an issue caused by the DE/WM/theme).

Also, as you may notice, the resize is not always perfect but sometimes it "lags behind" if I resize the window at a moderate speed. If I resize it slowly it resizes fine and correctly fills the entire window area. You can see the issue by the white borders on the right and bottom edge of the gray area (which I presume is the UI being drawn).

Last but not least, this library looks amazing and it's exactly what I've been looking for, keep up the good work! I hope I'll be able to contribute in the near future, thanks for bringing such a project to life!

@gdelazzari
Copy link
Author

Actually, looking at the edit_text example, I think the problem is that the entire UI is being drawn under the title bar. So it's picking up the right mouse position, but it's drawing everything ~30px above.

limn-edit-text

@christolliday
Copy link
Owner

Yep I think you're right, looks like it's a regression in winit, rust-windowing/winit#398 and there's already a fix in the pipeline rust-windowing/winit#402. I'll wait for it to get merged. As for the resizing issue, it should be encapsulated by this issue #38.

Thanks for the issue and the kind words! contributions are always welcome 😃

@gdelazzari
Copy link
Author

gdelazzari commented Feb 12, 2018

The winit PR got merged, after a cargo update everything is working fine! However I saw cargo actually reverted back from winit v0.10.1 to winit v0.10.0. I'm still a new entry in the Rust ecosystem but I guess some other crate that depended on winit (I see that winit is not directly a dependency of Limn) reverted back to the older working version (before, as reported in the issue you linked, the problem was introduced).

It also got rid of the white borders on the right and bottom sides. The resize is still a bit slow/lagging and sometimes flickers, but as you said those are known issues.

I guess we can now close this issue anyway.

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

No branches or pull requests

2 participants