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

fix(windows): Ignore resize event when minimizing frameless windows #909

Merged
merged 2 commits into from
Mar 24, 2023
Merged

Conversation

ahodesuka
Copy link
Contributor

@ahodesuka ahodesuka commented Mar 23, 2023

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Docs
  • Code style update
  • Refactor
  • Build-related changes
  • Other, please describe:

Does this PR introduce a breaking change?

  • Yes
  • No

Checklist

  • This PR will resolve #___
  • 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
  • It can be built on all targets and pass CI/CD.

Other information

I am by no means an experienced Rust programmer so if there's a better way of getting the Rc<Window> into the SetWindowSubclass callback let me know.

Here is the issue that this PR resolves, it is very noticeable here because I'm displaying a large image in the webview.

before-change.mp4

And with these changes it looks like this:

after-change.mp4

@ahodesuka ahodesuka requested a review from a team as a code owner March 23, 2023 15:54
@wusyong
Copy link
Member

wusyong commented Mar 24, 2023

LGTM but I want to know @amrbashir 's feedback.

@wusyong wusyong requested a review from amrbashir March 24, 2023 06:32
Comment on lines 749 to 757
if wparam == WPARAM(win32wm::SIZE_MINIMIZED as _) {
let _ = (*controller).SetIsVisible(false);
let _ = controller.SetIsVisible(false);
}

if wparam == WPARAM(win32wm::SIZE_RESTORED as _)
|| wparam == WPARAM(win32wm::SIZE_MAXIMIZED as _)
{
let _ = (*controller).SetIsVisible(true);
let _ = controller.SetIsVisible(true);
}
Copy link
Member

@amrbashir amrbashir Mar 24, 2023

Choose a reason for hiding this comment

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

revert all the changes and just remove the visibility handling, and it should be good. This doesn't need to be only for frameless windows.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

@amrbashir amrbashir merged commit f76568a into tauri-apps:dev Mar 24, 2023
@github-actions github-actions bot mentioned this pull request Mar 24, 2023
amrbashir pushed a commit that referenced this pull request Apr 18, 2023
…909)

* fix(windows): Do not toggle webview visibility when minimizing

* Update .changes/frameless-minimize-windows.md

---------

Co-authored-by: ahodesuka <ahodesuka@users.noreply.github.com>
amrbashir pushed a commit that referenced this pull request Apr 18, 2023
…909)

* fix(windows): Do not toggle webview visibility when minimizing

* Update .changes/frameless-minimize-windows.md

---------

Co-authored-by: ahodesuka <ahodesuka@users.noreply.github.com>
@github-actions github-actions bot mentioned this pull request May 6, 2023
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.

3 participants