Re: Live Thumbnail of Widgets



On Fri, Jun 2, 2017, 20:57 infirit <infirit gmail com> wrote:

On 20/05/17 16:27, Gerald Nunn wrote:
I'm looking for some advice on alternative solutions that would fit my
needs. In an ideal solution, the thumbnails would be updated real time
similar to the windows in gnome-shell when you go into overview mode.
However any solution that increases the rendering speed sufficiently to
permit buffered but near real-time updates would be sufficient as well.

I never done anything like this so please anyone correct me if I am
wrong, but..

Have you though about connecting to the widget's draw signal? With it
you get a cairo context which one usually draws on but I can imagine you
could just as well create a pixbuf  miniature. So, get the surface from
the cairo context with cairo_get_target, then use
gdk_pixbuf_get_from_surface to create the pixbuf.

~infirit


If I get it right, whenever you want to draw the thumbnail, you reparent
the widget to an offscreen window. How about reparenting them at the moment
they disappear from eyesight, and leaving them there until it needs to be
displayed? That might save you some CPU time.

Also, I would probably use the widget itself as the thumbnail, shielded by
an unclickable, transparent layer. However, all the rescaling that has to
be done this way may introduce significant CPU usage.

Maybe you should take a look into the sources of Boxes. I don't remember,
how they generate the thumbnails for the VM screens, but it might help.

Best,
Gergely




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