Skip to content

Commit

Permalink
DPI fixes for MSWindows GDI
Browse files Browse the repository at this point in the history
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@8205 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
  • Loading branch information
Matthias Melcher committed Jan 7, 2011
1 parent 7dc05cb commit 308c6bc
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 6 deletions.
14 changes: 11 additions & 3 deletions src/Fl_win32.cxx
Expand Up @@ -1068,8 +1068,12 @@ static LRESULT CALLBACK WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lPar
}
}
} else if ((lParam & (1<<31))==0){
buffer[0] = 0;
Fl::e_length = 0;
//buffer[0] = 0;
//Fl::e_length = 0;
xchar u = (xchar) wParam;
// Fl::e_length = fl_unicode2utf(&u, 1, buffer);
Fl::e_length = fl_utf8fromwc(buffer, 1024, &u, 1);
buffer[Fl::e_length] = 0;
}
Fl::e_text = buffer;
if (lParam & (1<<31)) { // key up events.
Expand All @@ -1078,7 +1082,11 @@ static LRESULT CALLBACK WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lPar
}
// for (int i = lParam&0xff; i--;)
while (window->parent()) window = window->window();
if (Fl::handle(FL_KEYBOARD,window)) return 0;
if (Fl::handle(FL_KEYBOARD,window)) {
if (uMsg==WM_DEADCHAR || uMsg==WM_SYSDEADCHAR)
Fl::compose_state = 1;
return 0;
}
break;}

case WM_MOUSEWHEEL: {
Expand Down
6 changes: 3 additions & 3 deletions src/screen_xywh.cxx
Expand Up @@ -76,7 +76,7 @@ static BOOL CALLBACK screen_cb(HMONITOR mon, HDC, LPRECT r, LPARAM) {
dpi[num_screens][0] = (float)GetDeviceCaps(screen, LOGPIXELSX);
dpi[num_screens][1] = (float)GetDeviceCaps(screen, LOGPIXELSY);
}
ReleaseDC();
ReleaseDC(0L, screen);
}

num_screens ++;
Expand All @@ -97,7 +97,7 @@ static void screen_init() {
// We do have EnumDisplayMonitors, so lets find out how many monitors...
num_screens = GetSystemMetrics(SM_CMONITORS);

if (num_screens > 1) {
// if (num_screens > 1) {
// If there is more than 1 monitor, enumerate them...
fl_gmi = (fl_gmi_func)GetProcAddress(hMod, "GetMonitorInfoA");

Expand All @@ -109,7 +109,7 @@ static void screen_init() {
fl_edm(0, 0, screen_cb, 0);
return;
}
}
// }
}
}

Expand Down

0 comments on commit 308c6bc

Please sign in to comment.