nanogui: Thread: Missing events?


[<<] [<] Page 1 of 1 [>] [>>]
Subject: Missing events?
From: "Robbie" ####@####.####
Date: 7 Mar 2006 14:34:51 +0000
Message-Id: <20060307143443.D9D752F5C5@xprdmxin.myway.com>

Hi All,
Below is a my main loop code and it appears that I'm missing events, particularly the EXPOSE event in this case. The redraw bit is set in the parser() but the init() is only being executed on the first execution and never again. The redraw bit is being set several times which indicates the MapWindow is being called. Is their a bad sequence here? can anyone offer any advice?
Much thanks.

void eloop(void) {
        do {
           if(status_flags.chgaddr) {
                ADDR = Get_dev_addr(MY_ADDR);
                COMMUN_ID = ((SATX << 8) | ADDR );
           }

           if(flags.rx) {
                flags.rx = 0;
                if(flags.bypass) Qitem = parser();
                else {
                        loop = false;
                        do {
                            Qitem = dequeue();
                            if((Qitem == SATX) || Qitem) loop = true;
                        }while(!loop);

                        if(Qitem) printf("EMPTY\n");
                        else {
                                if(Qitem == SATX) {
                                        Qitem = dequeue();
                                    if(Qitem == ADDR) {
                                        Qitem = parser();
                                        }
                                } /* if SATX */
                        } /* if !empty */
                }/* if !bypass */
           }/* if rx */

           if(flags.redraw) { GrMapWindow(tscrn); }

           GrGetNextEvent(&event);
             switch(event.type) {
                case GR_EVENT_TYPE_EXPOSURE:
                     status_flags.redraw = 0;
                       init(0);
                     break;
                case GR_EVENT_TYPE_BUTTON_DOWN:
                     break;
                case GR_EVENT_TYPE_TIMER:
                     break;
                case GR_EVENT_TYPE_CLOSE_REQ:
                     GrClose();
                     return;
             } /* event switch */
        }while(EXTHMLOOP); /* While */
} //end eloop 

_______________________________________________
Join Excite! - http://www.excite.com
The most personalized portal on the Web!


Subject: RE: [nanogui] Missing events?
From: "Robbie" ####@####.####
Date: 7 Mar 2006 17:09:28 +0000
Message-Id: <20060307170924.81E5ABD64F@xprdmxin.myway.com>

I just wanted to modify this by adding that the event returned is indicating a NONE event when it should have a EXPOSURE event registered.
Therefore, I might be missing smmething or I'm actually missing events.
Any thoughts?


> -----Original Message-----
> From: Robbie ####@####.####
> Sent: Tuesday, March 07, 2006 8:35 AM
> To: ####@####.####
> Subject: [nanogui] Missing events?
> Importance: High
> 
> 
> Hi All,
> Below is a my main loop code and it appears that I'm missing events,
> particularly the EXPOSE event in this case. The redraw bit is set in the
> parser() but the init() is only being executed on the first execution and
> never again. The redraw bit is being set several times which indicates the
> MapWindow is being called. Is their a bad sequence here? can anyone offer
> any advice?
> Much thanks.
> 
> void eloop(void) {
>         do {
>            if(status_flags.chgaddr) {
>                 ADDR = Get_dev_addr(MY_ADDR);
>                 COMMUN_ID = ((SATX << 8) | ADDR );
>            }
> 
>            if(flags.rx) {
>                 flags.rx = 0;
>                 if(flags.bypass) Qitem = parser();
>                 else {
>                         loop = false;
>                         do {
>                             Qitem = dequeue();
>                             if((Qitem == SATX) || Qitem) loop = true;
>                         }while(!loop);
> 
>                         if(Qitem) printf("EMPTY\n");
>                         else {
>                                 if(Qitem == SATX) {
>                                         Qitem = dequeue();
>                                     if(Qitem == ADDR) {
>                                         Qitem = parser();
>                                         }
>                                 } /* if SATX */
>                         } /* if !empty */
>                 }/* if !bypass */
>            }/* if rx */
> 
>            if(flags.redraw) { GrMapWindow(tscrn); }
> 
>            GrGetNextEvent(&event);
>              switch(event.type) {
>                 case GR_EVENT_TYPE_EXPOSURE:
>                      status_flags.redraw = 0;
>                        init(0);
>                      break;
>                 case GR_EVENT_TYPE_BUTTON_DOWN:
>                      break;
>                 case GR_EVENT_TYPE_TIMER:
>                      break;
>                 case GR_EVENT_TYPE_CLOSE_REQ:
>                      GrClose();
>                      return;
>              } /* event switch */
>         }while(EXTHMLOOP); /* While */
> } //end eloop
> 
> _______________________________________________
> Join Excite! - http://www.excite.com
> The most personalized portal on the Web!
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: ####@####.####
> For additional commands, e-mail: ####@####.####



_______________________________________________
Join Excite! - http://www.excite.com
The most personalized portal on the Web!


Subject: Re: [nanogui] Missing events?
From: "Greg Haerr" ####@####.####
Date: 7 Mar 2006 17:57:18 +0000
Message-Id: <17ac01c64210$8f3409a0$0300a8c0@RDP>

: >The redraw bit is being set several times which indicates the
: > MapWindow is being called. Is their a bad sequence here? 

You'll only get events that you've registered for with
GrSelectEvent(), of course that code fragment isn't included
here.  I'd say you've got a bug in your code somewhere,
since nano-X is very well tested in this area.

Regards,

Greg

