Changeset 3695
- Timestamp:
- Apr 11, 2005, 4:09:30 PM (21 years ago)
- Location:
- trunk/Ohana/src
- Files:
-
- 4 edited
-
kapa/event/EventLoop.c (modified) (3 diffs)
-
kapa/include/constants.h (modified) (2 diffs)
-
kii/event/EventLoop.c (modified) (2 diffs)
-
kii/include/constants.h (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Ohana/src/kapa/event/EventLoop.c
r3465 r3695 1 1 # include "Ximage.h" 2 3 # define IgnoreMask (long) (ButtonPressMask | ClientMessage | ButtonReleaseMask | KeyPressMask | PointerMotionMask) 2 4 3 5 int LastEvent (Display *display, int type, XEvent *event) { … … 26 28 27 29 if (XEventsQueued (graphic.display, QueuedAfterFlush) < 1) { 28 usleep ( 10000);30 usleep (50000); 29 31 continue; 30 32 } … … 32 34 display = graphic.display; 33 35 34 /* only do the last entry for these events */ 35 /* this ignores the return status from these functions */ 36 /* grab the last entry for these events */ 36 37 if (LastEvent (display, ConfigureNotify, &event)) Reconfig (&event); 38 if (LastEvent (display, CirculateNotify, &event)) Reconfig (&event); 37 39 if (LastEvent (display, Expose, &event)) Refresh (1); 40 38 41 if (LastEvent (display, MappingNotify, &event)) XRefreshKeyboardMapping ((XMappingEvent *) &event); 42 43 /* drop and ignore the following StructureNotifyMask events */ 44 LastEvent (display, GravityNotify, &event); 45 LastEvent (display, ReparentNotify, &event); 46 LastEvent (display, MapNotify, &event); 47 LastEvent (display, UnmapNotify, &event); 48 49 /* remove those events we will ignore */ 50 while (XCheckMaskEvent (display, IgnoreMask, &event)) continue; 51 39 52 } 40 53 return (status); -
trunk/Ohana/src/kapa/include/constants.h
r2473 r3695 1 1 /* hardwired values for some window parameters */ 2 # define EVENT_MASK (long) (ButtonPressMask | ClientMessage | ButtonReleaseMask | KeyPressMask | ExposureMask | StructureNotifyMask | PointerMotionMask) 2 3 # define EVENT_MASK (long) \ 4 (ButtonPressMask \ 5 | ClientMessage \ 6 | ButtonReleaseMask \ 7 | KeyPressMask \ 8 | ExposureMask \ 9 | StructureNotifyMask \ 10 | PointerMotionMask) 11 3 12 # define DEFAULT_CURSOR XC_crosshair 4 13 # define BORDER_WIDTH 2 … … 18 27 enum {SCALE, NOSCALE, RAW}; 19 28 29 /* EVENT_MASK consists of: 30 31 ExposureMask : Expose 32 StructureNotifyMask : CirculateNotify | 33 ConfigureNotify | 34 DestroyNotify | 35 GravityNotify | 36 MapNotify | 37 ReparentNotify | 38 UnmapNotify 39 ButtonPressMask : ButtonPress 40 ButtonReleaseMask : ButtonRelease 41 KeyPressMask : KeyPress 42 PointerMotionMask : MotionNotify 43 (always) : ClientMessage 44 (always) : MappingNotify 45 46 */ -
trunk/Ohana/src/kii/event/EventLoop.c
r2892 r3695 1 1 # include "Ximage.h" 2 3 # define IgnoreMask (long) (ClientMessage | ButtonReleaseMask) 2 4 3 5 int LastEvent (Display *display, int type, XEvent *event) { … … 33 35 display = graphic[0].display; 34 36 35 /* only do the last entry for these events */ 36 /* this ignores the return status from these functions */ 37 /* grab the last entry for these events */ 37 38 if (LastEvent (display, ConfigureNotify, &event)) Reconfig (graphic, layout, &event); 39 if (LastEvent (display, CirculateNotify, &event)) Reconfig (graphic, layout, &event); 38 40 if (LastEvent (display, Expose, &event)) Refresh (graphic, layout, 1); 39 if (LastEvent (display, MappingNotify, &event)) XRefreshKeyboardMapping ((XMappingEvent *) &event);40 41 if (LastEvent (display, MotionNotify, &event)) UpdatePointer (graphic, layout, (XMotionEvent *) &event); 41 42 if (LastEvent (display, ButtonPress, &event)) InterpretPresses (graphic, layout, (XButtonEvent *) &event); 42 43 if (LastEvent (display, KeyPress, &event)) InterpretKeys (graphic, layout, &event); 44 45 if (LastEvent (display, MappingNotify, &event)) XRefreshKeyboardMapping ((XMappingEvent *) &event); 46 47 /* drop and ignore the following StructureNotifyMask events */ 48 LastEvent (display, GravityNotify, &event); 49 LastEvent (display, ReparentNotify, &event); 50 LastEvent (display, MapNotify, &event); 51 LastEvent (display, UnmapNotify, &event); 52 53 /* remove those events we will ignore */ 54 while (XCheckMaskEvent (display, IgnoreMask, &event)) continue; 43 55 } 44 56 return (status); -
trunk/Ohana/src/kii/include/constants.h
r2466 r3695 14 14 */ 15 15 16 # define EVENT_MASK (long) (ButtonPressMask | ClientMessage | ButtonReleaseMask | KeyPressMask | ExposureMask | StructureNotifyMask | PointerMotionMask)17 16 # define DEFAULT_CURSOR XC_crosshair 18 17 # define BORDER_WIDTH 2 … … 26 25 int DECIMAL_DEG; 27 26 int DEBUG; 27 28 # define EVENT_MASK (long) \ 29 (ButtonPressMask \ 30 | ClientMessage \ 31 | ButtonReleaseMask \ 32 | KeyPressMask \ 33 | ExposureMask \ 34 | StructureNotifyMask \ 35 | PointerMotionMask) 36 37 /* EVENT_MASK consists of: 38 39 ExposureMask : Expose 40 StructureNotifyMask : CirculateNotify | 41 ConfigureNotify | 42 DestroyNotify | 43 GravityNotify | 44 MapNotify | 45 ReparentNotify | 46 UnmapNotify 47 ButtonPressMask : ButtonPress 48 ButtonReleaseMask : ButtonRelease 49 KeyPressMask : KeyPress 50 PointerMotionMask : MotionNotify 51 (always) : ClientMessage 52 (always) : MappingNotify 53 54 */
Note:
See TracChangeset
for help on using the changeset viewer.
