diff options
Diffstat (limited to 'uisimulator/x11/lcd-x11.c')
-rw-r--r-- | uisimulator/x11/lcd-x11.c | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/uisimulator/x11/lcd-x11.c b/uisimulator/x11/lcd-x11.c index be687d1181..dada13d42d 100644 --- a/uisimulator/x11/lcd-x11.c +++ b/uisimulator/x11/lcd-x11.c | |||
@@ -42,7 +42,6 @@ | |||
42 | 42 | ||
43 | extern unsigned char lcd_framebuffer[LCD_HEIGHT/8][LCD_WIDTH]; | 43 | extern unsigned char lcd_framebuffer[LCD_HEIGHT/8][LCD_WIDTH]; |
44 | extern void screen_resized(int width, int height); | 44 | extern void screen_resized(int width, int height); |
45 | extern Display *dpy; | ||
46 | 45 | ||
47 | #ifdef HAVE_LCD_BITMAP | 46 | #ifdef HAVE_LCD_BITMAP |
48 | unsigned char lcd_framebuffer_copy[LCD_HEIGHT/8][LCD_WIDTH]; | 47 | unsigned char lcd_framebuffer_copy[LCD_HEIGHT/8][LCD_WIDTH]; |
@@ -91,9 +90,11 @@ void lcd_update (void) | |||
91 | 90 | ||
92 | drawdots(0, &clearpoints[0], cp); | 91 | drawdots(0, &clearpoints[0], cp); |
93 | drawdots(1, &points[0], p); | 92 | drawdots(1, &points[0], p); |
94 | /* printf("lcd_update: Draws %d pixels, clears %d pixels (max %d/%d)\n", | 93 | /* printf("lcd_update: Draws %d pixels, clears %d pixels (max %d/%d)\n", |
95 | p, cp, p+cp, LCD_HEIGHT*LCD_WIDTH); */ | 94 | p, cp, p+cp, LCD_HEIGHT*LCD_WIDTH); */ |
95 | XtAppLock(app); | ||
96 | XSync(dpy,False); | 96 | XSync(dpy,False); |
97 | XtAppUnlock(app); | ||
97 | } | 98 | } |
98 | 99 | ||
99 | void lcd_update_rect(int x_start, int y_start, | 100 | void lcd_update_rect(int x_start, int y_start, |
@@ -117,7 +118,7 @@ void lcd_update_rect(int x_start, int y_start, | |||
117 | /* The Y coordinates have to work on even 8 pixel rows */ | 118 | /* The Y coordinates have to work on even 8 pixel rows */ |
118 | ymax = (yline + height)/8; | 119 | ymax = (yline + height)/8; |
119 | yline /= 8; | 120 | yline /= 8; |
120 | 121 | ||
121 | xmax = x_start + width; | 122 | xmax = x_start + width; |
122 | 123 | ||
123 | if(xmax > LCD_WIDTH) | 124 | if(xmax > LCD_WIDTH) |
@@ -156,8 +157,10 @@ void lcd_update_rect(int x_start, int y_start, | |||
156 | 157 | ||
157 | drawdots(0, &clearpoints[0], cp); | 158 | drawdots(0, &clearpoints[0], cp); |
158 | drawdots(1, &points[0], p); | 159 | drawdots(1, &points[0], p); |
159 | /* printf("lcd_update_rect: Draws %d pixels, clears %d pixels\n", p, cp);*/ | 160 | /* printf("lcd_update_rect: Draws %d pixels, clears %d pixels\n", p, cp);*/ |
161 | XtAppLock(app); | ||
160 | XSync(dpy,False); | 162 | XSync(dpy,False); |
163 | XtAppUnlock(app); | ||
161 | } | 164 | } |
162 | #endif | 165 | #endif |
163 | #ifdef HAVE_LCD_CHARCELLS | 166 | #ifdef HAVE_LCD_CHARCELLS |
@@ -186,7 +189,11 @@ void lcd_update (void) | |||
186 | } | 189 | } |
187 | } | 190 | } |
188 | if (changed) | 191 | if (changed) |
192 | { | ||
193 | XtAppLock(app); | ||
189 | XSync(dpy,False); | 194 | XSync(dpy,False); |
195 | XtAppUnlock(app); | ||
196 | } | ||
190 | lcd_display_redraw=false; | 197 | lcd_display_redraw=false; |
191 | } | 198 | } |
192 | 199 | ||