Live Thumbnail of Widgets



I work on the Tilix terminal emulator and I'm looking at enhancing some
functionality. At the moment Tilix uses a siderbar rather then tabs to
manage multiple pages (or sessions as they are referred to in Tilix). This
sidebar is in a GTKRevealer that can be popped out and shown as needed and
in the sidebar I render thumbnails of the pages as a visual cue to help the
user select the desired page/session. A screenshot of the sidebar can be
seen here:

https://gnunn1.github.io/tilix-web/assets/images/gallery/tilix-screenshot-2.png

At the moment the rendering of thumbnails for off-screen pages is
relatively expensive. In order for the rendering to work, I need to create
a GTKOffscreenWindow, re-parent the widget to it, draw to a surface and
finally render the thumbnail. The whole process takes between 10 to 30 ms.
In the current design where the rendering happens when the sidebar is
popped out it's fast enough.

I'd like to have the option of making the sidebar permanently visible in
addition to the revealer. One thing that's been holding me back on this is
the expectation that as soon as it becomes permanently visible there is an
expectation that the contents would be updated real time or least near real
time. My rendering time of 10 to 30 ms is just a bit too slow for that
particularly if it's being called very regularly.

I was thinking of switching from using GTKNotebook to a custom solution
which would host the non-visible pages in GTKOffScreenWindow and simply
re-parent them to a visible GtkBox when it becomes the active page/session.
I was looking at POCing this approach out a bit however it strikes me as
having a certain amount of ugliness that I can't help but feel there is a
better way.

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'm not well versed in the lower intricacies of GTK hence why I thought it
would be a good idea to ask for advice before I go too far and end up going
in the wrong direction.

Cheers,

Gerald


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