Added another redraw patch from Bill Spitzak.
git-svn-id: file:///fltk/svn/fltk/trunk@16 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
This commit is contained in:
parent
9922616d2c
commit
f3fc32d284
@ -423,14 +423,17 @@ static LRESULT CALLBACK WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lPar
|
||||
////////////////////////////////////////////////////////////////
|
||||
|
||||
void Fl_Window::resize(int X,int Y,int W,int H) {
|
||||
int resize_from_program = 1;
|
||||
if (this == resize_bug_fix) {
|
||||
resize_from_program = 0;
|
||||
resize_bug_fix = 0;
|
||||
}
|
||||
if (X==x() && Y==y() && W==w() && H==h()) return;
|
||||
int is_a_resize = (W != w() || H != h());
|
||||
int resize_from_program = (this != resize_bug_fix);
|
||||
if (!resize_from_program) resize_bug_fix = 0;
|
||||
if (X != x() || Y != y()) set_flag(FL_FORCE_POSITION);
|
||||
if (W != w() || H != h()) Fl_Group::resize(X,Y,W,H); else {x(X); y(Y);}
|
||||
else if (!is_a_resize) return;
|
||||
if (is_a_resize) {
|
||||
Fl_Group::resize(X,Y,W,H);
|
||||
if (shown()) {redraw(); i->wait_for_expose = 1;}
|
||||
} else {
|
||||
x(X); y(Y);
|
||||
}
|
||||
if (resize_from_program && shown()) {
|
||||
if (border() && !parent()) {
|
||||
X -= GetSystemMetrics(SM_CXFRAME);
|
||||
@ -439,7 +442,6 @@ void Fl_Window::resize(int X,int Y,int W,int H) {
|
||||
H += 2*GetSystemMetrics(SM_CYFRAME)+GetSystemMetrics(SM_CYCAPTION);
|
||||
}
|
||||
MoveWindow(i->xid, X, Y, W, H, TRUE);
|
||||
//if (!parent()) redraw();
|
||||
}
|
||||
}
|
||||
|
||||
|
26
src/Fl_x.cxx
26
src/Fl_x.cxx
@ -463,23 +463,23 @@ int fl_handle(const XEvent& xevent)
|
||||
////////////////////////////////////////////////////////////////
|
||||
|
||||
void Fl_Window::resize(int X,int Y,int W,int H) {
|
||||
if (resize_bug_fix == this)
|
||||
resize_bug_fix = 0;
|
||||
else if (shown()) {
|
||||
// tell X window manager to change window size:
|
||||
if (!(flags()&FL_FORCE_POSITION) && X == x() && Y == y())
|
||||
XResizeWindow(fl_display, i->xid, W>0 ? W : 1, H>0 ? H : 1);
|
||||
else if (W != w() || H != h())
|
||||
int is_a_resize = (W != w() || H != h());
|
||||
int resize_from_program = (this != resize_bug_fix);
|
||||
if (!resize_from_program) resize_bug_fix = 0;
|
||||
if (X != x() || Y != y()) set_flag(FL_FORCE_POSITION);
|
||||
else if (!is_a_resize) return;
|
||||
if (is_a_resize) {
|
||||
Fl_Group::resize(X,Y,W,H);
|
||||
if (shown()) {redraw(); i->wait_for_expose = 1;}
|
||||
} else {
|
||||
x(X); y(Y);
|
||||
}
|
||||
if (resize_from_program && shown()) {
|
||||
if (is_a_resize)
|
||||
XMoveResizeWindow(fl_display, i->xid, X, Y, W>0 ? W : 1, H>0 ? H : 1);
|
||||
else
|
||||
XMoveWindow(fl_display, i->xid, X, Y);
|
||||
}
|
||||
if (X != x() || Y != y()) set_flag(FL_FORCE_POSITION);
|
||||
if (W != w() || H != h()) Fl_Group::resize(X,Y,W,H); else {x(X); y(Y);}
|
||||
// Notice that this does *not* set any redraw bits. I assumme
|
||||
// I will receive damage for the whole window from X. I think
|
||||
// that "ForgetGravity" forces the expose event for the entire
|
||||
// window, but this may not be true on some implementations.
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////
|
||||
|
Loading…
Reference in New Issue
Block a user