points->set_point(hot_point, PT_X, v);
}
points->update_list();
- gui->plugin->send_configure_change();
+ gui->send_configure_change();
return 1;
}
int CriKeyPointY::handle_event()
points->set_point(hot_point, PT_Y, v);
}
points->update_list();
- gui->plugin->send_configure_change();
+ gui->send_configure_change();
return 1;
}
this->mode = mode;
set_text(draw_modes[mode]);
gui->plugin->config.draw_mode = mode;
- if( send ) gui->plugin->send_configure_change();
+ if( send ) gui->send_configure_change();
}
CriKeyColorButton::CriKeyColorButton(CriKeyWindow *gui, int x, int y)
gui->lock_window("CriKeyColorPicker::handle_done_event");
gui->update_color(color);
gui->plugin->config.color = color;
- gui->plugin->send_configure_change();
+ gui->send_configure_change();
gui->unlock_window();
}
gui->update_color(this->color = color);
gui->flush();
gui->plugin->config.color = color;
- gui->plugin->send_configure_change();
+ gui->send_configure_change();
gui->unlock_window();
return 1;
}
this->drag = 0; this->dragging = 0;
this->last_x = 0; this->last_y = 0;
this->points = 0; this->cur_point = 0;
+ this->pending_config = 0;
}
CriKeyWindow::~CriKeyWindow()
show_window(1);
}
+void CriKeyWindow::send_configure_change()
+{
+ pending_config = 0;
+ plugin->send_configure_change();
+}
+int CriKeyWindow::check_configure_change(int ret)
+{
+ if( pending_config && !grab_event_count() )
+ send_configure_change();
+ return ret;
+}
+
int CriKeyWindow::grab_event(XEvent *event)
{
switch( event->type ) {
case ButtonPress: break;
case ButtonRelease: break;
case MotionNotify: break;
- default: return 0;
+ default:
+ return check_configure_change(0);
}
MWindow *mwindow = plugin->server->mwindow;
cy -= mwindow->theme->ccanvas_y;
if( !dragging ) {
- if( cx < 0 || cx >= mwindow->theme->ccanvas_w ) return 0;
- if( cy < 0 || cy >= mwindow->theme->ccanvas_h ) return 0;
+ if( cx < 0 || cx >= mwindow->theme->ccanvas_w ||
+ cy < 0 || cy >= mwindow->theme->ccanvas_h )
+ return check_configure_change(0);
}
switch( event->type ) {
case ButtonPress:
- if( dragging ) return 0;
+ if( dragging ) return check_configure_change(0);
dragging = event->xbutton.state & ShiftMask ? -1 : 1;
break;
case ButtonRelease:
- if( !dragging ) return 0;
+ if( !dragging ) return check_configure_change(0);
dragging = 0;
return 1;
case MotionNotify:
- if( !dragging ) return 0;
+ if( !dragging ) return check_configure_change(0);
break;
default:
- return 0;
+ return check_configure_change(0);
}
float cursor_x = cx, cursor_y = cy;
}
last_x = output_x; last_y = output_y;
- plugin->send_configure_change();
+ if( !grab_event_count() )
+ send_configure_change();
+ else
+ pending_config = 1;
return 1;
}
gui->point_y->update(y_text);
plugin->config.selected = hot_point;
update(hot_point);
- gui->plugin->send_configure_change();
+ gui->send_configure_change();
return 1;
}
{
float v = get_value();
gui->plugin->config.threshold = v;
- gui->plugin->send_configure_change();
+ gui->send_configure_change();
return 1;
}
gui->plugin->config.selected = hot_point;
gui->points->update(hot_point);
}
- gui->plugin->send_configure_change();
+ gui->send_configure_change();
return 1;
}
gui->plugin->config.selected = hot_point;
gui->points->update(hot_point);
}
- gui->plugin->send_configure_change();
+ gui->send_configure_change();
return 1;
}
else
gui->ungrab(cwindow_gui);
gui->plugin->config.drag = value;
- gui->plugin->send_configure_change();
+ gui->send_configure_change();
return 1;
}
{
int k = plugin->new_point();
gui->points->update(k);
- gui->plugin->send_configure_change();
+ gui->send_configure_change();
return 1;
}
if( hot_point >= n && hot_point > 0 ) --hot_point;
gui->plugin->config.selected = hot_point;
gui->points->update(hot_point);
- gui->plugin->send_configure_change();
+ gui->send_configure_change();
}
return 1;
}