diff options
Diffstat (limited to 'src/libdraw')
-rw-r--r-- | src/libdraw/devdraw.c | 1 | ||||
-rw-r--r-- | src/libdraw/init.c | 10 | ||||
-rw-r--r-- | src/libdraw/x11-init.c | 12 |
3 files changed, 18 insertions, 5 deletions
diff --git a/src/libdraw/devdraw.c b/src/libdraw/devdraw.c index 3f7d5063..3fa76854 100644 --- a/src/libdraw/devdraw.c +++ b/src/libdraw/devdraw.c @@ -149,6 +149,7 @@ _initdisplaymemimage(Display *d, Memimage *m) client0->op = SoverD; sdraw.client[0] = client0; sdraw.nclient = 1; + sdraw.softscreen = 1; } void diff --git a/src/libdraw/init.c b/src/libdraw/init.c index f0ee94fb..46815c9e 100644 --- a/src/libdraw/init.c +++ b/src/libdraw/init.c @@ -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; } diff --git a/src/libdraw/x11-init.c b/src/libdraw/x11-init.c index 14c96a66..b2b3ca73 100644 --- a/src/libdraw/x11-init.c +++ b/src/libdraw/x11-init.c @@ -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; } |