Re: Pixbuf->get_from_drawable in Xvfb ccontext?

That did it.
I suspected as much (but would never have known of Glib::Idle as a solution).

On Dec 31, 2008, at 11:50 AM, Torsten Schoenfeld wrote:

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.
gtk-perl-list mailing list
gtk-perl-list gnome org

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