From 77921c8602555b1e93989f0edba8a141ff677605 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kondor=20D=C3=A1niel?= Date: Sat, 22 Sep 2018 22:41:27 +0800 Subject: [PATCH 1/2] minor fixes to make Easystroke compile on Ubuntu 18.04 --- actions.cc | 5 ++++- handler.cc | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/actions.cc b/actions.cc index 45c03761..749421ac 100644 --- a/actions.cc +++ b/actions.cc @@ -54,7 +54,10 @@ void TreeViewMulti::on_drag_begin(const Glib::RefPtr &context) 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 const&, Gtk::TreeModel::Path const&, bool) { + return !pending; + }); } enum Type { COMMAND, KEY, TEXT, SCROLL, IGNORE, BUTTON, MISC }; diff --git a/handler.cc b/handler.cc index 8830ea28..3bde46c8 100644 --- a/handler.cc +++ b/handler.cc @@ -533,7 +533,7 @@ class WaitForPongHandler : public Handler, protected Timeout { virtual Grabber::State grab_mode() { return parent->grab_mode(); } }; -static inline float abs(float x) { return x > 0 ? x : -x; } +/* static inline float abs(float x) { return x > 0 ? x : -x; } */ class AbstractScrollHandler : public Handler { bool have_x, have_y; From 140b9cae66ba874bf0994eea71210baf417a136e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kondor=20D=C3=A1niel?= Date: Sat, 22 Sep 2018 22:42:06 +0800 Subject: [PATCH 2/2] fixed recurring crash when trying to render 0x0 tray icon --- win.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/win.cc b/win.cc index da41b0e8..36746430 100644 --- a/win.cc +++ b/win.cc @@ -275,7 +275,7 @@ void Win::timeout() { } void Win::set_icon(RStroke stroke, bool invert) { - if (!icon) + if (!icon || icon->get_size() <= 0) return; icon->set(stroke->draw(icon->get_size(), 2.0, invert)); set_timeout(10000);