From 24487a719f2fe1b2ebbb1698a8a2009cd7f58777 Mon Sep 17 00:00:00 2001 From: Manolo Gouy Date: Tue, 19 Apr 2016 15:47:23 +0000 Subject: [PATCH] Move Fl_X::make_fullscreen() for WIN32 platform to Fl_WinAPI_Window_Driver:: make_fullscreen(). git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11660 ea41ed52-d2ee-0310-a9c1-e6b18d33e121 --- FL/win32.H | 2 -- src/Fl_win32.cxx | 2 +- src/drivers/WinAPI/Fl_WinAPI_Window_Driver.H | 1 + .../WinAPI/Fl_WinAPI_Window_Driver.cxx | 19 ++++++++++--------- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/FL/win32.H b/FL/win32.H index 9d137dbdf..ba5a6ae6a 100644 --- a/FL/win32.H +++ b/FL/win32.H @@ -54,11 +54,9 @@ public: Fl_Region region; Fl_X *next; HDC private_dc; // used for OpenGL - HDC saved_hdc; // saves the handle of the DC currently loaded // static variables, static functions and member functions static Fl_X* first; static Fl_X* i(const Fl_Window* w) {return (Fl_X*)w->i;} - void make_fullscreen(int X, int Y, int W, int H); }; extern FL_EXPORT UINT fl_wake_msg; extern FL_EXPORT char fl_override_redirect; // hack into Fl_Window::make_xid() diff --git a/src/Fl_win32.cxx b/src/Fl_win32.cxx index b4292f8e3..9d4c6e32e 100644 --- a/src/Fl_win32.cxx +++ b/src/Fl_win32.cxx @@ -1842,7 +1842,7 @@ Fl_X* Fl_WinAPI_Window_Driver::makeWindow() { monitor the window was placed on. */ RECT rect; GetWindowRect(x->xid, &rect); - x->make_fullscreen(rect.left, rect.top, + make_fullscreen(rect.left, rect.top, rect.right - rect.left, rect.bottom - rect.top); } diff --git a/src/drivers/WinAPI/Fl_WinAPI_Window_Driver.H b/src/drivers/WinAPI/Fl_WinAPI_Window_Driver.H index 2d45307e3..a286bcec0 100644 --- a/src/drivers/WinAPI/Fl_WinAPI_Window_Driver.H +++ b/src/drivers/WinAPI/Fl_WinAPI_Window_Driver.H @@ -74,6 +74,7 @@ public: int custom_cursor; void set_minmax(LPMINMAXINFO minmax); int fake_X_wm(int &X, int &Y, int &bt,int &bx,int &by); + void make_fullscreen(int X, int Y, int W, int H); // --- window data virtual int decorated_w(); virtual int decorated_h(); diff --git a/src/drivers/WinAPI/Fl_WinAPI_Window_Driver.cxx b/src/drivers/WinAPI/Fl_WinAPI_Window_Driver.cxx index fd8eac8e6..ab4f7a543 100644 --- a/src/drivers/WinAPI/Fl_WinAPI_Window_Driver.cxx +++ b/src/drivers/WinAPI/Fl_WinAPI_Window_Driver.cxx @@ -478,14 +478,15 @@ void Fl_WinAPI_Window_Driver::unmap() { #if !defined(FL_DOXYGEN) // FIXME - silence Doxygen warning -void Fl_X::make_fullscreen(int X, int Y, int W, int H) { +void Fl_WinAPI_Window_Driver::make_fullscreen(int X, int Y, int W, int H) { + Fl_Window *w = pWindow; int top, bottom, left, right; int sx, sy, sw, sh; - top = w->fullscreen_screen_top; - bottom = w->fullscreen_screen_bottom; - left = w->fullscreen_screen_left; - right = w->fullscreen_screen_right; + top = fullscreen_screen_top(); + bottom = fullscreen_screen_bottom(); + left = fullscreen_screen_left(); + right = fullscreen_screen_right(); if ((top < 0) || (bottom < 0) || (left < 0) || (right < 0)) { top = Fl::screen_num(X, Y, W, H); @@ -503,12 +504,12 @@ void Fl_X::make_fullscreen(int X, int Y, int W, int H) { Fl::screen_xywh(sx, sy, sw, sh, right); W = sx + sw - X; - DWORD flags = GetWindowLong(xid, GWL_STYLE); + DWORD flags = GetWindowLong(fl_xid(w), GWL_STYLE); flags = flags & ~(WS_THICKFRAME|WS_CAPTION); - SetWindowLong(xid, GWL_STYLE, flags); + SetWindowLong(fl_xid(w), GWL_STYLE, flags); // SWP_NOSENDCHANGING is so that we can override size limits - SetWindowPos(xid, HWND_TOP, X, Y, W, H, SWP_NOSENDCHANGING | SWP_FRAMECHANGED); + SetWindowPos(fl_xid(w), HWND_TOP, X, Y, W, H, SWP_NOSENDCHANGING | SWP_FRAMECHANGED); } #endif // !defined(FL_DOXYGEN) // FIXME - silence Doxygen warning @@ -516,7 +517,7 @@ void Fl_X::make_fullscreen(int X, int Y, int W, int H) { void Fl_WinAPI_Window_Driver::fullscreen_on() { pWindow->_set_fullscreen(); - Fl_X::i(pWindow)->make_fullscreen(x(), y(), w(), h()); + make_fullscreen(x(), y(), w(), h()); Fl::handle(FL_FULLSCREEN, pWindow); }