This is a bug in the upstream 9front code, a fix is in the works but best not to diverge.
Unified · Split
| @@ -940,7 +940,7 @@ makescreenimage(void) · 939 unmodified lines | |||
| 940 | return di; | 940 | return di; |
| 941 | } | 941 | } |
| 942 | 942 | ||
| 943 | int | 943 | static int |
| 944 | initscreenimage(void) | 944 | initscreenimage(void) |
| 945 | { | 945 | { |
| 946 | if(screenimage != nil) | 946 | if(screenimage != nil) |
| @@ -956,8 +956,9 @@ initscreenimage(void) · 9 unmodified lines | |||
| 956 | } | 956 | } |
| 957 | 957 | ||
| 958 | void | 958 | void |
| 959 | _deletescreenimage(void) | 959 | deletescreenimage(void) |
| 960 | { | 960 | { |
| 961 | dlock(); | ||
| 961 | if(screenimage){ | 962 | if(screenimage){ |
| 962 | /* will be freed via screendimage; disable */ | 963 | /* will be freed via screendimage; disable */ |
| 963 | screenimage->clipr = ZR; | 964 | screenimage->clipr = ZR; |
| @@ -967,13 +968,6 @@ _deletescreenimage(void) · 3 unmodified lines | |||
| 967 | drawfreedimage(screendimage); | 968 | drawfreedimage(screendimage); |
| 968 | screendimage = nil; | 969 | screendimage = nil; |
| 969 | } | 970 | } |
| 970 | } | ||
| 971 | |||
| 972 | void | ||
| 973 | deletescreenimage(void) | ||
| 974 | { | ||
| 975 | dlock(); | ||
| 976 | _deletescreenimage(); | ||
| 977 | dunlock(); | 971 | dunlock(); |
| 978 | } | 972 | } |
| 979 | 973 | ||
| @@ -1002,6 +996,8 @@ drawattach(char *spec) · 22 unmodified lines | |||
| 1002 | static Walkqid* | 996 | static Walkqid* |
| 1003 | drawwalk(Chan *c, Chan *nc, char **name, int nname) | 997 | drawwalk(Chan *c, Chan *nc, char **name, int nname) |
| 1004 | { | 998 | { |
| 999 | if(screenimage == nil) | ||
| 1000 | error("no frame buffer"); | ||
| 1005 | return devwalk(c, nc, name, nname, 0, 0, drawgen); | 1001 | return devwalk(c, nc, name, nname, 0, 0, drawgen); |
| 1006 | } | 1002 | } |
| 1007 | 1003 | ||
| @@ -9,8 +9,6 @@ · 8 unmodified lines | |||
| 9 | #include "screen.h" | 9 | #include "screen.h" |
| 10 | 10 | ||
| 11 | extern Memimage *gscreen; | 11 | extern Memimage *gscreen; |
| 12 | int initscreenimage(void); | ||
| 13 | void _deletescreenimage(void); | ||
| 14 | 12 | ||
| 15 | static Memsubfont *memdefont; | 13 | static Memsubfont *memdefont; |
| 16 | static Lock screenlock; | 14 | static Lock screenlock; |
| @@ -114,27 +112,22 @@ resizeproc(void *arg) · 97 unmodified lines | |||
| 114 | continue; | 112 | continue; |
| 115 | } | 113 | } |
| 116 | gscreen->clipr = resize.r; | 114 | gscreen->clipr = resize.r; |
| 117 | _deletescreenimage(); | ||
| 118 | initscreenimage(); | ||
| 119 | qunlock(&drawlock); | 115 | qunlock(&drawlock); |
| 120 | 116 | ||
| 121 | screenwin(); | 117 | screenwin(); |
| 118 | deletescreenimage(); | ||
| 119 | resetscreenimage(); | ||
| 120 | osmsleep(1000); | ||
| 122 | } | 121 | } |
| 123 | } | 122 | } |
| 124 | 123 | ||
| 125 | void | 124 | void |
| 126 | _screenresize(Rectangle r) | 125 | screenresize(Rectangle r) |
| 127 | { | 126 | { |
| 127 | qlock(&drawlock); | ||
| 128 | resize.r = r; | 128 | resize.r = r; |
| 129 | resize.f = 1; | 129 | resize.f = 1; |
| 130 | wakeup(&resize.z); | 130 | wakeup(&resize.z); |
| 131 | } | ||
| 132 | |||
| 133 | void | ||
| 134 | screenresize(Rectangle r) | ||
| 135 | { | ||
| 136 | qlock(&drawlock); | ||
| 137 | _screenresize(r); | ||
| 138 | qunlock(&drawlock); | 131 | qunlock(&drawlock); |
| 139 | } | 132 | } |
| 140 | 133 | ||