Unified · Split
| @@ -514,13 +514,13 @@ drawfreedimage(Draw *d, DImage *dimage) · 513 unmodified lines | ||
| 514 | 514 | l = dimage->image; |
| 515 | 515 | dimage->dscreen = nil; /* paranoia */ |
| 516 | 516 | dimage->image = nil; |
| 517 | − if(ds){ | |
| 518 | − /* | |
| 519 | − * l->layer will be nil if we get any | |
| 520 | − * ConfigEvent before having a screen | |
| 521 | − */ | |
| 522 | − if(!l->layer) | |
| 523 | − return; | |
| 517 | + /* | |
| 518 | + * TODO: | |
| 519 | + * l->layer will be nil if we get any | |
| 520 | + * ConfigEvent before having a screen. | |
| 521 | + * Why else? | |
| 522 | + */ | |
| 523 | + if(ds && l->layer){ | |
| 524 | 524 | screenimage = d->window->screenimage; |
| 525 | 525 | if(l->data == screenimage->data) |
| 526 | 526 | addflush(d, l->layer->screenr); |
| @@ -1838,7 +1838,6 @@ drawreplacescreenimage(Window *w) · 1311 unmodified lines | ||
| 1838 | 1838 | if(d->screendimage == nil) |
| 1839 | 1839 | return; |
| 1840 | 1840 | |
| 1841 | − xreplacescreenimage(w); | |
| 1842 | 1841 | if(w->screenimage == nil) |
| 1843 | 1842 | return; |
| 1844 | 1843 | /* |
| @@ -1863,7 +1862,7 @@ drawreplacescreenimage(Window *w) · 18 unmodified lines | ||
| 1863 | 1862 | } |
| 1864 | 1863 | } |
| 1865 | 1864 | |
| 1866 | − drawfreedimage(d, d->screendimage); // XXX | |
| 1865 | + drawfreedimage(d, d->screendimage); | |
| 1867 | 1866 | d->screendimage = di; |
| 1868 | 1867 | |
| 1869 | 1868 | /* |
| @@ -104,14 +104,12 @@ xfreememimage(Memimage *m) · 103 unmodified lines | ||
| 104 | 104 | { |
| 105 | 105 | Xmem *xm; |
| 106 | 106 | |
| 107 | − // print("XXX xfreememimage (%p)\n", m); | |
| 108 | − // XXX TODO: why m->data == nil ? | |
| 109 | − if(!m || !m->data) | |
| 107 | + if(m == nil) | |
| 110 | 108 | return; |
| 111 | 109 | |
| 112 | 110 | xm = m->X; |
| 113 | − if(xm && m->data->ref == 1){ | |
| 114 | − if(xm->xi){ | |
| 111 | + if(xm != nil){ | |
| 112 | + if(xm->xi != nil){ | |
| 115 | 113 | xm->xi->data = nil; |
| 116 | 114 | XFree(xm->xi); |
| 117 | 115 | } |
| @@ -119,6 +117,5 @@ xfreememimage(Memimage *m) · 1 unmodified line | ||
| 119 | 117 | free(xm); |
| 120 | 118 | m->X = nil; |
| 121 | 119 | } |
| 122 | −// print("XXX free %d with layer %d\n", m, m->layer); | |
| 123 | 120 | _freememimage(m); |
| 124 | 121 | } |
| @@ -123,7 +123,7 @@ configevent(Window *w, XEvent xev) · 122 unmodified lines | ||
| 123 | 123 | |
| 124 | 124 | m.xy.x = Dx(r); |
| 125 | 125 | m.xy.y = Dy(r); |
| 126 | − drawreplacescreenimage(w); | |
| 126 | + xreplacescreenimage(w); | |
| 127 | 127 | debugev("Configure event at window %d: w=%d h=%d\n", w->id, m.xy.x, m.xy.y); |
| 128 | 128 | w->resized = 1; |
| 129 | 129 | writemouse(w, m, 1); |
| @@ -98,6 +98,8 @@ xreplacescreenimage(Window *w) · 97 unmodified lines | ||
| 98 | 98 | xw->nextscreenpm = pixmap; |
| 99 | 99 | w->screenimage = m; |
| 100 | 100 | w->screenr = r; |
| 101 | + drawreplacescreenimage(w); | |
| 102 | + xw->screenpm = xw->nextscreenpm; | |
| 101 | 103 | } |
| 102 | 104 | |
| 103 | 105 | int |
Binary file not shown.