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

Unexpected behaviour of drag_window #943

Closed
feelingnothing opened this issue Dec 9, 2021 · 4 comments · Fixed by #1108
Closed

Unexpected behaviour of drag_window #943

feelingnothing opened this issue Dec 9, 2021 · 4 comments · Fixed by #1108
Labels
bug Something is broken eframe Relates to epi and eframe

Comments

@feelingnothing
Copy link

result

@feelingnothing feelingnothing added the bug Something is broken label Dec 9, 2021
@feelingnothing
Copy link
Author

result
After some test i figured that on windows it requires being called only on start, but losing focus after possible only with cursor going out of application

@emilk
Copy link
Owner

emilk commented Dec 28, 2021

Perhaps winit::Window::drag_window should only be called once (even if an egui app sets the drag_window flag many frames). Since everything works well on my mac it is hard for me to figure out. Perhaps you can take a look at egui-winit/src/epi.rs and see if you can fix it? egui-winit would need to save some state (is_dragging_window) and then only call drag_window if drag_window && !is_dragging_window.

@emilk emilk added the eframe Relates to epi and eframe label Dec 28, 2021
@a-liashenko
Copy link
Contributor

a-liashenko commented Jan 14, 2022

I've checked this bug and looks like we should call drag_window() only after the mouse left click.
It works fine, but I'm not sure how it can work with touch screens. Do we have the same event from winit?

@emilk what do you think about it?

@a-liashenko
Copy link
Contributor

But this solution is still far from the best. The application should call drag_window just after LMB drag_window.
For now, drag_window is called only during the redraw event. And I'm not sure how we can get frame output just after LMB.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something is broken eframe Relates to epi and eframe
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants