Replace Fl_Window_Driver::is_a_rescale() by Fl_Window::is_a_rescale()

so it can be called by any user code.
This commit is contained in:
ManoloFLTK 2020-05-08 17:08:20 +02:00
parent ccb06e18b7
commit 7f7e0e4ea1
10 changed files with 14 additions and 11 deletions

View File

@ -541,6 +541,7 @@ public:
void shape(const Fl_Image& b) ;
const Fl_Image *shape();
int screen_num();
static bool is_a_rescale();
};
#endif

View File

@ -54,7 +54,7 @@ void Fl_Double_Window::resize(int X,int Y,int W,int H) {
int oh = h();
Fl_Window::resize(X,Y,W,H);
Fl_X *myi = Fl_X::i(this);
if (myi && Fl_Window_Driver::driver(this)->other_xid && (ow < w() || oh < h() || Fl_Window_Driver::is_a_rescale()))
if (myi && Fl_Window_Driver::driver(this)->other_xid && (ow < w() || oh < h() || is_a_rescale()))
Fl_Window_Driver::driver(this)->destroy_double_buffer();
}

View File

@ -261,7 +261,7 @@ void Fl_Gl_Window::resize(int X,int Y,int W,int H) {
// printf("Fl_Gl_Window::resize(X=%d, Y=%d, W=%d, H=%d)\n", X, Y, W, H);
// printf("current: x()=%d, y()=%d, w()=%d, h()=%d\n", x(), y(), w(), h());
int is_a_resize = (W != Fl_Widget::w() || H != Fl_Widget::h() || Fl_Window_Driver::is_a_rescale());
int is_a_resize = (W != Fl_Widget::w() || H != Fl_Widget::h() || is_a_rescale());
if (is_a_resize) valid(0);
pGlWindowDriver->resize(is_a_resize, W, H);
Fl_Window::resize(X,Y,W,H);

View File

@ -708,7 +708,7 @@ void Fl_Group::resize(int X, int Y, int W, int H) {
Fl_Widget::resize(X, Y, W, H); // make new xywh values visible for children
if ((!resizable() || (dw==0 && dh==0 )) && !Fl_Window_Driver::is_a_rescale()) {
if ((!resizable() || (dw==0 && dh==0 )) && !Fl_Window::is_a_rescale()) {
if (!as_window()) {
Fl_Widget*const* a = array();

View File

@ -689,6 +689,9 @@ void Fl_Window::shape(const Fl_Image& img) {pWindowDriver->shape(&img);}
/** Returns the image controlling the window shape or NULL */
const Fl_Image* Fl_Window::shape() {return pWindowDriver->shape();}
/** Returns true when a window is being rescaled */
bool Fl_Window::is_a_rescale() {return Fl_Window_Driver::is_a_rescale_;}
//
// End of "$Id$".
//

View File

@ -69,7 +69,6 @@ public:
Fl_Offscreen other_xid; // offscreen bitmap (overlay and double-buffered windows)
virtual int screen_num();
virtual void screen_num(int) {}
static bool is_a_rescale() {return is_a_rescale_;};
// --- frequently used accessors to public window data

View File

@ -3296,7 +3296,7 @@ void Fl_Cocoa_Window_Driver::resize(int X, int Y, int W, int H) {
} else {
NSPoint pt = FLTKtoCocoa(pWindow, X, Y, H);
FLWindow *xid = fl_xid(pWindow);
if (W != w() || H != h() || is_a_rescale()) {
if (W != w() || H != h() || Fl_Window::is_a_rescale()) {
NSRect r;
float s = Fl::screen_driver()->scale(screen_num());
int bt = get_window_frame_sizes(pWindow);

View File

@ -1834,11 +1834,11 @@ int Fl_WinAPI_Window_Driver::fake_X_wm(int &X, int &Y, int &bt, int &bx, int &by
void Fl_WinAPI_Window_Driver::resize(int X, int Y, int W, int H) {
//fprintf(stderr, "resize w()=%d W=%d h()=%d H=%d\n",pWindow->w(), W,pWindow->h(), H);
UINT flags = SWP_NOSENDCHANGING | SWP_NOZORDER | SWP_NOACTIVATE | SWP_NOOWNERZORDER;
int is_a_resize = (W != w() || H != h() || is_a_rescale());
int is_a_resize = (W != w() || H != h() || Fl_Window::is_a_rescale());
int resize_from_program = (pWindow != resize_bug_fix);
if (!resize_from_program)
resize_bug_fix = 0;
if (X != x() || Y != y() || is_a_rescale()) {
if (X != x() || Y != y() || Fl_Window::is_a_rescale()) {
force_position(1);
} else {
if (!is_a_resize)

View File

@ -2252,8 +2252,8 @@ int fl_handle(const XEvent& thisevent)
////////////////////////////////////////////////////////////////
void Fl_X11_Window_Driver::resize(int X,int Y,int W,int H) {
int is_a_move = (X != x() || Y != y() || is_a_rescale());
int is_a_resize = (W != w() || H != h() || is_a_rescale());
int is_a_move = (X != x() || Y != y() || Fl_Window::is_a_rescale());
int is_a_resize = (W != w() || H != h() || Fl_Window::is_a_rescale());
int resize_from_program = (pWindow != resize_bug_fix);
if (!resize_from_program) resize_bug_fix = 0;
if (is_a_move && resize_from_program) force_position(1);

View File

@ -124,8 +124,8 @@ void Fl_Android_Window_Driver::make_current()
void Fl_Android_Window_Driver::resize(int X,int Y,int W,int H)
{
int is_a_resize = (W != w() || H != h() || is_a_rescale());
if (X != x() || Y != y() || is_a_rescale()) {
int is_a_resize = (W != w() || H != h() || Fl_Window::is_a_rescale());
if (X != x() || Y != y() || Fl_Window::is_a_rescale()) {
force_position(1);
} else {
if (!is_a_resize)