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): Multi-monitor different scaling window size issue #858

Merged
merged 6 commits into from
Jan 10, 2024

Conversation

xiaochen0517
Copy link
Contributor

problem description:tauri-apps/tauri#6843 (comment)

},
});
result = ProcResult::Value(LRESULT(0));
return;
Copy link
Member

Choose a reason for hiding this comment

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

There are more events pending below. Do we have to return early here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I found that the main issue is that the SetWindowPos function was called at the end, and the new parameters passed in caused the window to enlarge. I moved the return to this position mainly so that the ScaleFactorChanged event could trigger normally. Of course, moving it to the end to make the judgment and directly calling the SetWindowPos function with the correct parameters sounds like a more prudent approach.

I'm not good at English, sorry.

Comment on lines +1922 to +1926
// When the "Show window contents while dragging" is turned off, there is no need to adjust the window size.
if !is_show_window_contents_while_dragging_enabled() {
new_physical_inner_size = old_physical_inner_size;
}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think this is look like better. @wusyong

@wusyong
Copy link
Member

wusyong commented Jan 9, 2024

Can you add a change file to explain what this PR does?
I'll merge it after it's added.

@pewsheen
Copy link
Contributor

pewsheen commented Jan 9, 2024

Just a noted, when is_show_window_contents_while_dragging_enabled is true, old_physical_inner_size will slightly smaller than the actual size

@xiaochen0517
Copy link
Contributor Author

@wusyong Where do I need to add the description? In the CHANGELOG.md or somewhere else?

@wusyong
Copy link
Member

wusyong commented Jan 9, 2024

See .changes. Basically you add a md file in that directory.

@xiaochen0517
Copy link
Contributor Author

@wusyong Thank you very much for the help, I've added a change file to the .change directory.

@wusyong
Copy link
Member

wusyong commented Jan 10, 2024

@xiaochen0517 I couldn't merge the PR because you have to sign your commits.

@xiaochen0517 xiaochen0517 force-pushed the fix/multi-monitor-scaling branch from d5f863f to 73948bd Compare January 10, 2024 07:11
@xiaochen0517
Copy link
Contributor Author

@wusyong Okay, I have added a sign to all my submits, thank you.

@wusyong wusyong merged commit 60bbcac into tauri-apps:dev Jan 10, 2024
9 checks passed
@github-actions github-actions bot mentioned this pull request Jan 10, 2024
@wf-soft
Copy link

wf-soft commented Oct 21, 2024

This issue seems to have not been fixed and still exists when using the official version 2.0

@wf-soft
Copy link

wf-soft commented Oct 21, 2024

@xiaochen0517 My system is Windows 11 and Show window contents while dragging is enabled

@xiaochen0517
Copy link
Contributor Author

@xiaochen0517 My system is Windows 11 and Show window contents while dragging is enabled

When I was testing, if the option to show window contents while dragging was enabled, this issue did not occur.

@xiaochen0517
Copy link
Contributor Author

This issue seems to have not been fixed and still exists when using the official version 2.0

This pull request should only modify the tao project that Tauri 1.0 depends on, while Tauri 2.0 should depend on a different version.

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.

4 participants