Subject: Re: [nanogui] Missing events?
From: "Robbie" ####@####.####
Date: 7 Mar 2006 18:24:50 +0000
Message-Id: <20060307182446.8BBC7BD745@xprdmxin.myway.com>

If I call GrMapWindow just before the GrGetNextEvent, shouldn't it pick up some event?
What's the nature of such a bug that could cause this? Timing? Memory? 

Thanks.

> -----Original Message-----
> From: Greg Haerr ####@####.####
> Sent: Tuesday, March 07, 2006 11:57 AM
> To: ####@####.#### ####@####.####
> Subject: Re: [nanogui] Missing events?
> 
> : >The redraw bit is being set several times which indicates the
> : > MapWindow is being called. Is their a bad sequence here?
> 
> You'll only get events that you've registered for with
> GrSelectEvent(), of course that code fragment isn't included
> here.  I'd say you've got a bug in your code somewhere,
> since nano-X is very well tested in this area.
> 
> Regards,
> 
> Greg
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: ####@####.####
> For additional commands, e-mail: ####@####.####


_______________________________________________
Join Excite! - http://www.excite.com
The most personalized portal on the Web!


Subject: Re: [nanogui] Missing events?
From: "Greg Haerr" ####@####.####
Date: 7 Mar 2006 18:38:25 +0000
Message-Id: <185101c64216$4f4eb5f0$0300a8c0@RDP>

: If I call GrMapWindow just before the GrGetNextEvent, shouldn't it pick up
some event?
: What's the nature of such a bug that could cause this? Timing? Memory?

Remember, nano-X is a client/server system.  When you call
GrMapWindow(), a command is queued to send to the
server.  When GrGetNextEvent or GrFlush is called, the
command is sent to the server.  In the meantime, if there's
any event waiting in the client local queue, it is returned.
Otherwise the client blocks waiting for an event.  Meanwhile,
the server maps the window, and generates expose events
for windows that have selected for them.  Eventually, GrGetNextEvent
will get that event, possibly after multiple waits.

Regards,

Greg

Subject: Re: [nanogui] Missing events?
From: "Robbie" ####@####.####
Date: 7 Mar 2006 20:20:10 +0000
Message-Id: <20060307201959.075E4BD676@xprdmxin.myway.com>

Is there a call for the server queue count? I've use the client side call (GrQueueCount) which surprisingly always returned 0. I think that would give me a good start.

Thanks,
Robbie.

> -----Original Message-----
> From: Greg Haerr ####@####.####
> Sent: Tuesday, March 07, 2006 12:38 PM
> To: ####@####.#### ####@####.####
> Subject: Re: [nanogui] Missing events?
> 
> : If I call GrMapWindow just before the GrGetNextEvent, shouldn't it pick
> up
> some event?
> : What's the nature of such a bug that could cause this? Timing? Memory?
> 
> Remember, nano-X is a client/server system.  When you call
> GrMapWindow(), a command is queued to send to the
> server.  When GrGetNextEvent or GrFlush is called, the
> command is sent to the server.  In the meantime, if there's
> any event waiting in the client local queue, it is returned.
> Otherwise the client blocks waiting for an event.  Meanwhile,
> the server maps the window, and generates expose events
> for windows that have selected for them.  Eventually, GrGetNextEvent
> will get that event, possibly after multiple waits.
> 
> Regards,
> 
> Greg
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: ####@####.####
> For additional commands, e-mail: ####@####.####

_______________________________________________
Join Excite! - http://www.excite.com
The most personalized portal on the Web!


Subject: Re: [nanogui] Missing events?
From: "Greg Haerr" ####@####.####
Date: 7 Mar 2006 21:32:56 +0000
Message-Id: <1be401c6422e$af646940$0300a8c0@RDP>

: Is there a call for the server queue count? I've use the client side call
(GrQueueCount) which surprisingly always returned 0. I think that would give
me a good start.

No, there isn't.  As I said before, I don't think the problem
is in nano-X.  The problem isn't related to missing events,
but rather likely your program logic and things like GrSelectEvent.

Regards,

Greg

Subject: Re: [nanogui] Missing events?
From: "Robbie" ####@####.####
Date: 7 Mar 2006 21:42:20 +0000
Message-Id: <20060307214149.3A11EBD66F@xprdmxin.myway.com>

You're right!
Somehow I accidentally deleted my UnmapWindow call rendering repeated calls to MapWindow useless.

Thanks for your help,
Robbie

> -----Original Message-----
> From: Greg Haerr ####@####.####
> Sent: Tuesday, March 07, 2006 3:33 PM
> To: ####@####.#### ####@####.####
> Subject: Re: [nanogui] Missing events?
> 
> : Is there a call for the server queue count? I've use the client side
> call
> (GrQueueCount) which surprisingly always returned 0. I think that would
> give
> me a good start.
> 
> No, there isn't.  As I said before, I don't think the problem
> is in nano-X.  The problem isn't related to missing events,
> but rather likely your program logic and things like GrSelectEvent.
> 
> Regards,
> 
> Greg
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: ####@####.####
> For additional commands, e-mail: ####@####.####



_______________________________________________
Join Excite! - http://www.excite.com
The most personalized portal on the Web!


Subject: Re: [nanogui] Missing events?
From: "Greg Haerr" ####@####.####
Date: 7 Mar 2006 21:54:26 +0000
Message-Id: <1c1801c64231$1e667660$0300a8c0@RDP>

: Somehow I accidentally deleted my UnmapWindow call rendering repeated
calls to MapWindow useless.

Its a good thing the window environment is less buggy than
the applications software!

Regards,

Greg

[<<] [<] Page 1 of 1 [>] [>>]


Powered by ezmlm-browse 0.20.