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

Always on bottom #522

Merged
merged 3 commits into from
Aug 21, 2022
Merged

Always on bottom #522

merged 3 commits into from
Aug 21, 2022

Conversation

henry40408
Copy link
Member

@henry40408 henry40408 commented Aug 6, 2022

closes #113

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Docs
  • New Binding issue #___
  • Code style update
  • Refactor
  • Build-related changes
  • Other, please describe:

Does this PR introduce a breaking change?

  • Yes, and the changes were approved in issue #___
  • No

Checklist

  • When resolving issues, they are referenced in the PR's title (e.g fix: remove a typo, closes #___, #___)
  • A change file is added if any packages will require a version bump due to this PR per the instructions in the readme.
  • I have added a convincing reason for adding this feature, if necessary

Other information

@henry40408 henry40408 force-pushed the feature/issue-113 branch 6 times, most recently from d93ed90 to c80cb8f Compare August 7, 2022 14:43
@henry40408 henry40408 force-pushed the feature/issue-113 branch 5 times, most recently from 15cebc4 to b2430ae Compare August 18, 2022 16:10
@henry40408 henry40408 changed the title always on bottom Always on bottom Aug 18, 2022
@henry40408 henry40408 changed the title Always on bottom Always below bottom Aug 18, 2022
@henry40408 henry40408 force-pushed the feature/issue-113 branch 6 times, most recently from 5c69eb3 to 56f308d Compare August 18, 2022 16:26
@henry40408 henry40408 force-pushed the feature/issue-113 branch 6 times, most recently from 16fc314 to 2e74c58 Compare August 18, 2022 17:15
@henry40408 henry40408 marked this pull request as ready for review August 18, 2022 17:27
@henry40408 henry40408 requested a review from a team as a code owner August 18, 2022 17:27
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.

Thank you, the implementation for Linux and Windows LGTM but I will leave macOS for @wusyong to approve. There is a couple of nit-picks but this should be mostly good to go.

src/platform_impl/linux/window.rs Outdated Show resolved Hide resolved
src/window.rs Outdated Show resolved Hide resolved
src/window.rs Show resolved Hide resolved
@henry40408 henry40408 changed the title Always below bottom Always on bottom Aug 21, 2022
@henry40408 henry40408 force-pushed the feature/issue-113 branch 2 times, most recently from df0af02 to 03c349b Compare August 21, 2022 04:49
Co-Authored-By: Amr Bashir <amr.bashir2015@gmail.com>
src/platform_impl/linux/window.rs Outdated Show resolved Hide resolved
Co-Authored-By: Amr Bashir <amr.bashir2015@gmail.com>
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.

Thank you

@amrbashir amrbashir merged commit a2a7b72 into tauri-apps:dev Aug 21, 2022
@github-actions github-actions bot mentioned this pull request Aug 21, 2022
@henry40408 henry40408 deleted the feature/issue-113 branch August 21, 2022 23:31
@jabza
Copy link

jabza commented Aug 24, 2022

@henry40408 This is great. Although I'm noticing on Windows when clicking the 'Show Desktop' button, the window still gets hidden annoyingly. Any ideas?

@henry40408
Copy link
Member Author

hi @jabza I just tested and confirmed that window is always hidden whichever I set it "always on top" or "always on bottom", so it might not relate to "always on bottom" or "always on top". Would you kindly open another issue?

@amrbashir
Copy link
Member

@jabza this is a normal behavior of Windows. Nothing we can control. I think what you want is to make your tauri window behave like a desktop wallpaper? in this case check out my comment here tauri-apps/tauri#4261 (comment)

@jabza
Copy link

jabza commented Aug 25, 2022

@henry40408 @amrbashir I see. For now I guess the wallpaper/progman child approach seems like the only way to remain visible upon 'Show Desktop'.

Windows 11 is re-introducing the concept of Window 'widgets' which will be interesting to see how that changes things.

I also tried OR'ing in the NOZORDER flag and pretty much everything else I could find on the topic. It seems like perhaps this used to be possible but not any more.

@amrbashir
Copy link
Member

@jabza Windows has no concept of "always on bottom", but you can change the z-order of the window to be the bottom most but that can be changed later due to many factors. The only way you can be truly on bottom is by using wallpaper/progman approach. Also the "Show Desktop" button hides all windows to show the destkop and since an "always on bottom" window is still a window, it makes sense for it to be hidden.

@jabza
Copy link

jabza commented Aug 25, 2022

@amrbashir understood, but it is possible for windows to 'survive' "Show Desktop", assuming they're "always on top". I guess that's the one exception Windows makes. Thanks for the alternative solution, i'll go ahead and attempt a plugin!

@amrbashir
Copy link
Member

even "Always on top" can't survive "Show desktop" because "Always on top" guarantees it is on top of everything else but it doesn't guarantee that it can't be hidden or minimized.

@jabza
Copy link

jabza commented Aug 25, 2022

I've tested it locally with Always on Top set and it does survive the event for me

@amrbashir
Copy link
Member

That's interesting behavior that I didn't know about it but unfortunately Windows doesn't guarantee the same for "always on bottom".

@jabza
Copy link

jabza commented Aug 25, 2022

All good, your alternative solution looks to be the ticket :) Hopefully come Windows 11 update a cleaner way will present itself!

@amrbashir
Copy link
Member

What you want to do is probably similar to Rainmeter, so you could try looking into their source code and see if you can find anything related there.

@jabza
Copy link

jabza commented Aug 25, 2022

Wow this is interesting... https://github.com/rainmeter/rainmeter/blob/78a24859aa2aafd69e819619eb9bbf44b77d2bd3/Library/System.cpp they seem to be using a 'dummy window' to detect the 'Show Desktop' event... there's some gems in here I'm sure...

@amrbashir
Copy link
Member

yeah Rainmeter has been around for a while and I bet they have a lot of experience/knowledge in this area.

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.

feat: Add always below other windows
4 participants