devdraw: fix OS X resize bug caused by redraw bug fix
R=rsc http://codereview.appspot.com/189104
This commit is contained in:
parent
7d419a1421
commit
a61c69337c
1 changed files with 9 additions and 7 deletions
|
|
@ -279,7 +279,6 @@ enum
|
||||||
void screeninit(void);
|
void screeninit(void);
|
||||||
void _flushmemscreen(Rectangle r);
|
void _flushmemscreen(Rectangle r);
|
||||||
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
InitMultiTouch(void)
|
InitMultiTouch(void)
|
||||||
{
|
{
|
||||||
|
|
@ -522,11 +521,14 @@ eventhandler(EventHandlerCallRef next, EventRef event, void *arg)
|
||||||
eresized(1);
|
eresized(1);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case kEventWindowDrawContent:;
|
case kEventWindowDrawContent:
|
||||||
// The update says what rectangle needs drawing,
|
// Tried using just flushmemimage here, but
|
||||||
// but just draw everything.
|
// it causes an odd artifact in which making a window
|
||||||
Rectangle r = Rect(0, 0, Dx(osx.screenr), Dy(osx.screenr));
|
// bigger in both width and height can then only draw
|
||||||
_flushmemscreen(r);
|
// on the new border: it's like the old window is stuck
|
||||||
|
// floating on top. Doing a full "get a new window"
|
||||||
|
// seems to solve the problem.
|
||||||
|
eresized(1);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case kEventWindowActivated:
|
case kEventWindowActivated:
|
||||||
|
|
@ -793,7 +795,7 @@ eresized(int new)
|
||||||
|
|
||||||
GetWindowBounds(osx.window, kWindowContentRgn, &or);
|
GetWindowBounds(osx.window, kWindowContentRgn, &or);
|
||||||
r = Rect(or.left, or.top, or.right, or.bottom);
|
r = Rect(or.left, or.top, or.right, or.bottom);
|
||||||
if(Dx(r) == Dx(osx.screenr) && Dy(r) == Dy(osx.screenr)){
|
if(Dx(r) == Dx(osx.screenr) && Dy(r) == Dy(osx.screenr) && !new){
|
||||||
// No need to make new image.
|
// No need to make new image.
|
||||||
osx.screenr = r;
|
osx.screenr = r;
|
||||||
return;
|
return;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue