/[gzz]/gzz/gfx/libos/Os-GLX.cxx
ViewVC logotype

Diff of /gzz/gfx/libos/Os-GLX.cxx

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.27 by tjl, Tue Mar 4 13:15:01 2003 UTC revision 1.28 by tjl, Tue Mar 4 13:49:06 2003 UTC
# Line 719  namespace Os { Line 719  namespace Os {
719                  // If we're waiting for a timeout, sleep less.                  // If we're waiting for a timeout, sleep less.
720                  if(timeouts.size() && !eventsWaiting) {                  if(timeouts.size() && !eventsWaiting) {
721                      long t = curTime();                      long t = curTime();
722                        DBG(dbg) << "Have timeouts: curtime="<<t<<"\n";
723                      for(unsigned i=0; i<timeouts.size(); i++) {                      for(unsigned i=0; i<timeouts.size(); i++) {
724                            DBG(dbg) << "Timeout "<<i<<": "<<timeouts[i].time<<" "<<timeouts[i].id<<"\n";
725                          if(timeouts[i].time < t) {                          if(timeouts[i].time < t) {
726                                DBG(dbg) << "Did timeout!\n";
727                              int id = timeouts[i].id;                              int id = timeouts[i].id;
728                              LXWindow *w = windowsByX[timeouts[i].window];                              LXWindow *w = windowsByX[timeouts[i].window];
729                              timeouts.erase(timeouts.begin()+i);                              timeouts.erase(timeouts.begin()+i);
# Line 730  namespace Os { Line 733  namespace Os {
733                              int ms = timeouts[i].time - t;                              int ms = timeouts[i].time - t;
734                              if(ms < timeout.tv_usec / 1000)                              if(ms < timeout.tv_usec / 1000)
735                                  timeout.tv_usec = 1000 * ms;                                  timeout.tv_usec = 1000 * ms;
736                                DBG(dbg) << "No timeout: "<<ms<<" "<<timeout.tv_usec<<"\n";
737                          }                          }
738                      }                      }
739                  }                  }
740                  // Call select to wait for something to happen.                  // Call select to wait for something to happen.
741                  tmpReadFds = readFds;                  tmpReadFds = readFds;
742                    DBG(dbg) << "Select: "<<timeout.tv_sec<<" "<<timeout.tv_usec<<"\n";
743                  select(fdsMax, &tmpReadFds, 0, 0, &timeout);                  select(fdsMax, &tmpReadFds, 0, 0, &timeout);
744                  char b[4];                  char b[4];
745                  DBG(dbg) << "Emptying interrupt pipe\n";                  DBG(dbg) << "Emptying interrupt pipe\n";
# Line 744  namespace Os { Line 749  namespace Os {
749                  DBG(dbg) << "Empty\n";                  DBG(dbg) << "Empty\n";
750              }              }
751    
752                eventsWaiting = XEventsQueued(dpy, QueuedAfterFlush);
753              XEvent e;              if(eventsWaiting) {
754              XNextEvent(dpy, &e);                  XEvent e;
755              //cout << "getWindow\n";                  XNextEvent(dpy, &e);
756              LXWindow *w = windowsByX[e.xkey.window];                  //cout << "getWindow\n";
757              if(!w) {                  LXWindow *w = windowsByX[e.xkey.window];
758                  DBG(dbg) << "Event for unknown window\n";                  if(!w) {
759                  continue;                      DBG(dbg) << "Event for unknown window\n";
760                        continue;
761                    }
762                    //cout << "deliver\n";
763                    w->deliverEvent(&e);
764              }              }
             //cout << "deliver\n";  
             w->deliverEvent(&e);  
765          }          }
766      }      }
767    

Legend:
Removed from v.1.27  
changed lines
  Added in v.1.28

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26