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(Windows): add skip taskbar methods #2177

Merged

Conversation

amrbashir
Copy link
Contributor

  • Tested on all platforms changed
  • Added an entry to CHANGELOG.md if knowledge of this change could be valuable to users
  • Updated documentation to reflect any user-facing changes, including notes of platform-specific behavior
  • Created or updated an example program if it would help users understand this functionality
  • Updated feature matrix, if new features were added or implemented

CHANGELOG.md Outdated Show resolved Hide resolved
@maroider maroider added DS - windows C - waiting on maintainer A maintainer must review this code labels Feb 1, 2022
@msiglreith
Copy link
Member

Hello! Thanks for the PR, sorry for the long silence on this topic.
Would it be possible to cover this feature with the standard windows styles or via a owner (we could even allow to use EventLoop as owner)? Both options should allow to hide the taskbar icon. I'm a bit hesitant with the current proposal as it might have side effects with other parts.

@amrbashir
Copy link
Contributor Author

amrbashir commented Mar 24, 2022

AFAIK, window styles can't achieve this behavior but I am open to suggestion of what window styles I can look into.

Using EventLoop's window as owner could work. I haven't tried it though so there might be undesirable effects. I will report back when I test this.

Anyways, We have been using this in tao for quite some time now, around 6 or 7 months and there was no side effects observed. Even electron is using the same API.
TBH, I don't understand the hesitance in using ITaskbarList since it is specifically designed for this exact behavior and winit is already using another taskbar interface ITaskbarList2.

Copy link
Member

@msiglreith msiglreith left a comment

Choose a reason for hiding this comment

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

Fair enough, I was looking if there was a cheaper option to achieve this with the existing API but I'm fine with the TaskList API as well. (WS_EX_TOOLWINDOW seems to have some side-effects, the event loop owned window works as well but doesn't allow toggling at runtime). The only smaller issue I found was toggling with borderless will result in always showing the taskbar requiring explicit toggling of borderless to fix it again but that seems rather minor overall.

My only point open would be renaming the functions to set_taskbar and with_taskbar, dropping the skip - fits better to the current API imo.

@amrbashir
Copy link
Contributor Author

amrbashir commented Mar 27, 2022

The only smaller issue I found was toggling with borderless will result in always showing the taskbar requiring explicit toggling of borderless to fix it again but that seems rather minor overall.

Never noticed this behavior before in tao; it might be because we are returning 0 in WM_NCCALCSIZE to achieve borderless. I have another PR #1891 to address this.

My only point open would be renaming the functions to set_taskbar and with_taskbar, dropping the skip - fits better to the current API imo.

The name was straight out taken from electron's setSkipTaskbar and gtk set_skip_taskbar_hint. I feel like with_taskbar and set_taskbar doesn't convey the main usage of the function.

@amrbashir amrbashir requested a review from msiglreith March 29, 2022 09:41
@msiglreith msiglreith merged commit ab1f636 into rust-windowing:master Apr 1, 2022
@amrbashir amrbashir deleted the feat/windows/set-skip-taskbar branch April 1, 2022 18:54
@amrbashir amrbashir restored the feat/windows/set-skip-taskbar branch May 5, 2022 06:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C - waiting on maintainer A maintainer must review this code DS - windows
Development

Successfully merging this pull request may close these issues.

4 participants