News for hackers. Stuff that matters.
Re:Windows 11: Just say no by alkonaut on Thursday September 16, 2021 @04:49PM (#28557370)
> It's not broke, stop trying to fix it.

There could have been better ways to keep it modern, but just leaving everything alone because “it works” isn’t really an option. First comes Unicode, then 4K/High-dpi scaling, then touch support and so on.

Once high DPI screens arrived, UIs that scaled poorly literally don’t work.

Re:Windows 11: Just say no by zozbot234 on Thursday September 16, 2021 @05:08PM (#28557632)
The Win32 widgets are scalable, actually. They support device-independent units out of the box, even in Windows 95.
Re:Windows 11: Just say no by Dork1234 on Thursday September 16, 2021 @07:25PM (#28559103)
The only people that say Win32 apps are scalable are the ones that haven't dealt with legacy code. There is jut too much legacy code that either doesn't work, or doesn't work correctly with HiDPI screens.
Re:Windows 11: Just say no by jussij on Thursday September 16, 2021 @08:14PM (#28559524)
At a minimum, for a Win32 application to work correctly with HiDPI it needs to tell the OS it is DPI aware.

This is done by marking the application DPI aware using the settings found in the manifest file.

The manifest file is then embedded into the resource section of the application, which then lets the OS know the application will be handling it's own DPI.

So the reason many of those 'legacy apps' don't work with HiDPI is they don't have those required manifest changes in place.

That then means the OS does the DPI scaling on behalf of the application and that results in poor scaling outcomes.

Re:Windows 11: Just say no by Dork1234 on Thursday September 16, 2021 @11:23PM (#28560846)
So you enable it by editing the manifest file and embedding the manifest file, but with legacy applications the HiDPI scaling might not be calculated correctly, or something assumes Pixels or DIP incorrectly. It might be something in a custom control in MFC, or a library or DLL where the source is long gone and no one can update, or even worst something doing something via COM and VB6.
Re:Windows 11: Just say no by jussij on Thursday September 16, 2021 @11:58PM (#28561046)
That is correct. You enable it with the manifest and then you handle the scaling in the application code.

> something assumes Pixels or DIP incorrectly.

These are exactly the types of problems legacy applications run into.

They will contain hard coded assumption in their code and many of those will be 'pixel based' assumptions.

Re:Windows 11: Just say no by Joeri on Friday September 17, 2021 @01:34AM (#28561622)
Applications also have to listen for messages that indicate a dpi change (moving between screens) and recalculate and redraw everything for the new dpi. The legacy codebases which are easily retrofitted to do that are the stuff of myths and legends.
Re:Windows 11: Just say no by jussij on Friday September 17, 2021 @10:20AM (#28565809)
> Applications also have to listen for messages that indicate a dpi change

That is how a well behaved 'DPI Aware' application should work.

However, even for those badly written DPI applications that don't listen for those changes, the work around is to first make the required DPI changes and then restart those badly written DPI applications, as they will then pick up those DPI changes on startup.

Re:Windows 11: Just say no by AnIdiotOnTheNet on Friday September 17, 2021 @07:18AM (#28564010)
So the solution is to push a completely new UI framework as though that won't require any code to be touched?
Re:Windows 11: Just say no by mycall on Thursday September 16, 2021 @10:20PM (#28560502)
How do you patch these executables? I know 7zip can open .exe but there must be a better way.
Re:Windows 11: Just say no by jussij on Thursday September 16, 2021 @11:49PM (#28560996)
It is not a trivial change to make the application DPI ware as it is a coding exercise (starting with that manifest change).

https://docs.microsoft.com/en-us/previous-versions/windows/d...

Marking the app DPI aware just stops Windows doing any application scaling as it leaves that scaling up to the application.

But the real issue is most legacy apps were written before DPI scaling was an issue so they don't have this built in scaling.

To fix this Windows will do a 'one size fits all' scaling on their behalf.

It is this default Windows scaling that makes these legacy apps look so bad at higher DPI settings.

Re:Windows 11: Just say no by foobiekr on Thursday September 16, 2021 @05:01PM (#28557534)
NT 3.1 (that is, the _first_ release of Windows NT in 1993) supported Unicode, at least as far as the UI elements were concerned (that it was UTF-16, well, ...)
Re:Windows 11: Just say no by corty on Thursday September 16, 2021 @06:00PM (#28558269)
Nope, UCS-2. Which is UTF-16, but just the BMP, so only the first 65k codepoints and all characters are fixed-length 16bits. Only later windows versions at some point learned UTF-16.
Re:Windows 11: Just say no by matja on Thursday September 16, 2021 @07:51PM (#28559341)
The UI did scale, but lots of apps were poorly coded.

> Marlett is a TrueType font that has been used in Microsoft Windows since Windows 95. The operating system uses this font to create user interface icons that are used in the menus and windows.

https://en.wikipedia.org/wiki/Marlett

Re:Windows 11: Just say no by tonyedgecombe on Friday September 17, 2021 @03:22AM (#28562280)
Apple managed to support high-dpi without turning the whole thing upside down.
Re:Windows 11: Just say no by vetinari on Friday September 17, 2021 @06:44AM (#28563705)
Apple doesn't run 20 years old binaries. On the contrary, they break ABIs faster than Linux distros, so they can move faster.
Re:Windows 11: Just say no by tonyedgecombe on Friday September 17, 2021 @08:29AM (#28564659)
What did they break in order to support high-dpi?
Re:Windows 11: Just say no by flohofwoe on Friday September 17, 2021 @05:00AM (#28562923)
Because they had aquired a solid foundation that had fixed this problem already 30 years ago (NextStep with Display PostScript).