After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 777031 - win32 HiDPI assert
win32 HiDPI assert
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Backend: Win32
3.21.x
Other Linux
: Normal normal
: ---
Assigned To: gtk-win32 maintainers
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2017-01-09 09:05 UTC by Christoph Reiter (lazka)
Modified: 2017-01-09 14:10 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
GDK W32: Remove unneeded assertion v1 (1.25 KB, patch)
2017-01-09 10:00 UTC, LRN
committed Details | Review

Description Christoph Reiter (lazka) 2017-01-09 09:05:05 UTC
Got a bug report that this triggers:

https://git.gnome.org/browse/gtk+/tree/gdk/win32/gdkdisplay-win32.c?h=3.22.5#n941

https://github.com/quodlibet/quodlibet/issues/2186

From what I see this assert is reached in case SetProcessDPIAwareness returns E_ACCESSDENIED or shcore.dll is not found.

I think the logic should be changed to be the same as the windows 8 case below it.
Comment 1 LRN 2017-01-09 10:00:35 UTC
Created attachment 343136 [details] [review]
GDK W32: Remove unneeded assertion v1

Just set check_for_dpi_awareness = TRUE and eventually it will be handled
correctly, even if setDpiAwareFunc() returns E_ACCESSDENIED or shcore functions
are NULL.
Comment 2 Christoph Reiter (lazka) 2017-01-09 10:33:10 UTC
thanks, lgtm at least
Comment 3 Fan, Chun-wei 2017-01-09 10:47:55 UTC
Hi LRN,

Hmm, I forgot to check for check_for_dpi_awareness before the assert... oops.

I would actually rather check if check_for_dpi_awareness is FALSE before going into the block where the assert is done, because something is wrong if we get into that block otherwise.

Let me know it this issue persists, because this should be caused by access denied, not the shcore items being NULL.

With blessings, thank you!
Comment 4 LRN 2017-01-09 11:10:16 UTC
My understanding is that first part of the code tries to *set* DPI awareness.
If that can't be done (because functions are missing, or they return certain errors), the second part is used to check DPI awareness that is actually set (by the system, or manifest, or some other sort of uncontrollable means).

Therefore i think that display->shcore_funcs.setDpiAwareFunc == NULL should lead to check_for_dpi_awareness = TRUE, and getting E_ACCESSDENIED should do the same. Setting status and DPI awareness at this point is premature.
Comment 5 Fan, Chun-wei 2017-01-09 13:52:38 UTC
Hi LRN,

This seems that the program is on 8.1+, hence this path is taken.  Notice for Vista~8 something similar is done for HiDPI support.

We can certainly check for DPI awareness setting if acquiring the function failed, and end up without HiDPI support in the end, as checking for the DPI setting can very well fail, since we are still using shcore.dll.

To me this would be more like a system issue if shcore.dll can't be loaded with the needed functions, as shcore.dll is part of 8.1+.

My take on this.

With blessings, and cheers!
Comment 6 LRN 2017-01-09 14:08:47 UTC
I'm not sure whether you're agreeing or disagreeing with my assessment, so i'll just push this patch as-is, and we'll adjust the code later if need be.
Comment 7 LRN 2017-01-09 14:10:08 UTC
Attachment 343136 [details] pushed into gtk-3-22 as commit 51645b585123de193da0360d3a69f767a3c4fa59