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

Set correct resolution for high DPI displays (with vidext). #110

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

comex
Copy link

@comex comex commented May 29, 2017

Resolution is still screwy in general for me (e.g. video is slightly too
high; window is resizable even though video plugin doesn't want it to
be...), but that happens regardless of whether I have high DPI enabled,
so it seems to be unrelated.

Not sure if this is the best way to do this.

Resolution is still screwy in general for me (e.g. video is slightly too
high; window is resizable even though video plugin doesn't want it to
be...), but that happens regardless of whether I have high DPI enabled,
so it seems to be unrelated.

Not sure if this is the best way to do this.
@gen2brain
Copy link
Member

With your patch I am getting this after resize http://imagizer.imageshack.com/img924/9485/GTh81b.png , the image is cut off, where it should be like this http://imagizer.imageshack.com/img924/4248/VVVoG2.png . Note that the resize will only work correctly with rice video plugin, other plugins don't have resizing implemented.

@comex
Copy link
Author

comex commented May 29, 2017

Oops, typo - I had real_height = int(width * ratio).

After fixing that, resizing is still rather broken on my system, but that happens with or without this patch. Sigh...

screen shot 2017-05-29 at 5 57 54 pm

@gen2brain
Copy link
Member

Looks ok now, but I am not sure what would this suppose to fix.
Do you have some examples, what video card you are using, does it happens in all games etc. So far nobody reported such problems.

@gen2brain
Copy link
Member

I didn't know about the http://doc.qt.io/qt-5/qwindow.html#devicePixelRatio but it was probably not available in Qt4 or I missed it somehow.

@comex
Copy link
Author

comex commented May 29, 2017

Thanks for the response.

Qt documentation for "High DPI Displays"

As far as I can tell from there, scaling is only enabled by default on macOS, although it can be manually enabled on other platforms. On all Macs with a Retina display, devicePixelRatio will be 2. Without this patch, the video only covers a quarter of the window (and the rest is red).

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.

None yet

2 participants