Fix NSGLView invalidation
authorRobin Gareus <robin@gareus.org>
Tue, 18 Jul 2017 19:34:03 +0000 (21:34 +0200)
committerRobin Gareus <robin@gareus.org>
Tue, 18 Jul 2017 19:34:03 +0000 (21:34 +0200)
libs/canvas/canvas.cc
libs/canvas/canvas/canvas.h

index 3c89ebd6e27ab0fc3aa8de68831d40b394e6e388..8456d44d828181462eacaec1735d5346425ac901 100644 (file)
@@ -873,7 +873,6 @@ GtkCanvas::on_expose_event (GdkEventExpose* ev)
        }
 #ifdef __APPLE__
        if (_nsglview) {
-               Gtkmm2ext::nsglview_queue_draw (_nsglview, ev->area.x, ev->area.y, ev->area.width, ev->area.height);
                return true;
        }
 #endif
@@ -1201,6 +1200,30 @@ GtkCanvas::on_unmap ()
 #endif
 }
 
+void
+GtkCanvas::queue_draw()
+{
+#ifdef __APPLE__
+       if (_nsglview) {
+               Gtkmm2ext::nsglview_queue_draw (_nsglview, 0, 0, get_width (), get_height ());
+               return;
+       }
+#endif
+       Gtk::Widget::queue_draw ();
+}
+
+void
+GtkCanvas::queue_draw_area (int x, int y, int width, int height)
+{
+#ifdef __APPLE__
+       if (_nsglview) {
+               Gtkmm2ext::nsglview_queue_draw (_nsglview, x, y, width, height);
+               return;
+       }
+#endif
+       Gtk::Widget::queue_draw_area (x, y, width, height);
+}
+
 /** Called to request a redraw of our canvas.
  *  @param area Area to redraw, in window coordinates.
  */
index 6d8fd89a7a2a0c81baedc4ae5e18d32f19fb0157..d1521593cd8c07b5dd23edf1f2a7e4d86cba8a18 100644 (file)
@@ -214,6 +214,9 @@ public:
        void start_tooltip_timeout (Item*);
        void stop_tooltip_timeout ();
 
+       void queue_draw ();
+       void queue_draw_area (int x, int y, int width, int height);
+
        Glib::RefPtr<Pango::Context> get_pango_context();
 
        void render (Cairo::RefPtr<Cairo::Context> const & ctx, cairo_rectangle_t* r)