]> git.xonotic.org Git - xonotic/netradiant.git/blobdiff - libs/gtkutil/xorrectangle.cpp
Merge commit 'f3d0806dfea23aef768535ee2fc8e1fff9aebe9f' into master-merge
[xonotic/netradiant.git] / libs / gtkutil / xorrectangle.cpp
index c638e0e21fcaa61ffd01d77da3f7ef32c5942d98..56ae908a2e911c3ab7e65b6220d18dc6eed2e684 100644 (file)
@@ -16,6 +16,7 @@ void XORRectangle::lazy_init()
 
 void XORRectangle::draw() const
 {
+#ifndef WORKAROUND_MACOS_GTK2_DESTROY
     const int x = float_to_integer(m_rectangle.x);
     const int y = float_to_integer(m_rectangle.y);
     const int w = float_to_integer(m_rectangle.w);
@@ -26,6 +27,7 @@ void XORRectangle::draw() const
     cairo_set_source_rgb(cr, 1, 1, 1);
     cairo_set_operator(cr, CAIRO_OPERATOR_DIFFERENCE);
     cairo_stroke(cr);
+#endif
 }
 
 XORRectangle::XORRectangle(ui::GLArea widget) : m_widget(widget), cr(0)
@@ -35,7 +37,9 @@ XORRectangle::XORRectangle(ui::GLArea widget) : m_widget(widget), cr(0)
 XORRectangle::~XORRectangle()
 {
     if (initialised()) {
+#ifndef WORKAROUND_MACOS_GTK2_DESTROY
         cairo_destroy(cr);
+#endif
     }
 }