X-Git-Url: https://git.xonotic.org/?a=blobdiff_plain;f=libs%2Fgtkutil%2Fxorrectangle.cpp;h=56ae908a2e911c3ab7e65b6220d18dc6eed2e684;hb=84756b932f65be549f04bea386964701337d94ff;hp=c638e0e21fcaa61ffd01d77da3f7ef32c5942d98;hpb=f3d0806dfea23aef768535ee2fc8e1fff9aebe9f;p=xonotic%2Fnetradiant.git diff --git a/libs/gtkutil/xorrectangle.cpp b/libs/gtkutil/xorrectangle.cpp index c638e0e2..56ae908a 100644 --- a/libs/gtkutil/xorrectangle.cpp +++ b/libs/gtkutil/xorrectangle.cpp @@ -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 } }