diff options
author | Jan Holesovsky <kendy@collabora.com> | 2015-06-12 15:36:03 +0200 |
---|---|---|
committer | Jan Holesovsky <kendy@collabora.com> | 2015-06-12 15:39:19 +0200 |
commit | e6a1956034c98204e30b0ca40330249d6f6f8155 (patch) | |
tree | ffc7d991f7d8933c12b247daca672b2dc92a33bc /vcl | |
parent | fbfee1dd45c85a85f692f50a790f1ce757149b0d (diff) |
tdf#91301: Don't cache incomplete tabs.
After introduction of the Idle processing, something has changed so
that the underlying GetGdkWindow() does not update its size fast enough;
even though the gtk_window_resize() is called before the Window::Erase()
(that actually paints the background) etc.
The consequence of the not-yet-updated gdkDrawable is that we cache
something that has the correct background in the top left 200x200
pixels, but the rest is just copied from the screen.
Let's for now just not cache when the GetGdkWindow() is smaller than
what we actually paint; TODO find the root cause.
Change-Id: Ib6092668eb4613899f665bb0f12fc1eb15484e13
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx | 28 |
1 files changed, 24 insertions, 4 deletions
diff --git a/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx b/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx index 463d9fe00ced..365dba82fc7f 100644 --- a/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx +++ b/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx @@ -2914,11 +2914,31 @@ bool GtkSalGraphics::NWPaintGTKTabItem( ControlType nType, ControlPart, } END_CACHE_PIXMAP_RENDER( pixmapRect, pixmap, mask ) + // tdf#91301 workaround + // + // After introduction of the Idle processing, something has changed so + // that the underlying GetGdkWindow() does not update its size fast enough; + // even though the gtk_window_resize is called before the Window::Erase() + // (that actually paints the background) etc. + // + // The consequence of the not-yet-updated gdkDrawable is that we cache + // something that has the correct background in the top left 200x200 + // pixels, but the rest is just copied from the screen. + // + // Let's for now just not cache when the GetGdkWindow() is smaller than + // what we actually paint; TODO find the root cause. + gint width, height; + gdk_drawable_get_size(GetGdkWindow(), &width, &height); + bool bAllowCaching = (pixmapRect.Right() < width) && (pixmapRect.Bottom() < height); + // cache data - if( nType == CTRL_TAB_ITEM ) - aCacheItems.Fill( nType, nState, pixmapRect, pixmap, mask ); - else - aCachePage.Fill( nType, nState, pixmapRect, pixmap, mask ); + if (bAllowCaching) + { + if (nType == CTRL_TAB_ITEM) + aCacheItems.Fill(nType, nState, pixmapRect, pixmap, mask); + else + aCachePage.Fill(nType, nState, pixmapRect, pixmap, mask); + } return true; } |