From cdaff761f7259e9a0bafa349257abf538afe4b9f Mon Sep 17 00:00:00 2001 From: Albrecht Schlosser Date: Fri, 7 Jan 2011 12:39:51 +0000 Subject: src/screen_xywh.cxx: Fix X11 screen_init() if Xinerama is available, but not active. Still investigating why there are nonsense dpi values under Cygwin/X11, but maybe this is an X server problem. test/hello.cxx: Extended test statements - don't forget to remove before release. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@8210 ea41ed52-d2ee-0310-a9c1-e6b18d33e121 --- src/screen_xywh.cxx | 21 +++++++++++++-------- test/hello.cxx | 14 +++++++++++--- 2 files changed, 24 insertions(+), 11 deletions(-) diff --git a/src/screen_xywh.cxx b/src/screen_xywh.cxx index 6becbf979..9ed788d0b 100644 --- a/src/screen_xywh.cxx +++ b/src/screen_xywh.cxx @@ -56,7 +56,7 @@ typedef BOOL (WINAPI* fl_gmi_func)(HMONITOR, LPMONITORINFO); static fl_gmi_func fl_gmi = NULL; // used to get a proc pointer for GetMonitorInfoA static RECT screens[16]; -static int dpi[16][2] = { { 0.0f, 0.0f } }; +static float dpi[16][2]; static BOOL CALLBACK screen_cb(HMONITOR mon, HDC, LPRECT r, LPARAM) { if (num_screens >= 16) return TRUE; @@ -135,14 +135,19 @@ static void screen_init() { if (XineramaIsActive(fl_display)) { screens = XineramaQueryScreens(fl_display, &num_screens); - } else num_screens = 1; - - int i; - for (i=0; i int main(int argc, char **argv) { - float h, v; - Fl::screen_dpi(h, v); - printf("Screen res is %g x %g ppi\n", h, v); +#if (1) // FIXME: test screen dimensions and resolution. Remove before release ! + float ppi_h, ppi_v; + int x,y,w,h; + int n = Fl::screen_count(); + for (int i=0; ibox(FL_UP_BOX); -- cgit v1.2.3