DioxusLabs / DioxusLabs/dioxus

Wayland + always_on_top not working

Open
#4,571 3 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
Rust
Stars
39.1k
Forks
1.9k
Avg merge
4d 10h
Merged PRs (30d)
4

Description

**Problem**

Under a wayland session and the program running in wayland `WindowBuilder::new().with_always_on_top(true)` has no effect. When running as xwayland app `WAYLAND_DISPLAY="" cargo run` it behaves correctly and the window always stays on top.

**Steps To Reproduce**

Steps to reproduce the behavior:

```rust
use dioxus::prelude::*;
use dioxus_desktop::{Config, LogicalSize, WindowBuilder};

const FAVICON: Asset = asset!("/assets/favicon.ico");
const MAIN_CSS: Asset = asset!("/assets/main.css");

fn main() {
LaunchBuilder::desktop()
.with_cfg(
Config::new().with_window(
WindowBuilder::new()
.with_title("Always on top")
.with_always_on_top(true)
.with_inner_size(LogicalSize::new(240.0, 100.0)),
),
)
.launch(App);
}

#[component]
fn App() -> Element {
rsx! {
document::Link { rel: "icon", href: FAVICON }
document::Link { rel: "stylesheet", href: MAIN_CSS }
div {
id: "hero",
"always on top"
}
}
}
```

**Expected behavior**

As it is the case in x11/xwayland the windows should always stays on top of all other windows even when a different window is focused that could potentially overlap.

**Screenshots**

**Environment:**

- Dioxus version: v0.6, 0.7.0-rc.0 (are the versions i have tested but its happening on many more)
- Rust version: 1.89.0
- OS info: Arch 6.15.9-arch1-1 Gnome 48
- App platform: desktop

**Questionnaire**

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.