Add option to move the cursor back to the original position
+23 −2 · 5 files changed
-
gui.glade+12 −0 -
main.cc+3 −0 -
prefdb.cc+4 −1 -
prefdb.h+2 −1 -
prefs.cc+2 −0
@@ -999,6 +999,18 @@ <property name="position">3</property> </packing> </child> + <child> + <object class="GtkCheckButton" id="check_move_back"> + <property name="label" translatable="yes">Move the cursor back to the original position after each gesture</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">False</property> + <property name="draw_indicator">True</property> + </object> + <packing> + <property name="position">4</property> + </packing> + </child> </object> </child> </object> @@ -811,6 +811,9 @@ protected: virtual void release(guint b, RTriple e) { RStroke s = finish(0); + if (prefs.move_back.get() && !current_dev->absolute) + current_dev->fake_motion(orig->x, orig->y); + if (stroke_action) { (*stroke_action)(s); return parent->replace_child(NULL); @@ -53,7 +53,8 @@ PrefDB::PrefDB() : scroll_invert(true), scroll_speed(2.0), tray_feedback(false), - show_osd(true) + show_osd(true), + move_back(false) {} template<class Archive> void PrefDB::serialize(Archive & ar, const unsigned int version) { @@ -128,6 +129,8 @@ template<class Archive> void PrefDB::serialize(Archive & ar, const unsigned int ar & scroll_speed.unsafe_ref(); ar & tray_feedback.unsafe_ref(); ar & show_osd.unsafe_ref(); + if (version < 16) return; + ar & move_back.unsafe_ref(); } void PrefDB::timeout() { @@ -133,12 +133,13 @@ public: PrefSource<double> scroll_speed; PrefSource<bool> tray_feedback; PrefSource<bool> show_osd; + PrefSource<bool> move_back; void init(); virtual void timeout(); }; -BOOST_CLASS_VERSION(PrefDB, 15) +BOOST_CLASS_VERSION(PrefDB, 16) extern PrefDB prefs; @@ -269,6 +269,8 @@ Prefs::Prefs() { new Check(prefs.scroll_invert, "check_scroll_invert"); new Adjustment<double>(prefs.scroll_speed, "adjustment_scroll_speed"); + new Check(prefs.move_back, "check_move_back"); + new Check(prefs.show_osd, "check_osd"); Gtk::Button *bbutton, *add_exception, *remove_exception, *add_extra, *edit_extra, *remove_extra;