Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [platform-swt-dev] GTK in CVS

Havoc Pennington <hp@xxxxxxxxxx> writes: 
> For GLib 1.2, things are going to be more exciting. The hack
> we came up with for Display.sleep() is pretty broken, but is:
> 
>    while (g_main_iteration (FALSE)) /* FALSE means don't block, just
>                                      * run already-ready events
>                                      */
>      {
>         /* Here we get the X display connection file descriptor,
>          * and block until it has data using poll() system call
>          * directly on that single descriptor
>          */
>      }
> 

Oops - this was intended to be a conceptual description of the whole
"SWT main loop" including both sleep() and readAndDispatch(). sleep() 
would just be something like:

 if (g_main_pending())
   return true;
 else
   {
     /* first poll on X file descriptor */

     return g_main_pending ();
   }

while readAndDispatch() would do the "while (g_main_iteration (FALSE))" part.

Havoc



Back to the top