Skip to content

Conversation

@Tom-Evers
Copy link

Fixes small mistake in 542cb87

Description

Should fix a small mistake in 542cb87 by taking the scaling factor (dpi) from the display the widget is on, instead of the main display

Motivation and Context

The old commit took the scale factor with devicePixelRatioF, but that seems to be the scale factor of the main monitor.
Which is not necessarily the same as the scale factor the VST plugin (widget) is on.

And this indeed causes a problem in the following situation

  • I'm running OBS on my second monitor on 100%
  • My main monitor is running on 125%
  • I open the plugin window, which reports a size of 1000x500 (and creates a child window of that size)
  • OBS gives me a host window on my second (100%) monitor

Expected behaviour:

  • The host window is 1000x500 as it is on a 100% monitor

Observed behaviour:

  • The host window is scaled down to 800x400 (divided by 1.25)

Here is an image of the consequences (note the cut-off contents on the right and bottom sides):
image

How Has This Been Tested?

It hasn't.

Types of changes

I'm calling a function on a specific window.

Checklist:

  • My code has been run through clang-format.
  • I have read the contributing document.
  • My code is not on the master branch.
  • The code has been tested.
  • All commit messages are properly formatted and commits squashed where appropriate.
  • I have included updates to all appropriate documentation.
    This is my first ever pull request, no idea what to do or how to do these things. I just wanted to fix a bug.

@derrod derrod requested a review from WizardCM February 7, 2024 00:57
Copy link
Member

@RytoEX RytoEX left a comment

Choose a reason for hiding this comment

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

Please be sure to select an option under "Types of changes" and fill out the checklist as appropriate in the PR template. Please also make sure that your commit message and PR title conform with our Commit Guidelines.

@Tom-Evers Tom-Evers changed the title Get the device pixel ratio from the correct device obs-vst: Get the device pixel ratio from the correct device Feb 7, 2024
@Tom-Evers Tom-Evers changed the title obs-vst: Get the device pixel ratio from the correct device obs-vst: Get devicePixelRatio from correct device Feb 7, 2024
@Tom-Evers
Copy link
Author

Please be sure to select an option under "Types of changes" and fill out the checklist as appropriate in the PR template. Please also make sure that your commit message and PR title conform with our Commit Guidelines.

I cannot change the commit message anymore (without force pushing anyway).

I don't want to sound like a complete a-hole, but I really don't have time to spend on this. Could someone just check if this works and put it in the next beta if it does?

@RytoEX
Copy link
Member

RytoEX commented Feb 7, 2024

I cannot change the commit message anymore (without force pushing anyway).

Force pushing to fix commit messages is fine.

Could someone just check if this works and put it in the next beta if it does?

I don't use VSTs and I don't have multiple displays, so I cannot validate this. Someone else will have to do it, which occurs on their own free time when they can.

@WizardCM WizardCM self-assigned this Feb 10, 2024
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