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

feat: add Window::is_always_on_top method #981

Merged
merged 7 commits into from
Sep 25, 2024
Merged

Conversation

thep0y
Copy link
Contributor

@thep0y thep0y commented Sep 25, 2024

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
Copy link
Contributor

github-actions bot commented Sep 25, 2024

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
Copy link
Member

amrbashir commented Sep 25, 2024

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
Copy link
Member

@amrbashir amrbashir left a comment

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
Copy link
Contributor Author

thep0y commented Sep 25, 2024

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

@amrbashir
Copy link
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.

.changes/is-always-on-top.md Outdated Show resolved Hide resolved
@amrbashir
Copy link
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
9 checks passed
@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