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 450760 - gdk_screen_get_resolution returns -1 on Windows
gdk_screen_get_resolution returns -1 on Windows
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Backend: Win32
2.10.x
Other Linux
: Normal normal
: ---
Assigned To: Mathias Hasselmann (IRC: tbf)
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2007-06-24 22:36 UTC by Mathias Hasselmann (IRC: tbf)
Modified: 2015-06-21 01:49 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Mathias Hasselmann (IRC: tbf) 2007-06-24 22:36:57 UTC
A resonable default value for the screen resolution could be retreived by using this code <http://blogs.msdn.com/oldnewthing/archive/2004/07/14/182971.aspx>:

int GetScreenDPI()
{
  HDC hdcScreen = GetDC(NULL);
  int iDPI = -1; // assume failure
  if (hdcScreen) {
    iDPI = GetDeviceCaps(hdcScreen, LOGPIXELSX);
    ReleaseDC(NULL, hdcScreen);
  }
  return iDPI;
}

The routine could be injected into gtksettings.c - similiar to the code for the X11 backend.
Comment 1 Mathias Hasselmann (IRC: tbf) 2007-06-24 22:41:20 UTC
Bah, obviously bed time.
Comment 2 Jose Rostagno 2014-08-07 19:14:17 UTC
This bug was fixed in commit https://git.gnome.org/browse/gtk+/commit/?id=f38498ed841f6e63b1904e92be48c9f5f429bd31