mirror of
https://github.com/9fans/plan9port.git
synced 2025-01-12 11:10:07 +00:00
be more faithful to plan 9 environment --
allocate window on top of screen.
This commit is contained in:
parent
168518a993
commit
670dd11a8a
3 changed files with 18 additions and 5 deletions
|
@ -149,6 +149,7 @@ _initdisplaymemimage(Display *d, Memimage *m)
|
|||
client0->op = SoverD;
|
||||
sdraw.client[0] = client0;
|
||||
sdraw.nclient = 1;
|
||||
sdraw.softscreen = 1;
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
@ -35,8 +35,7 @@ initdraw(void (*error)(Display*, char*), char *fontname, char *label)
|
|||
return -1;
|
||||
|
||||
lockdisplay(display);
|
||||
display->image = display->screenimage;
|
||||
screen = display->screenimage;
|
||||
display->screenimage = display->image;
|
||||
|
||||
/*
|
||||
* Set up default font
|
||||
|
@ -83,6 +82,13 @@ initdraw(void (*error)(Display*, char*), char *fontname, char *label)
|
|||
}
|
||||
display->opaque = display->white;
|
||||
display->transparent = display->black;
|
||||
|
||||
_screen = allocscreen(display->image, display->white, 0);
|
||||
screen = _allocwindow(nil, _screen, display->image->r, Refnone, DWhite);
|
||||
display->screenimage = screen;
|
||||
draw(screen, screen->r, display->black, nil, ZP);
|
||||
flushimage(display, 1);
|
||||
|
||||
atexit(drawshutdown);
|
||||
return 1;
|
||||
}
|
||||
|
|
|
@ -70,7 +70,8 @@ _initdisplay(void (*error)(Display*, char*), char *label)
|
|||
|
||||
d->error = error;
|
||||
_initdisplaymemimage(d, m);
|
||||
d->screenimage = getimage0(d, 0);
|
||||
d->image = getimage0(d, 0);
|
||||
|
||||
return d;
|
||||
}
|
||||
|
||||
|
@ -146,10 +147,15 @@ getwindow(Display *d, int ref)
|
|||
* so we have to reuse the image structure
|
||||
* memory we already have.
|
||||
*/
|
||||
oi = d->screenimage;
|
||||
oi = d->image;
|
||||
i = getimage0(d, oi);
|
||||
screen = d->screenimage = d->image = i;
|
||||
d->image = i;
|
||||
// fprint(2, "getwindow %p -> %p\n", oi, i);
|
||||
|
||||
_screen = allocscreen(i, d->white, 0);
|
||||
_freeimage1(screen);
|
||||
screen = _allocwindow(screen, _screen, i->r, ref, DWhite);
|
||||
d->screenimage = screen;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue