Skip to content

feat: add Window::is_always_on_top method - #981

Merged
amrbashir merged 7 commits into
tauri-apps:devfrom
thep0y:dev
Sep 25, 2024
Merged

feat: add Window::is_always_on_top method #981
amrbashir merged 7 commits into
tauri-apps:devfrom
thep0y:dev

Conversation

@thep0y

@thep0y thep0y commented Sep 25, 2024

Copy link
Copy Markdown
Contributor

I couldn't find a way to get the "keep above" property through GTK, so the is_always_on_top method is not implemented for Linux.

Relate: tauri-apps/tauri#11078

… is always on top

- Implemented `is_always_on_top` in `UnownedWindow` for macOS.
- Exposed `is_always_on_top` through the cross-platform `Window` API.
- Noted that this feature is unsupported on iOS and Android platforms.

This change allows developers to query whether a given window is set to always stay on top of other windows, enhancing the platform's window management capabilities.
…n top

This commit introduces a new public method `is_always_on_top` in the
`Window` struct. The method checks whether the `ALWAYS_ON_TOP` flag is
present in the `window_flags` of the current window state, and returns
a boolean value accordingly.
@thep0y
thep0y requested a review from a team as a code owner September 25, 2024 00:58
@github-actions

github-actions Bot commented Sep 25, 2024

Copy link
Copy Markdown
Contributor

Package Changes Through e36d400

There are 1 changes which include tao with patch

Planned Package Versions

The following package releases are the planned based on the context of changes in this pull request.

package current next
tao 0.30.2 0.30.3

Add another change file through the GitHub UI by following this link.


Read about change files or the docs at github.com/jbolda/covector

@amrbashir

amrbashir commented Sep 25, 2024

Copy link
Copy Markdown
Member

for linux, you can check https://docs.rs/gdk/0.18.0/gdk/struct.Window.html#method.state and check if it has thishttps://docs.rs/gdk/0.18.0/gdk/struct.WindowState.html#associatedconstant.ABOVE flag

@thep0y thep0y changed the title feat(macos, windows): Add is_always_on_top method to check if a window is always on top feat(macos, windows, linux): Add is_always_on_top method to check if a window is always on top Sep 25, 2024

@amrbashir amrbashir left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Other than failing CI because of missing methods for Android and iOS backends, this LGTM.

Could you also add a change file in .changes directory?

@thep0y

thep0y commented Sep 25, 2024

Copy link
Copy Markdown
Contributor Author

Why use placeholder functions instead of using compile-time conditions to control platform-specific interfaces?

@thep0y
thep0y requested a review from amrbashir September 25, 2024 02:06
@amrbashir

Copy link
Copy Markdown
Member

Why use placeholder functions instead of using compile-time conditions to control platform-specific interfaces?

This was something inherited from winit crate when we forked it.

Comment thread .changes/is-always-on-top.md Outdated
@amrbashir

Copy link
Copy Markdown
Member

Thank you

@amrbashir amrbashir changed the title feat(macos, windows, linux): Add is_always_on_top method to check if a window is always on top feat: add Window::is_always_on_top method Sep 25, 2024
@amrbashir
amrbashir merged commit 2ee007a into tauri-apps:dev Sep 25, 2024
@github-actions github-actions Bot mentioned this pull request Sep 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants