Open uAtomicBoolean opened 3 weeks ago
I got the same promble, with the newest RC version. My system information is "Manjaro Arch24 with gnome+wayland". I've upgrade everything.
I found some special things, I install the gtk3 library(pacman -S gtk3 in the "tao" doc),now I can move the window in the "dev" option, but I still can't move the windows in "build" option.
This is the difference besides "build"(left, can't move) and "build"(right, can move)
I did something more, I found that if I right-click the botton on the titile bar, I can move it.
The issue might come from tauri-runtime-wry
. I've found that adding it to the Cargo.toml
to set it to its last version (2.0.0-rc.6
) brings the bug.
Also, both minimize and close buttons work and I can move the window when "dragging" them.
[✔] Environment
- OS: Fedora 40 X64
✔ webkit2gtk-4.1: 2.44.2
✔ rsvg2: 2.57.1
✔ rustc: 1.79.0 (129f3b996 2024-06-10)
✔ cargo: 1.79.0 (ffa9cf99a 2024-06-03)
✔ rustup: 1.27.1 (54dd3d00f 2024-04-24)
✔ Rust toolchain: stable-x86_64-unknown-linux-gnu (default)
- node: 22.6.0
- npm: 10.8.1
- bun: 1.1.24
[-] Packages
- tauri [RUST]: 2.0.0-rc.1
- tauri-build [RUST]: 2.0.0-rc.1
- wry [RUST]: 0.42.0
- tao [RUST]: 0.29.1
- tauri-cli [RUST]: 2.0.0-rc.3
[-] App
- build-type: bundle
- CSP: unset
- frontendDist: ../dist
- devUrl: http://localhost:3000/
so that we should tell it to the "wry" project. I'm not good at the cases, can you please donging some tests and tell them?
It also happens in release mode. For some reason this is specific for Gnome + Wayland
KDE + X11 -> Can resize and move KDE + Wayland -> Can resize and move GNOME + X11 -> Can resize and move GNOME + Wayland -> The issue appears.
Can confirm this bug on Fedora Workstation 40. rustc 1.80.1 (3f5fd8dd4 2024-08-06) Kernel: Linux 6.10.6-200.fc40.x86_64 DE: GNOME 46.4 WM: Mutter (Wayland)
Same here.
I can move the window if I grab it by minimize/maximize/close button.
Debian sid. Gnome wayland.
[✔] Environment
[-] Packages
[-] Plugins
[-] App
I found out that window example in tao doesn't allow to move/resize window either, but in drag_window example it is possible to move windows (but not resize - it's the example's purpose to show how to make window movable by holding on edges).
As you tell. I also found that you can hold down three buttons, such as the minimize button, to move the window. Something interesting
It seems to me that this problem is caused by Ubuntu on Wayland and nothing we can do to fix this on our side since we simply use GTK3 to create the window and it handles resizing on it self.
If there is other GTK3 apps (non-tauri) that exhibits this behavior, then it is probably a bug in Ubuntu on Wayland.
same issue here on debain 12, when I run
npm run tauri dev
Couldn't get key from code: Unidentified(Gtk(248))
Couldn't get key from code: Unidentified(Gtk(248))
using xprop method of detecting if application is running native wayland or thru xwayland (shows crosshair on xwayland and no cursor change on wayland). I have found out:
This suggests that the problem is in tauri/tao/wry and not in the system.
My current workaround is setting env var "GDK_BACKEND" to x11 at top of the main() function.
p.s. beware of running your app from vs code terminal as it sets GDK_BACKEND to x11
Thanks @akrpic77 for the investigation, I will see if I we are doing something finky in our code once I get my linux machine setup.
I still don't understand why would KDE+Wayland work but not Gnome+Wayland.
I have built a release .deb and .AppImage.
the .AppImage works fine with resizing and moving, since it shipped with all dependencies and does not use any system libs.
The appimage also forces GDK_BACKEND=x11
though.
I've gone through and tried all tauri-runtime-wry
versions from rc.8
back down to rc.2
and it seems that it really has broken in rc.3
, that was the first release where my app also began experiencing these issues in wayland+gnome DE's
following on hint by @ndom91, I found out that reversing changes of fix(linux): prevent firing duplicate mouse events in tao fixes move/size issue, but brings back duplicate mouse events.
following on hint by @ndom91, I found out that reversing changes of fix(linux): prevent firing duplicate mouse events in tao fixes move/size issue, but brings back duplicate mouse events.
I think this is relevant, because I managed to move the window one time by holding the click for some time. But I did not know how to produce it again.
based on all the comments above, this is the hacky fix I have, which seems to work.
If you have a better solution, please share :)
if env::var("APPIMAGE").is_ok() || std::env::var("FLATPAK_ID").is_ok() {
return;
}
let desktop = env::var("XDG_CURRENT_DESKTOP").unwrap_or_default().to_lowercase();
if desktop.contains("gnome") {
env::set_var("GDK_BACKEND", "x11");
}
Tauri 2 includes the ability to pass a .desktop file template for deb and rpm. So we decided to do something similar ^^ and prefix env GDK_BACKEND=x11
before the preexisting Exec=
key contents
Using the X11 backend is not a solution, it is a hack. I hope this can be fixed in TAO.
Using the X11 backend is not a solution, it is a hack. I hope this can be fixed in TAO.
Right, but it's a workaround for now for folks that made the migration to Tauri v2 already and don't want to go back
Describe the bug
I can't move or resize a window after upgrading to tauri latest rc (
2.0.0-rc.3
at that time) when running as dev.The thing is it doesn't come from that tauri version as downgrading it doesn't solve the problem.
Reproduction
Create a minimal tauri app using the latest release candidate.
cargo create-tauri-app --rc
Run the app in dev mode.
cargo tauri dev
Expected behavior
Be able to move or resize the application's window.
Full
tauri info
outputStack trace
No response
Additional context
No response