summaryrefslogtreecommitdiff
path: root/src/drivers/WinAPI/Fl_WinAPI_Window_Driver.cxx
diff options
context:
space:
mode:
authorManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>2021-02-01 13:25:24 +0100
committerManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>2021-02-01 13:25:39 +0100
commit8eed8b9600a3554a0ec88654c91984bdf0db22f6 (patch)
tree34af05205f4082e3098a13c6cf2283ff82905f21 /src/drivers/WinAPI/Fl_WinAPI_Window_Driver.cxx
parent246291fe51734f9be73f457a7c4da00f2413a3dd (diff)
Scaling support under Windows: fix fullscreen window mode.
When scale was > 1, fullscreen window did not cover the task bar, as seen with test/fullscreen.
Diffstat (limited to 'src/drivers/WinAPI/Fl_WinAPI_Window_Driver.cxx')
-rw-r--r--src/drivers/WinAPI/Fl_WinAPI_Window_Driver.cxx20
1 files changed, 9 insertions, 11 deletions
diff --git a/src/drivers/WinAPI/Fl_WinAPI_Window_Driver.cxx b/src/drivers/WinAPI/Fl_WinAPI_Window_Driver.cxx
index aa20c0c7f..5b50b64b1 100644
--- a/src/drivers/WinAPI/Fl_WinAPI_Window_Driver.cxx
+++ b/src/drivers/WinAPI/Fl_WinAPI_Window_Driver.cxx
@@ -536,7 +536,7 @@ void Fl_WinAPI_Window_Driver::unmap() {
#if !defined(FL_DOXYGEN) // FIXME - silence Doxygen warning
void Fl_WinAPI_Window_Driver::make_fullscreen(int X, int Y, int W, int H) {
- Fl_Window *w = pWindow;
+ Window xid = fl_xid(pWindow);
int top, bottom, left, right;
int sx, sy, sw, sh;
@@ -552,22 +552,20 @@ void Fl_WinAPI_Window_Driver::make_fullscreen(int X, int Y, int W, int H) {
right = top;
}
- Fl::screen_xywh(sx, sy, sw, sh, top);
- Y = sy;
- Fl::screen_xywh(sx, sy, sw, sh, bottom);
+ Fl_WinAPI_Screen_Driver *scr_dr = (Fl_WinAPI_Screen_Driver*)Fl::screen_driver();
+ scr_dr->screen_xywh_unscaled(sx, Y, sw, sh, top);
+ scr_dr->screen_xywh_unscaled(sx, sy, sw, sh, bottom);
H = sy + sh - Y;
- Fl::screen_xywh(sx, sy, sw, sh, left);
- X = sx;
- Fl::screen_xywh(sx, sy, sw, sh, right);
+ scr_dr->screen_xywh_unscaled(X, sy, sw, sh, left);
+ scr_dr->screen_xywh_unscaled(sx, sy, sw, sh, right);
W = sx + sw - X;
- DWORD flags = GetWindowLong(fl_xid(w), GWL_STYLE);
+ DWORD flags = GetWindowLong(xid, GWL_STYLE);
flags = flags & ~(WS_THICKFRAME|WS_CAPTION);
- SetWindowLong(fl_xid(w), GWL_STYLE, flags);
+ SetWindowLong(xid, GWL_STYLE, flags);
// SWP_NOSENDCHANGING is so that we can override size limits
- float s = Fl::screen_driver()->scale(screen_num());
- SetWindowPos(fl_xid(w), HWND_TOP, X*s, Y*s, W*s, H*s, SWP_NOSENDCHANGING | SWP_FRAMECHANGED);
+ SetWindowPos(xid, HWND_TOP, X, Y, W, H, SWP_NOSENDCHANGING | SWP_FRAMECHANGED);
}
#endif // !defined(FL_DOXYGEN) // FIXME - silence Doxygen warning