+ /* work-around scroll-bar + aspect ratio
+ * show inline-view -> height changes -> scrollbar gets added
+ * -> width changes -> inline-view, fixed aspect ratio -> height changes
+ * -> scroll bar is removed [-> width changes ; repeat ]
+ */
+ uint32_t shm = std::min (_max_height, (uint32_t) ceil (dis->height));
+ bool sc = false;
+ Gtk::Container* pr = get_parent();
+ for (uint32_t i = 0; i < 4 && pr; ++i) {
+ // VBox, EventBox, ViewPort, ScrolledWindow
+ pr = pr->get_parent();
+ }
+ Gtk::ScrolledWindow* sw = dynamic_cast<Gtk::ScrolledWindow*> (pr);
+ if (sw) {
+ const Gtk::VScrollbar* vsb = sw->get_vscrollbar();
+ sc = vsb && vsb->is_visible();
+ }
+
+ if (shm != _cur_height) {
+ if (_scroll == sc || _cur_height < shm) {
+ queue_resize ();
+ }
+ _cur_height = shm;
+ }
+ _scroll = sc;
+
+
+ /* allocate a local image-surface,
+ * We cannot re-use the data via cairo_image_surface_create_for_data(),
+ * since pixman keeps a reference to it.
+ * we'd need to hand over the data and ha cairo_surface_destroy to free it.
+ * it might be possible to work around via cairo_surface_set_user_data().
+ */