summaryrefslogtreecommitdiff
path: root/vcl/unx/gtk3
diff options
context:
space:
mode:
authorLucas Baudin <xapantu@gmail.com>2012-03-03 15:44:54 +0100
committerLucas Baudin <xapantu@gmail.com>2012-03-03 15:44:54 +0100
commit1cf3e446744ae679bc89b39dcbbcf6b4e9821f3a (patch)
treee3522d428eeac9f36be24cc5ab15272c1ab79477 /vcl/unx/gtk3
parent5122196acc2e8e9d8e71dad3d941b373b09e0b03 (diff)
gtk3: Avoid crash with some themes (unico based)
We didn't check wether the window was big enough to draw all the widgets. Sometimes, when the window was displaying, it was too small and drawing outside of the window caused a crash, we didn't take into account that the root point for drawing gtk3 widgets wasn't always (0,0).
Diffstat (limited to 'vcl/unx/gtk3')
-rw-r--r--vcl/unx/gtk3/gdi/gtk3salnativewidgets-gtk.cxx4
1 files changed, 3 insertions, 1 deletions
diff --git a/vcl/unx/gtk3/gdi/gtk3salnativewidgets-gtk.cxx b/vcl/unx/gtk3/gdi/gtk3salnativewidgets-gtk.cxx
index 95aa313329b2..6bfad00b3170 100644
--- a/vcl/unx/gtk3/gdi/gtk3salnativewidgets-gtk.cxx
+++ b/vcl/unx/gtk3/gdi/gtk3salnativewidgets-gtk.cxx
@@ -1002,8 +1002,10 @@ void GtkSalGraphics::renderAreaToPix( cairo_t *cr,
unsigned char *src = data.get();
src += (int)ay * nStride + (int)ax * 3;
+ awidth = MIN (region->width, size.getX() - ax);
+ aheight = MIN (region->height, size.getY() - ay);
- for (int y = 0; y < size.getY(); ++y)
+ for (int y = 0; y < aheight; ++y)
{
for (int x = 0; x < awidth && y < aheight; ++x)
{