Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove unnecessary requirement for device to be absolute #9

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions actions.cc
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,11 @@ void TreeViewMulti::on_drag_begin(const Glib::RefPtr<Gdk::DragContext> &context)
context->set_icon(pb, pb->get_width(), pb->get_height());
}

bool negate(bool b) { return !b; }

TreeViewMulti::TreeViewMulti() : Gtk::TreeView(), pending(false) {
get_selection()->set_select_function(sigc::group(&negate, sigc::ref(pending)));
get_selection()->set_select_function(
[this](Glib::RefPtr<Gtk::TreeModel> const&, Gtk::TreeModel::Path const&, bool) {
return !pending;
});
}

enum Type { COMMAND, KEY, TEXT, SCROLL, IGNORE, BUTTON, MISC };
Expand Down
4 changes: 2 additions & 2 deletions gesture.cc
Original file line number Diff line number Diff line change
Expand Up @@ -104,9 +104,9 @@ int Stroke::compare(RStroke a, RStroke b, double &score) {
return -1;
score = MAX(1.0 - 2.5*cost, 0.0);
if (a->timeout)
return score > 0.85;
return score > 0.95;
else
return score > 0.7;
return score > 0.92;
}

Glib::RefPtr<Gdk::Pixbuf> Stroke::draw(int size, double width, bool inv) const {
Expand Down
4 changes: 2 additions & 2 deletions handler.cc
Original file line number Diff line number Diff line change
Expand Up @@ -563,7 +563,7 @@ class AbstractScrollHandler : public Handler {
}
protected:
void move_back() {
if (!prefs.move_back.get() || (xstate->current_dev && xstate->current_dev->absolute))
if (!prefs.move_back.get())
return;
XTestFakeMotionEvent(dpy, DefaultScreen(dpy), orig_x, orig_y, 0);
}
Expand Down Expand Up @@ -968,7 +968,7 @@ class StrokeHandler : public Handler, public sigc::trackable {
virtual void release(guint b, RTriple e) {
RStroke s = finish(0);

if (prefs.move_back.get() && !xstate->current_dev->absolute)
if (prefs.move_back.get())
XTestFakeMotionEvent(dpy, DefaultScreen(dpy), orig->x, orig->y, 0);
else
XTestFakeMotionEvent(dpy, DefaultScreen(dpy), e->x, e->y, 0);
Expand Down