IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 3695


Ignore:
Timestamp:
Apr 11, 2005, 4:09:30 PM (21 years ago)
Author:
eugene
Message:

fix of EventLoop, which was not flushing some events

Location:
trunk/Ohana/src
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Ohana/src/kapa/event/EventLoop.c

    r3465 r3695  
    11# include "Ximage.h"
     2
     3# define IgnoreMask (long) (ButtonPressMask | ClientMessage | ButtonReleaseMask | KeyPressMask | PointerMotionMask)
    24
    35int LastEvent (Display *display, int type, XEvent *event) {
     
    2628   
    2729    if (XEventsQueued (graphic.display, QueuedAfterFlush) < 1) {
    28       usleep (10000);
     30      usleep (50000);
    2931      continue;
    3032    }
     
    3234    display = graphic.display;
    3335
    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 */
    3637    if (LastEvent (display, ConfigureNotify, &event)) Reconfig (&event);
     38    if (LastEvent (display, CirculateNotify, &event)) Reconfig (&event);
    3739    if (LastEvent (display, Expose,          &event)) Refresh (1);
     40
    3841    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     
    3952  }
    4053  return (status);
  • trunk/Ohana/src/kapa/include/constants.h

    r2473 r3695  
    11/* 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
    312# define DEFAULT_CURSOR XC_crosshair
    413# define BORDER_WIDTH 2
     
    1827enum {SCALE, NOSCALE, RAW};
    1928
     29/* EVENT_MASK consists of:
     30
     31ExposureMask        : Expose
     32StructureNotifyMask : CirculateNotify |
     33                      ConfigureNotify |
     34                      DestroyNotify   |
     35                      GravityNotify   |
     36                      MapNotify       |
     37                      ReparentNotify  |
     38                      UnmapNotify
     39ButtonPressMask     : ButtonPress
     40ButtonReleaseMask   : ButtonRelease
     41KeyPressMask        : KeyPress
     42PointerMotionMask   : MotionNotify
     43(always)            : ClientMessage
     44(always)            : MappingNotify
     45
     46*/
  • trunk/Ohana/src/kii/event/EventLoop.c

    r2892 r3695  
    11# include "Ximage.h"
     2
     3# define IgnoreMask (long) (ClientMessage | ButtonReleaseMask)
    24
    35int LastEvent (Display *display, int type, XEvent *event) {
     
    3335    display = graphic[0].display;
    3436
    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 */
    3738    if (LastEvent (display, ConfigureNotify, &event)) Reconfig (graphic, layout, &event);
     39    if (LastEvent (display, CirculateNotify, &event)) Reconfig (graphic, layout, &event);
    3840    if (LastEvent (display, Expose,          &event)) Refresh (graphic, layout, 1);
    39     if (LastEvent (display, MappingNotify,   &event)) XRefreshKeyboardMapping ((XMappingEvent *) &event);
    4041    if (LastEvent (display, MotionNotify,    &event)) UpdatePointer (graphic, layout, (XMotionEvent *) &event);
    4142    if (LastEvent (display, ButtonPress,     &event)) InterpretPresses (graphic, layout, (XButtonEvent *) &event);
    4243    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;
    4355  }
    4456  return (status);
  • trunk/Ohana/src/kii/include/constants.h

    r2466 r3695  
    1414*/
    1515
    16 # define EVENT_MASK (long) (ButtonPressMask | ClientMessage | ButtonReleaseMask | KeyPressMask | ExposureMask | StructureNotifyMask | PointerMotionMask)
    1716# define DEFAULT_CURSOR XC_crosshair
    1817# define BORDER_WIDTH 2
     
    2625int DECIMAL_DEG;
    2726int 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
     39ExposureMask        : Expose
     40StructureNotifyMask : CirculateNotify |
     41                      ConfigureNotify |
     42                      DestroyNotify   |
     43                      GravityNotify   |
     44                      MapNotify       |
     45                      ReparentNotify  |
     46                      UnmapNotify
     47ButtonPressMask     : ButtonPress
     48ButtonReleaseMask   : ButtonRelease
     49KeyPressMask        : KeyPress
     50PointerMotionMask   : MotionNotify
     51(always)            : ClientMessage
     52(always)            : MappingNotify
     53
     54*/
Note: See TracChangeset for help on using the changeset viewer.