comparison src/X_supp.c @ 1026:407932b8a160 refine_backend_if

Redraw changed after handling timeout for X_supp.c
author Thinker K.F. Li <thinker@codemud.net>
date Mon, 22 Nov 2010 17:02:10 +0800
parents 84006acab6af
children e9a134d75c99
comparison
equal deleted inserted replaced
1025:32425882e351 1026:407932b8a160
174 _x_supp_event_loop(mb_rt_t *rt) { 174 _x_supp_event_loop(mb_rt_t *rt) {
175 struct _X_supp_runtime *xmb_rt = (struct _X_supp_runtime *)rt; 175 struct _X_supp_runtime *xmb_rt = (struct _X_supp_runtime *)rt;
176 struct _X_supp_IO_man *io_man = (struct _X_supp_IO_man *)xmb_rt->io_man; 176 struct _X_supp_IO_man *io_man = (struct _X_supp_IO_man *)xmb_rt->io_man;
177 struct _X_supp_timer_man *timer_man = 177 struct _X_supp_timer_man *timer_man =
178 (struct _X_supp_timer_man *)xmb_rt->timer_man; 178 (struct _X_supp_timer_man *)xmb_rt->timer_man;
179 redraw_man_t *rdman;
179 mb_tman_t *tman = tman_timer_man_get_tman(timer_man); 180 mb_tman_t *tman = tman_timer_man_get_tman(timer_man);
180 int fd; 181 int fd;
181 mb_timeval_t now, tmo; 182 mb_timeval_t now, tmo;
182 struct timeval tv; 183 struct timeval tv;
183 fd_set rfds, wfds; 184 fd_set rfds, wfds;
184 int nfds = 0; 185 int nfds = 0;
185 int r, r1,i; 186 int r, r1,i;
186 187
188 rdman = mb_runtime_rdman(rt);
189
187 _x_supp_handle_x_event(rt); 190 _x_supp_handle_x_event(rt);
188 191
189 while(1) { 192 while(1) {
190 FD_ZERO(&rfds); 193 FD_ZERO(&rfds);
191 FD_ZERO(&wfds); 194 FD_ZERO(&wfds);
218 } 221 }
219 222
220 if(r1 == 0) { 223 if(r1 == 0) {
221 get_now(&now); 224 get_now(&now);
222 mb_tman_handle_timeout(tman, &now); 225 mb_tman_handle_timeout(tman, &now);
226 rdman_redraw_changed(rdman);
227 #ifdef XSHM
228 XSHM_update(xmb_rt);
229 #endif
230 XFlush(xmb_rt->display);
223 } else { 231 } else {
224 for(i = 0; i < io_man->n_monitor; i++) { 232 for(i = 0; i < io_man->n_monitor; i++) {
225 if(io_man->monitors[i].type == MB_IO_R || 233 if(io_man->monitors[i].type == MB_IO_R ||
226 io_man->monitors[i].type == MB_IO_RW) { 234 io_man->monitors[i].type == MB_IO_RW) {
227 if(FD_ISSET(io_man->monitors[i].fd, &rfds)) 235 if(FD_ISSET(io_man->monitors[i].fd, &rfds))