Mercurial > MadButterfly
comparison src/X_supp.c @ 354:92e8f9965f9a
merge
author | wycc |
---|---|
date | Mon, 09 Mar 2009 01:30:19 +0800 |
parents | 892f4efe2e48 |
children | 16116d84bc5e |
comparison
equal
deleted
inserted
replaced
353:3d03451be435 | 354:92e8f9965f9a |
---|---|
175 /*! \brief Dispatch all X events in the queue. | 175 /*! \brief Dispatch all X events in the queue. |
176 */ | 176 */ |
177 static void handle_x_event(X_MB_runtime_t *rt) { | 177 static void handle_x_event(X_MB_runtime_t *rt) { |
178 Display *display = rt->display; | 178 Display *display = rt->display; |
179 redraw_man_t *rdman = rt->rdman; | 179 redraw_man_t *rdman = rt->rdman; |
180 XEvent evt; | 180 XEvent evt, peek_evt; |
181 XMotionEvent *mevt; | 181 XMotionEvent *mevt; |
182 XButtonEvent *bevt; | 182 XButtonEvent *bevt; |
183 XExposeEvent *eevt; | 183 XExposeEvent *eevt; |
184 XKeyEvent *xkey; | 184 XKeyEvent *xkey; |
185 co_aix x, y, w, h; | 185 co_aix x, y, w, h; |
229 x, y, EVT_MOUSE_BUT_RELEASE, | 229 x, y, EVT_MOUSE_BUT_RELEASE, |
230 state, button); | 230 state, button); |
231 break; | 231 break; |
232 | 232 |
233 case MotionNotify: | 233 case MotionNotify: |
234 while(XEventsQueued(display, QueuedAfterReading) > 0) { | |
235 r = XPeekEvent(display, &peek_evt); | |
236 if(r == -1) | |
237 break; | |
238 if(peek_evt.type != MotionNotify) | |
239 break; | |
240 XNextEvent(display, &evt); | |
241 } | |
242 if(r == -1) | |
243 break; | |
244 | |
234 mevt = (XMotionEvent *)&evt; | 245 mevt = (XMotionEvent *)&evt; |
235 x = mevt->x; | 246 x = mevt->x; |
236 y = mevt->y; | 247 y = mevt->y; |
237 state = get_button_state(mevt->state); | 248 state = get_button_state(mevt->state); |
238 | 249 |
452 xmb_rt->rdman->w = w; | 463 xmb_rt->rdman->w = w; |
453 xmb_rt->rdman->h = h; | 464 xmb_rt->rdman->h = h; |
454 | 465 |
455 xmb_rt->tman = mb_tman_new(); | 466 xmb_rt->tman = mb_tman_new(); |
456 | 467 |
457 img_ldr = simple_mb_img_ldr_new("./"); | 468 img_ldr = simple_mb_img_ldr_new(""); |
458 xmb_rt->img_ldr = img_ldr; | 469 xmb_rt->img_ldr = img_ldr; |
459 rdman_set_img_ldr(xmb_rt->rdman, img_ldr); | 470 rdman_set_img_ldr(xmb_rt->rdman, img_ldr); |
460 | 471 |
461 #ifndef ONLY_MOUSE_MOVE_RAW | 472 #ifndef ONLY_MOUSE_MOVE_RAW |
462 xmb_rt->last = NULL; | 473 xmb_rt->last = NULL; |