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

Add dpiAwareness option to manifest and send physicial viewport size to Spout #3462

Merged
merged 4 commits into from Oct 14, 2023

Conversation

hmartinez82
Copy link
Contributor

Qt 6 defaults to PerMonitorV2 as its DPI awareness options.

Description

The ACCESS_DENIED error was happening because the setting was being set by the manifest file and then, when the QGuiApplication instance is being created, it calls SetProcessDpiAwarenessContext() which clearly states that setting that after the manifest also sets it will lead to ACCESS_DENIED.

Adding the options before Qt tries to set it ensures it won't try to call SetProcessDpiAwarenessContext() because the process will already be PerMonitorV2. (Qt checks the current options before trying to change it, see https://github.com/qt/qtbase/blob/v6.5.3/src/plugins/platforms/windows/qwindowscontext.cpp#L397)

Fixes #3461

Type of change

  • Bug fix (non-breaking change which fixes an issue)

@hmartinez82 hmartinez82 changed the title Add dpiAwareness option to manifest that matches the default one Qt 6 tries to use WIP: Add dpiAwareness option to manifest that matches the default one Qt 6 tries to use Oct 14, 2023
@hmartinez82 hmartinez82 changed the title WIP: Add dpiAwareness option to manifest that matches the default one Qt 6 tries to use WIP: Add dpiAwareness option to manifest that matches the one Qt 6 defaults to Oct 14, 2023
@alex-w alex-w added this to Needs triage in OS: Windows via automation Oct 14, 2023
@alex-w alex-w added this to Needs triage in Hardware: HiDPI via automation Oct 14, 2023
@alex-w alex-w added this to the 23.4 milestone Oct 14, 2023
@hmartinez82
Copy link
Contributor Author

Looking better :)
image

@hmartinez82 hmartinez82 changed the title WIP: Add dpiAwareness option to manifest that matches the one Qt 6 defaults to Add dpiAwareness option to manifest and send physicial viewport size to Spout Oct 14, 2023
@hmartinez82 hmartinez82 marked this pull request as ready for review October 14, 2023 08:29
@github-actions
Copy link

Great PR! Please pay attention to the following items before merging:

Files matching src/**/*.cpp:

  • Are possibly unused includes removed?

This is an automatically generated QA checklist based on modified files.

@hmartinez82
Copy link
Contributor Author

hmartinez82 commented Oct 14, 2023

I tested moving the Stellarium window from a 200%DPI to a 125%DPI and a 100% DPI and back, the resize SIGNAL is also handling those cases. So, I don't have to manually handle the screenChanged events \o/

Left monitor 200% DPI, right monitor 125%DPI

Main window in the 200% DPI monitor
image

Main window in the 125% DPI monitor
image

Copy link
Member

@alex-w alex-w left a comment

Choose a reason for hiding this comment

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

Looks good!

Hardware: HiDPI automation moved this from Needs triage to In progress Oct 14, 2023
OS: Windows automation moved this from Needs triage to In progress Oct 14, 2023
@alex-w alex-w merged commit 715eb85 into Stellarium:master Oct 14, 2023
9 of 10 checks passed
OS: Windows automation moved this from In progress to Done Oct 14, 2023
Hardware: HiDPI automation moved this from In progress to Done Oct 14, 2023
@hmartinez82 hmartinez82 deleted the PerMonitorV2 branch October 14, 2023 08:52
@alex-w alex-w added the state: published The fix has been published for testing in weekly binary package label Oct 23, 2023
@github-actions
Copy link

Hello @hmartinez82!

Please check the fresh version (development snapshot) of Stellarium:
https://github.com/Stellarium/stellarium-data/releases/tag/weekly-snapshot

@alex-w alex-w removed the state: published The fix has been published for testing in weekly binary package label Dec 23, 2023
Copy link

Hello @hmartinez82!

Please check the latest stable version of Stellarium:
https://github.com/Stellarium/stellarium/releases/latest

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
OS: Windows
  
Done
Development

Successfully merging this pull request may close these issues.

Modern Spout receivers are receiving blank content / DPI issue with updated spout
2 participants