-
-
Notifications
You must be signed in to change notification settings - Fork 169
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
[bug] current_monitor()
always returns the external monitor (Ubuntu 22.04)
#700
Comments
current_monitor
always returns the external monitor (Ubuntu 22.04)current_monitor()
always returns the external monitor (Ubuntu 22.04)
could you give me the output of: dbg!(window.current_monitor().unwrap().unwrap().name());
dbg!(window.primary_monitor().unwrap().unwrap().name());
dbg!(window.available_monitors().unwrap().map(|m|m.name()).collect<Vec<_>>()); and also the output of xrandr --query |
Output (after slight modification of your code snippet to make it compile):
This output is the same no matter on which monitor I open the window. Output of
|
I see what causes the issue now, unfortunately it will take some time to fix. For now, you can workaround this by, creating the window in one command and position it on the desired window, then run the logic that depends on the current monitor in another command. Also from my testing on KDE, if your main window is on the second monitor, the new window will open on the second monitor and will print the correct monitor. Unfortunately this is not the case on Gnome, no matter what you do, the window seems to be opened on main monitor first, hence the incorrect output of current monitor, then moved to the second monitor. So it is partially Gnome's window manager fault too and even after we fix it on our own, the issue might still exist. |
@amrbashir IIRC we are going to call gtk method directly instead of sending requests to event loop right? |
yes but unfortunately, it still won't be enough to fix this issue, the same behavior could be seen in winit too. Probably another Gnome bug but if you have the time, please re-test it again just to make sure |
Describe the bug
Calling
current_monitor()
on a window just built with theWindowBuilder
always returns the external monitor even if the window is clearly opened on the built-in monitor.Reproduction
I made a repro here on branch
wrong-monitor
: https://github.com/matthme/menu-stuck-tauri-macos/tree/wrong-monitorIt prints out the monitor of the window.
Expected behavior
Return the monitor where the window is currently residing in.
Platform and versions
Stack trace
No response
Additional context
No response
The text was updated successfully, but these errors were encountered: