notify_callbacks();
capture_dev=0;
connect_signals();
- capture_complete.emit();
+ signal_capture_complete.emit();
}
else if(src.type==BUTTON && i==src.index)
on_press();
src.dev=capture_dev;
src.type=type;
src.index=i;
+
notify_callbacks();
+ capture_dev=0;
connect_signals();
- capture_complete.emit();
+ signal_capture_complete.emit();
}
}
else if(src.type==AXIS_POS && i==src.index && v>=0)
class Control: public sigc::trackable
{
public:
- sigc::signal<void> capture_complete;
+ sigc::signal<void> signal_capture_complete;
protected:
ControlSource src;
Colormap cmap=XCreateColormap(display, root, vi->visual, AllocNone);
XSetWindowAttributes attr;
attr.colormap=cmap;
+ attr.override_redirect=options.fullscreen;
- Handle wnd=XCreateWindow(display, root, 0, 0, options.width, options.height, 0, vi->depth, InputOutput, vi->visual, CWColormap, &attr);
+ Handle wnd=XCreateWindow(display, root, 0, 0, options.width, options.height, 0, vi->depth, InputOutput, vi->visual, CWColormap|CWOverrideRedirect, &attr);
set_window(wnd);
glx_wnd=glXCreateWindow(display, config[0], wnd, 0);
void SmoothControl::on_release()
{
- on_motion(0, -value);
+ if(value>0)
+ on_motion(0, -value);
}
void SmoothControl::on_motion(float v, float)
value=v;
signal_motion.emit(value);
- if(paired_ctrl)
- paired_ctrl->signal_motion.emit(-value);
+ if(paired_ctrl && paired_ctrl->get_value()!=-value)
+ paired_ctrl->on_motion(-value, -value-paired_ctrl->get_value());
}
} // namespace Input
{
window=wnd;
- XSelectInput(display, window, ButtonPressMask|ButtonReleaseMask|PointerMotionMask|KeyPressMask|KeyReleaseMask|StructureNotifyMask);
+ XSelectInput(display, window, ButtonPressMask|ButtonReleaseMask|PointerMotionMask|KeyPressMask|KeyReleaseMask|StructureNotifyMask|EnterWindowMask);
XSetWMProtocols(display, window, &wm_delete_window, 1);
}
{
prepare();
- Handle wnd=XCreateWindow(display, DefaultRootWindow(display), 0, 0, options.width, options.height, 0, CopyFromParent, InputOutput, CopyFromParent, 0, 0);
+ XSetWindowAttributes attr;
+ attr.override_redirect=options.fullscreen;
+
+ Handle wnd=XCreateWindow(display, DefaultRootWindow(display), 0, 0, options.width, options.height, 0, CopyFromParent, InputOutput, CopyFromParent, CWOverrideRedirect, &attr);
set_window(wnd);
}
if(event.xclient.data.l[0]==static_cast<long>(wm_delete_window))
signal_close.emit();
break;
+ case EnterNotify:
+ XSetInputFocus(display, window, RevertToParent, CurrentTime);
+ break;
default:;
}