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

[bug] Always on top not working on Wayland #3117

Closed
ghost opened this issue Dec 26, 2021 · 4 comments
Closed

[bug] Always on top not working on Wayland #3117

ghost opened this issue Dec 26, 2021 · 4 comments

Comments

@ghost
Copy link

ghost commented Dec 26, 2021

Describe the bug

When setting the window to be always on top, it's expected to never be behind any window. The same way browsers implement the behaviour of "Picture in Picture".

a picture shown "always on top" failing

Here we can see that the property is set to true and it stays behind the terminal. The same thing is true if I was to use appWindow.setAlwaysOnTop(true).

Reproduction

  1. From a script in the main view invoke WebviewWindow with alwaysOnTop set to true;
  2. Change focus to another window;
  3. See the previous WebviewWindow not on top.

Expected behavior

When setting the window to be always on top, it's expected to never be behind any window.

Platform and versions

Operating System - Manjaro, version 21.2.0 X64
DE: GNOME 41.2 on Wayland
Kernel: 5.15.7-1-MANJARO
Node.js - 17.1.0
@tauri-apps/cli - 1.0.0-beta.10
@tauri-apps/api - 1.0.0-beta.8
vite - 2.7.7

Stack trace

No response

Additional context

No response

@ghost ghost added the type: bug label Dec 26, 2021
@ghost
Copy link
Author

ghost commented Dec 26, 2021

When running tauri info, it panics:

➜  grudento git:(master) ✗ pnpm run tauri info

> grudento@ tauri /mnt/spare/dev/web/grudento
> tauri "info"

 app:spawn Running "/mnt/spare/dev/web/grudento/node_modules/.pnpm/@tauri-apps+cli@1.0.0-beta.10/node_modules/@tauri-apps/cli/bin/tauri-cli tauri info" +0ms


Operating System - Manjaro, version 21.2.0 X64

Node.js environment
  Node.js - 17.1.0
  @tauri-apps/cli - 1.0.0-beta.10
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Error("unexpected character 't' while parsing major version number")', src/info.rs:323:53
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
  @tauri-apps/api - tauri-apps
 app:spawn Command "/mnt/spare/dev/web/grudento/node_modules/.pnpm/@tauri-apps+cli@1.0.0-beta.10/node_modules/@tauri-apps/cli/bin/tauri-cli" failed with exit code: 101 +0ms
 ELIFECYCLE  Command failed with exit code 1.

@ghost
Copy link
Author

ghost commented Dec 26, 2021

May be of interest:

There's this thing on Wayland:
grafik

"Immer in Vordergrund" -> "Always on top"

Firefox had an issue with PiP a while ago, but now it's fixed. Now, when the user activates PiP, it starts with "Always on top" active, like so:
grafik

@amrbashir
Copy link
Member

After a bit of research, a lot of resources seems to indicate that Wayland doesn't have an api for setting alwayOnTop so we don't have much choice but to wait for Wayland to add an api for it.

Tauri uses gtk under the hood for Linux and gtk has a unified interface to interact with X11 and Wayland and currently we are calling gdk_set_keep_above so once Wayland adds an api for alwaysOnTop, gtk will implement for the forementioned function and it will be automatically fix in tauri.

Firefox workaround for PIP was to make the PIP window of type dialog which can't be used as a fix for Tauri.

@amrbashir
Copy link
Member

amrbashir commented Apr 2, 2022

I'll close this because there is nothing we can do about it. Once wayland adds an API to set alwaysOnTop, it will be automatically fixed on our end.

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

1 participant