mirror of https://github.com/fltk/fltk
Rename Fl_Window_Driver::in_resize_after_scale_change to 'is_a_rescale' which is more expressive.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12358 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
This commit is contained in:
parent
813bc06b19
commit
3f572e327f
|
@ -53,7 +53,7 @@ protected:
|
|||
struct shape_data_type;
|
||||
shape_data_type *shape_data_; ///< non-null means the window has a non-rectangular shape
|
||||
void flush_Fl_Window(); // accessor to protected Fl_Window::flush()
|
||||
static bool in_resize_after_scale_change;
|
||||
static bool is_a_rescale; // true when the window is rescaling
|
||||
public:
|
||||
Fl_Window_Driver(Fl_Window *);
|
||||
virtual ~Fl_Window_Driver();
|
||||
|
|
|
@ -55,7 +55,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 && driver()->other_xid && (ow < w() || oh < h() || Fl_Window_Driver::in_resize_after_scale_change))
|
||||
if (myi && driver()->other_xid && (ow < w() || oh < h() || Fl_Window_Driver::is_a_rescale))
|
||||
driver()->destroy_double_buffer();
|
||||
}
|
||||
|
||||
|
|
|
@ -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::in_resize_after_scale_change);
|
||||
int is_a_resize = (W != Fl_Widget::w() || H != Fl_Widget::h() || Fl_Window_Driver::is_a_rescale);
|
||||
if (is_a_resize) valid(0);
|
||||
pGlWindowDriver->resize(is_a_resize, W, H);
|
||||
Fl_Window::resize(X,Y,W,H);
|
||||
|
|
|
@ -700,7 +700,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::in_resize_after_scale_change) {
|
||||
if ((!resizable() || (dw==0 && dh==0 )) && !Fl_Window_Driver::is_a_rescale) {
|
||||
|
||||
if (!as_window()) {
|
||||
Fl_Widget*const* a = array();
|
||||
|
|
|
@ -257,7 +257,7 @@ int Fl_Window_Driver::screen_num() {
|
|||
return Fl::screen_num(x(), y(), w(), h());
|
||||
}
|
||||
|
||||
bool Fl_Window_Driver::in_resize_after_scale_change = false;
|
||||
bool Fl_Window_Driver::is_a_rescale = false;
|
||||
|
||||
void Fl_Window_Driver::resize_after_scale_change(int ns, float old_f, float new_f) {
|
||||
screen_num(ns);
|
||||
|
@ -268,10 +268,10 @@ void Fl_Window_Driver::resize_after_scale_change(int ns, float old_f, float new_
|
|||
} else {
|
||||
W = pWindow->w(); H = pWindow->h();
|
||||
}
|
||||
in_resize_after_scale_change = true;
|
||||
is_a_rescale = true;
|
||||
pWindow->resize(pWindow->x()*old_f/new_f, pWindow->y()*old_f/new_f, W, H);
|
||||
size_range();
|
||||
in_resize_after_scale_change = false;
|
||||
is_a_rescale = false;
|
||||
}
|
||||
|
||||
//
|
||||
|
|
|
@ -1683,10 +1683,10 @@ 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) {
|
||||
UINT flags = SWP_NOSENDCHANGING | SWP_NOZORDER
|
||||
| SWP_NOACTIVATE | SWP_NOOWNERZORDER;
|
||||
int is_a_resize = (W != w() || H != h() || in_resize_after_scale_change);
|
||||
int is_a_resize = (W != w() || H != h() || is_a_rescale);
|
||||
int resize_from_program = (pWindow != resize_bug_fix);
|
||||
if (!resize_from_program) resize_bug_fix = 0;
|
||||
if (X != x() || Y != y() || in_resize_after_scale_change) {
|
||||
if (X != x() || Y != y() || is_a_rescale) {
|
||||
force_position(1);
|
||||
} else {
|
||||
if (!is_a_resize) return;
|
||||
|
|
|
@ -2106,8 +2106,8 @@ fprintf(stderr,"\n");*/
|
|||
////////////////////////////////////////////////////////////////
|
||||
|
||||
void Fl_X11_Window_Driver::resize(int X,int Y,int W,int H) {
|
||||
int is_a_move = (X != x() || Y != y() || in_resize_after_scale_change);
|
||||
int is_a_resize = (W != w() || H != h() || in_resize_after_scale_change);
|
||||
int is_a_move = (X != x() || Y != y() || is_a_rescale);
|
||||
int is_a_resize = (W != w() || H != h() || 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);
|
||||
|
|
|
@ -367,6 +367,16 @@ void Fl_X11_Screen_Driver::init() {
|
|||
}
|
||||
}
|
||||
}
|
||||
#if __APPLE_CC__ && USE_XFT // TMP simulate 2 screens under XQuartz
|
||||
if (strstr(getenv("DISPLAY"), "xquartz")) {
|
||||
num_screens = 2;
|
||||
screens[1].x_org = screens[0].width/2;;
|
||||
screens[1].y_org = screens[0].y_org;
|
||||
screens[1].width = screens[0].width = screens[0].width/2;
|
||||
screens[1].height = screens[0].height;
|
||||
screens[1].scale = screens[0].scale = 1;
|
||||
}
|
||||
#endif
|
||||
init_workarea();
|
||||
}
|
||||
|
||||
|
|
|
@ -704,10 +704,10 @@ void Fl_X11_Window_Driver::resize_after_screen_change(void *data) {
|
|||
float f = Fl::screen_driver()->scale(data_for_resize_window_between_screens_.screen);
|
||||
Fl_X11_Window_Driver::driver(win)->screen_num(data_for_resize_window_between_screens_.screen);
|
||||
Fl_Display_Device::display_device()->driver()->scale(f);
|
||||
in_resize_after_scale_change = true;
|
||||
is_a_rescale = true;
|
||||
win->driver()->size_range();
|
||||
win->resize(oldx/f, oldy/f, win->w(), win->h());
|
||||
in_resize_after_scale_change = false;
|
||||
is_a_rescale = false;
|
||||
data_for_resize_window_between_screens_.busy = false;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue