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();
}
}
void SketcherWindow::done_event(int result)
{
+ ungrab(plugin->server->mwindow->cwindow->gui);
}
void SketcherWindow::send_configure_change()
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;