Re: Pixbuf->get_from_drawable in Xvfb ccontext?



Scott Sneddon wrote:
Do I need to call snapshot in the event loop in order to get the screen to
render?  and if so, what event should I look for to guarantee that the event
is triggered in the Xvfb environment (no mouseclicks).

You are calling snapshot() before the main loop had a chance to do any
work.  You can use an idle callback to take the snapshot when gtk+ has finished
drawing all widgets:

  Glib::Idle->add (sub { snapshot(); return Glib::SOURCE_REMOVE; });

However, even with this there is still a race condition regarding the window
manager borders: the window manager might not have drawn the borders yet when
the callback is triggered.  But apparently you don't use a window manager, so
maybe this is irrelevant in your case.



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]