abiword/abiword-3.0.0-fix-redraw.patch
2014-02-22 18:52:22 +00:00

49 lines
1.5 KiB
Diff

commit f1d711aa84c95430319fd92ffbcb03df36e5e76e
Author: Hubert Figuière <hub@figuiere.net>
Date: Sat Feb 22 10:41:55 2014 -0500
Bug 13582 - Fix redraw region in custom widget.
Cherry-picked from trunk@33870 and reworked for 3.0.x
diff --git a/src/af/gr/gtk/gr_UnixCairoGraphics.cpp b/src/af/gr/gtk/gr_UnixCairoGraphics.cpp
index 4c8d23c..15d7a7d 100644
--- a/src/af/gr/gtk/gr_UnixCairoGraphics.cpp
+++ b/src/af/gr/gtk/gr_UnixCairoGraphics.cpp
@@ -520,7 +520,7 @@ void GR_UnixCairoGraphics::_beginPaint()
{
UT_ASSERT(ev->type == GDK_EXPOSE || ev->type == GDK_DAMAGE);
if (ev->type == GDK_EXPOSE || ev->type == GDK_DAMAGE)
- UT_ASSERT(ev->expose.window == m_pWin);
+ UT_ASSERT(ev->expose.window == m_pWin || ev->expose.window == gdk_window_get_effective_parent (m_pWin));
}
}
#endif
diff --git a/src/af/xap/gtk/xap_UnixCustomWidget.cpp b/src/af/xap/gtk/xap_UnixCustomWidget.cpp
index b0b7015..5150afe 100644
--- a/src/af/xap/gtk/xap_UnixCustomWidget.cpp
+++ b/src/af/xap/gtk/xap_UnixCustomWidget.cpp
@@ -45,16 +45,18 @@ void XAP_UnixCustomWidget::_fe::expose(XAP_UnixCustomWidget *self, GdkEventExpos
#endif
{
#if GTK_CHECK_VERSION(3,0,0)
- GdkEventExpose *ev = reinterpret_cast<GdkEventExpose *>(gtk_get_current_event());
-#endif
+ self->m_cr = cr;
+ double x1, y1, x2, y2;
+ cairo_clip_extents(cr, &x1, &y1, &x2, &y2);
+
+ UT_Rect r(x1, y1, x2 - x1, y2 - y1);
+#else
UT_Rect r(
ev->area.x,
ev->area.y,
ev->area.width,
ev->area.height
);
-#if GTK_CHECK_VERSION(3,0,0)
- self->m_cr = cr;
#endif
self->draw(&r);
}