Hi Jordan,
I did work on GDI unaware scaling for HiDPI support about a year ago. The idea is that
winex11.drv scales windows for those applications that doesn't really support HiDPI
but the monitor is using a DPI higher than 96. Basically, winex11.drv hides unscaled
windows and use XDamage and XRender extension to scale the content to a new X window
that will be actually shown.
I have a branch at https://github.com/zzhiyi/wine/commits/gdi-unaware-scaling and it doesn't work
right now because of the 32on64 work that moves some user32 function into win32u.
Specifically, I need to fix the compilation error in is_dpi_unaware_scaling_required(). But maybe
you can just hack it to return TRUE to make it work. You also need to set DPI in winecfg to 192 for example.
Then things should generally work although there are some bugs need to be fixed. For example,
launching application after wine prefix creation somehow hides the cursor. And it breaks some d3d tests.
Now that 32on64 work has quite down for winex11.drv, I think I am resume this work.
I may revisit this and try to upstream this in the near future.
You might want to try https://github.com/kaueraal/run_scaled as well.
Thanks,
Zhiyi
On 1/5/23 23:32, Jordan Johnston wrote:
> Hey all,
>
> I'm looking for some pointers on coming up with a hack to better support
> HiDPI with wine on my hi-res display (not something that would be submitted
> upstream. "hack" indeed)... As you are all probably aware; while you can
> adjust DPI in Winecfg, that only affects Windows UI elements ~ but It does
> not help with anything outside of that... I have some apps that are
> basically unusable with HiDPI and i've tried multiple solutions, to no
> avail. (and setting my resolution to 1440x900 isn't a viable solution
> either).
>
> I've been poking around dlls/winex11.drv and I'm wondering if anyone might
> have pointers on how some of the scale related stuff works? -- I'm
> wondering if it may be possible to hack the x11 code to multiply the scale
> of the window contents? (and perhaps, I can then wrap it in an env variable
> for use)...
>
> If anyone has any pointers, or if they think something like this could work
> -- I'd appreciate your insights (again, I'm just looking for kind of a
> one-off hack, not something upstream-able.. I'm sure HiDPI
> compatibility-mode will land upstream, at some point (Windows has this)).
> While I am familiar with some of Wine's internals - the graphics stack,
> window management / x11 code is somewhat alien to me.
>
> Alternatively, i suppose if someone is working on related code and has a
> git branch / patchwork available, I'd be open to try that out too.
>
> Thanks, and Happy New Year to you all!
>
> Jordan
>
>
>