fix draw_refresh opengl deadlock, cleanup last chkin
[goodguy/cinelerra.git] / cinelerra-5.1 / plugins / sketcher / sketcherwindow.C
index 7cbf15dd14b27b920bcde42b7da4a8c327d9ac34..77ed39ea6c4e94af38ce13dbd0151279614adee2 100644 (file)
@@ -122,7 +122,9 @@ void SketcherCurveColor::handle_done_event(int result)
        if( ci >= 0 && ci < config.curves.size() ) {
                SketcherCurve *cv = config.curves[ci];
                cv->color = color;
+               gui->lock_window("SketcherCurveColor::handle_done_event");
                gui->curve_list->update(ci);
+               gui->unlock_window();
                gui->send_configure_change();
        }
 }
@@ -458,6 +460,7 @@ void SketcherWindow::create_objects()
 
 void SketcherWindow::done_event(int result)
 {
+       ungrab(plugin->server->mwindow->cwindow->gui);
 }
 
 void SketcherWindow::send_configure_change()
@@ -505,15 +508,16 @@ int SketcherWindow::do_grab_event(XEvent *event)
        CWindowGUI *cwindow_gui = mwindow->cwindow->gui;
        CWindowCanvas *canvas = cwindow_gui->canvas;
        int cx, cy;  cwindow_gui->get_relative_cursor(cx, cy);
-       cx -= mwindow->theme->ccanvas_x;
-       cy -= mwindow->theme->ccanvas_y;
+       cx -= canvas->view_x;
+       cy -= canvas->view_y;
 
        if( !dragging ) {
-               if( cx < 0 || cx >= mwindow->theme->ccanvas_w ||
-                   cy < 0 || cy >= mwindow->theme->ccanvas_h )
+               if( cx < 0 || cx >= canvas->view_w ||
+                   cy < 0 || cy >= canvas->view_h )
                        return 0;
        }
 
+
        switch( event->type ) {
        case ButtonPress:
                if( dragging ) return 0;