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

GetContentScaleFactor() returns 1.0 under Linux even if scaling is set to 200% #1327

Closed
DarkFenX opened this issue Aug 16, 2019 · 4 comments
Closed

Comments

@DarkFenX
Copy link

Operating system: Debian Testing, affects X11 installation - cannot test on Wayland
wxPython version & source: 4.0.6+dfsg-1 from Debian repo
Python version & source: python 3.7 from debian repo

Description of the problem:
Content scaling is returned as 1 despite actually being 2, which leads to inability to use hi-res assets within the app.

import wx


class MainFrame(wx.Frame):

    def __init__(self):
        wx.Frame.__init__(self, None, wx.ID_ANY, 'test')
        self.Maximize()
        self.Show()
        print(wx.GetApp().GetTopWindow().GetContentScaleFactor())


app = wx.App(False)
mf = MainFrame()
app.MainLoop()

image

@DarkFenX
Copy link
Author

Looking through the docs, i suppose it's something which is handled by FromDIP in 3.10? https://wxpython.org/Phoenix/docs/html/wx.Window.html#wx.Window.FromDIP

@RobinD42
Copy link
Member

The GTK3 implementation of GetContentScaleFactor in 3.1 is doing the right thing:

Snap001

@swt2c
Copy link
Collaborator

swt2c commented Aug 25, 2019

Yep. wxWidgets issue. We're looking at trying to backport some of the HiDPI fixes to 3.0 though.

@DarkFenX
Copy link
Author

DarkFenX commented Nov 16, 2019

FYI returns 2.0 in 4.0.7.

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

No branches or pull requests

3 participants