dioxus icon indicating copy to clipboard operation
dioxus copied to clipboard

Add ability to configure "always on/pin to top" option for the Dioxus Desktop

Open Andrew15-5 opened this issue 1 year ago • 3 comments

Feature Request

The "always on top" feature is blocking the file choose window (<input type="file">), which is supposed to be a part of the app. So not only it blocks other dev windows (editor, dx and tailwind commands), but also itself. And when moving to the virtual desktop with that window and an editor, it will always refocus on that window, instead of the previously focused editor, which is just not a great DX, to put it mildly.

Implement Suggestion

Probably a toggle either in the Dioxus.toml file or in the dioxus::desktop::Config::new().

Andrew15-5 avatar Apr 21 '24 19:04 Andrew15-5

You can pass a WindowBuilder to the config using Config::with_window().

The WindowBuilder lets you configure whether you want the window to always be on top (https://docs.rs/tao/latest/tao/window/struct.WindowBuilder.html#method.with_always_on_top).

SophieSilver avatar Apr 22 '24 00:04 SophieSilver

They mean for the CLI. It had a new feature that keeps the desktop window always on top while running in dev mode.

DogeDark avatar Apr 22 '24 01:04 DogeDark

I think it's a new version of Dioxus and not dx.

The WindowBuilder method can serve as a workaround.

Andrew15-5 avatar Apr 22 '24 05:04 Andrew15-5

I tested the file input issue mentioned here, and it looks to be resolved (let me know if this isn't the case for you!). I linked a PR for the always-on-top setting request.

DogeDark avatar Jul 26 '24 22:07 DogeDark