X-Git-Url: https://git.cinelerra-gg.org/git/?a=blobdiff_plain;f=cinelerra-5.1%2Fplugins%2Fsketcher%2Fsketcherwindow.C;h=77ed39ea6c4e94af38ce13dbd0151279614adee2;hb=dcdf2f77cc47ca7c543f27ddb03c4814015d974b;hp=4a0f18f9a439b5adc8294e478bfdbe0b78ae3943;hpb=476e13a24aad6d0dc6006cd421e9bd2a89977ea1;p=goodguy%2Fcinelerra.git diff --git a/cinelerra-5.1/plugins/sketcher/sketcherwindow.C b/cinelerra-5.1/plugins/sketcher/sketcherwindow.C index 4a0f18f9..77ed39ea 100644 --- a/cinelerra-5.1/plugins/sketcher/sketcherwindow.C +++ b/cinelerra-5.1/plugins/sketcher/sketcherwindow.C @@ -460,6 +460,7 @@ void SketcherWindow::create_objects() void SketcherWindow::done_event(int result) { + ungrab(plugin->server->mwindow->cwindow->gui); } void SketcherWindow::send_configure_change() @@ -507,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;