diff --git a/easystroke-0.6.0-c11.patch b/easystroke-0.6.0-c11.patch new file mode 100644 index 0000000..28d8df5 --- /dev/null +++ b/easystroke-0.6.0-c11.patch @@ -0,0 +1,495 @@ +diff -up easystroke-0.6.0/actiondb.cc.c11 easystroke-0.6.0/actiondb.cc +--- easystroke-0.6.0/actiondb.cc.c11 2013-03-27 11:52:38.000000000 -0400 ++++ easystroke-0.6.0/actiondb.cc 2019-10-18 14:46:33.216827179 -0400 +@@ -20,6 +20,7 @@ + + #include + #include ++#include + #include + #include + #include +@@ -121,7 +122,7 @@ void Command::run() { + pid_t pid = fork(); + switch (pid) { + case 0: +- execlp("/bin/sh", "sh", "-c", cmd.c_str(), NULL); ++ execlp("/bin/sh", "sh", "-c", cmd.c_str(), nullptr); + exit(1); + case -1: + printf(_("Error: can't execute command \"%s\": fork() failed\n"), cmd.c_str()); +@@ -142,7 +143,7 @@ const Glib::ustring Button::get_label() + + const Glib::ustring Misc::get_label() const { return _(types[type]); } + +-const char *Misc::types[5] = { N_("None"), N_("Unminimize"), N_("Show/Hide"), N_("Disable (Enable)"), NULL }; ++const char *Misc::types[5] = { N_("None"), N_("Unminimize"), N_("Show/Hide"), N_("Disable (Enable)"), nullptr }; + + template void ActionListDiff::serialize(Archive & ar, const unsigned int version) { + ar & deleted; +diff -up easystroke-0.6.0/actions.cc.c11 easystroke-0.6.0/actions.cc +--- easystroke-0.6.0/actions.cc.c11 2019-10-18 14:46:33.207827369 -0400 ++++ easystroke-0.6.0/actions.cc 2019-10-18 14:46:33.216827179 -0400 +@@ -193,12 +193,12 @@ Actions::Actions() : + int i = 0; + while (Misc::types[i]) i++; + CellRendererTextish *arg_renderer = cell_renderer_textish_new_with_items ((gchar**)Misc::types, i); +- GtkTreeViewColumn *col_arg = gtk_tree_view_column_new_with_attributes(_("Details"), GTK_CELL_RENDERER (arg_renderer), "text", cols.arg.index(), NULL); ++ GtkTreeViewColumn *col_arg = gtk_tree_view_column_new_with_attributes(_("Details"), GTK_CELL_RENDERER (arg_renderer), "text", cols.arg.index(), nullptr); + gtk_tree_view_append_column(tv.gobj(), col_arg); + +- gtk_tree_view_column_set_cell_data_func (col_arg, GTK_CELL_RENDERER (arg_renderer), on_actions_cell_data_arg, this, NULL); ++ gtk_tree_view_column_set_cell_data_func (col_arg, GTK_CELL_RENDERER (arg_renderer), on_actions_cell_data_arg, this, nullptr); + gtk_tree_view_column_set_resizable(col_arg, true); +- g_object_set(arg_renderer, "editable", true, NULL); ++ g_object_set(arg_renderer, "editable", true, nullptr); + g_signal_connect(arg_renderer, "key-edited", G_CALLBACK(on_actions_accel_edited), this); + g_signal_connect(arg_renderer, "combo-edited", G_CALLBACK(on_actions_combo_edited), this); + g_signal_connect(arg_renderer, "edited", G_CALLBACK(on_actions_text_edited), this); +@@ -262,7 +262,7 @@ void Actions::on_cell_data_arg(GtkCellRe + Gtk::TreeModel::iterator iter = tm->get_iter(path); + bool bold = (*iter)[cols.action_bold]; + bool deactivated = (*iter)[cols.deactivated]; +- g_object_set(cell, "sensitive", !deactivated, "weight", bold ? 700 : 400, NULL); ++ g_object_set(cell, "sensitive", !deactivated, "weight", bold ? 700 : 400, nullptr); + CellRendererTextish *renderer = CELL_RENDERER_TEXTISH (cell); + if (!renderer) + return; +@@ -309,7 +309,7 @@ bool Actions::AppsStore::row_drop_possib + if (model != parent->tm) + return false; + Gtk::TreeIter dest_iter = parent->apps_model->get_iter(dest); +- ActionListDiff *actions = dest_iter ? (*dest_iter)[parent->ca.actions] : (ActionListDiff *)NULL; ++ ActionListDiff *actions = dest_iter ? (*dest_iter)[parent->ca.actions] : (ActionListDiff *)nullptr; + return actions && actions != parent->action_list; + } + +@@ -322,7 +322,7 @@ bool Actions::AppsStore::drag_data_recei + return false; + Unique *src_id = (*parent->tm->get_iter(src))[parent->cols.id]; + Gtk::TreeIter dest_iter = parent->apps_model->get_iter(dest); +- ActionListDiff *actions = dest_iter ? (*dest_iter)[parent->ca.actions] : (ActionListDiff *)NULL; ++ ActionListDiff *actions = dest_iter ? (*dest_iter)[parent->ca.actions] : (ActionListDiff *)nullptr; + if (!actions || actions == parent->action_list) + return false; + Glib::RefPtr sel = parent->tv.get_selection(); +@@ -752,7 +752,7 @@ void Actions::on_row_activated(const Gtk + } + RStrokeInfo si = action_list->get_info(row[cols.id]); + if (si) +- del->set_sensitive(si->strokes.size()); ++ del->set_sensitive(si->strokes.size() != 0); + + OnStroke ps(this, dialog, row); + stroke_action.reset(new sigc::slot(sigc::mem_fun(ps, &OnStroke::delayed_run))); +diff -up easystroke-0.6.0/gesture.cc.c11 easystroke-0.6.0/gesture.cc +--- easystroke-0.6.0/gesture.cc.c11 2013-03-27 11:52:38.000000000 -0400 ++++ easystroke-0.6.0/gesture.cc 2019-10-18 14:46:33.216827179 -0400 +@@ -99,7 +99,7 @@ int Stroke::compare(RStroke a, RStroke b + } + return -1; + } +- double cost = stroke_compare(a->stroke.get(), b->stroke.get(), NULL, NULL); ++ double cost = stroke_compare(a->stroke.get(), b->stroke.get(), nullptr, nullptr); + if (cost >= stroke_infinity) + return -1; + score = MAX(1.0 - 2.5*cost, 0.0); +diff -up easystroke-0.6.0/grabber.cc.c11 easystroke-0.6.0/grabber.cc +--- easystroke-0.6.0/grabber.cc.c11 2013-03-27 11:52:38.000000000 -0400 ++++ easystroke-0.6.0/grabber.cc 2019-10-18 14:46:33.216827179 -0400 +@@ -367,7 +367,7 @@ void Grabber::new_device(XIDeviceInfo *i + } + } + +-Grabber::XiDevice::XiDevice(Grabber *parent, XIDeviceInfo *info) : absolute(false), proximity_axis(-1), scale_x(1.0), scale_y(1.0), num_buttons(0) { ++Grabber::XiDevice::XiDevice(Grabber *parent, XIDeviceInfo *info) : absolute(false), active(true), proximity_axis(-1), scale_x(1.0), scale_y(1.0), num_buttons(0) { + static XAtom PROXIMITY(AXIS_LABEL_PROP_ABS_DISTANCE); + dev = info->deviceid; + name = info->name; +@@ -398,7 +398,7 @@ Grabber::XiDevice::XiDevice(Grabber *par + + Grabber::XiDevice *Grabber::get_xi_dev(int id) { + DeviceMap::iterator i = xi_devs.find(id); +- return i == xi_devs.end() ? NULL : i->second.get(); ++ return i == xi_devs.end() ? nullptr : i->second.get(); + } + + void Grabber::XiDevice::grab_button(ButtonInfo &bi, bool grab) { +diff -up easystroke-0.6.0/grabber.h.c11 easystroke-0.6.0/grabber.h +--- easystroke-0.6.0/grabber.h.c11 2013-03-27 11:52:38.000000000 -0400 ++++ easystroke-0.6.0/grabber.h 2019-10-18 14:46:33.216827179 -0400 +@@ -123,7 +123,7 @@ public: + class GrabFailedException : public std::exception { + char *msg; + public: +- GrabFailedException(int code) { if (asprintf(&msg, "Grab Failed: %d", code) == -1) msg = NULL; } ++ GrabFailedException(int code) { if (asprintf(&msg, "Grab Failed: %d", code) == -1) msg = nullptr; } + virtual const char* what() const throw() { return msg ? msg : "Grab Failed"; } + ~GrabFailedException() throw() { free(msg); } + }; +diff -up easystroke-0.6.0/handler.cc.c11 easystroke-0.6.0/handler.cc +--- easystroke-0.6.0/handler.cc.c11 2019-10-18 14:46:33.214827222 -0400 ++++ easystroke-0.6.0/handler.cc 2019-10-18 14:46:33.217827158 -0400 +@@ -26,7 +26,7 @@ + #include // std::abs(float) + using std::abs; + +-XState *xstate = NULL; ++XState *xstate = nullptr; + + extern Window get_app_window(Window w); + extern Source current_app_window; +@@ -145,7 +145,7 @@ Window XState::get_window(Window w, Atom + Atom actual_type; + int actual_format; + unsigned long nitems, bytes_after; +- unsigned char *prop_return = NULL; ++ unsigned char *prop_return = nullptr; + + if (XGetWindowProperty(dpy, w, prop, 0, sizeof(Atom), False, XA_WINDOW, &actual_type, &actual_format, + &nitems, &bytes_after, &prop_return) != Success) +@@ -161,7 +161,7 @@ Atom XState::get_atom(Window w, Atom pro + Atom actual_type; + int actual_format; + unsigned long nitems, bytes_after; +- unsigned char *prop_return = NULL; ++ unsigned char *prop_return = nullptr; + + if (XGetWindowProperty(dpy, w, prop, 0, sizeof(Atom), False, XA_ATOM, &actual_type, &actual_format, + &nitems, &bytes_after, &prop_return) != Success) +@@ -177,7 +177,7 @@ bool XState::has_atom(Window w, Atom pro + Atom actual_type; + int actual_format; + unsigned long nitems, bytes_after; +- unsigned char *prop_return = NULL; ++ unsigned char *prop_return = nullptr; + + if (XGetWindowProperty(dpy, w, prop, 0, sizeof(Atom), False, XA_ATOM, &actual_type, &actual_format, + &nitems, &bytes_after, &prop_return) != Success) +@@ -406,7 +406,7 @@ public: + if (xstate->current_dev->master) + XTestFakeMotionEvent(dpy, DefaultScreen(dpy), e->x, e->y, 0); + if (proximity && !xstate->in_proximity) +- parent->replace_child(NULL); ++ parent->replace_child(nullptr); + } + virtual void release(guint b, RTriple e) { + if (xstate->current_dev->master) { +@@ -414,7 +414,7 @@ public: + XTestFakeButtonEvent(dpy, b, false, CurrentTime); + } + if (proximity ? !xstate->in_proximity : !xstate->xinput_pressed.size()) +- parent->replace_child(NULL); ++ parent->replace_child(nullptr); + } + virtual std::string name() { return "Ignore"; } + virtual Grabber::State grab_mode() { return Grabber::NONE; } +@@ -445,7 +445,7 @@ public: + if (xstate->current_dev->master) + XTestFakeMotionEvent(dpy, DefaultScreen(dpy), e->x, e->y, 0); + if (proximity && !xstate->in_proximity) +- parent->replace_child(NULL); ++ parent->replace_child(nullptr); + } + virtual void release(guint b, RTriple e) { + if (xstate->current_dev->master) { +@@ -455,14 +455,14 @@ public: + XTestFakeButtonEvent(dpy, b, false, CurrentTime); + } + if (proximity ? !xstate->in_proximity : !xstate->xinput_pressed.size()) +- parent->replace_child(NULL); ++ parent->replace_child(nullptr); + } + virtual std::string name() { return "Button"; } + virtual Grabber::State grab_mode() { return Grabber::NONE; } + }; + + void XState::bail_out() { +- handler->replace_child(NULL); ++ handler->replace_child(nullptr); + xinput_pressed.clear(); + XFlush(dpy); + } +@@ -515,7 +515,7 @@ void XState::ping() { + + void XState::remove_device(int deviceid) { + if (current_dev && current_dev->dev == deviceid) +- current_dev = NULL; ++ current_dev = nullptr; + } + + void XState::ungrab(int deviceid) { +@@ -530,7 +530,7 @@ public: + printf("Warning: %s timed out\n", "WaitForPongHandler"); + xstate->bail_out(); + } +- virtual void pong() { parent->replace_child(NULL); } ++ virtual void pong() { parent->replace_child(nullptr); } + virtual std::string name() { return "WaitForPong"; } + virtual Grabber::State grab_mode() { return parent->grab_mode(); } + }; +@@ -544,7 +544,7 @@ class AbstractScrollHandler : public Han + int orig_x, orig_y; + + protected: +- AbstractScrollHandler() : last_t(0), offset_x(0.0), offset_y(0.0) { ++ AbstractScrollHandler() : have_x(false), have_y(false), last_x(0.0), last_y(0.0), last_t(0), offset_x(0.0), offset_y(0.0) { + if (!prefs.move_back.get() || (xstate->current_dev && xstate->current_dev->absolute)) + return; + Window dummy1, dummy2; +@@ -633,7 +633,7 @@ public: + } + virtual void raw_motion(RTriple e, bool abs_x, bool abs_y) { + if (proximity && !xstate->in_proximity) { +- parent->replace_child(NULL); ++ parent->replace_child(nullptr); + move_back(); + } + if (xstate->xinput_pressed.size()) +@@ -663,13 +663,13 @@ public: + } + virtual void release(guint b, RTriple e) { + Handler *p = parent; +- p->replace_child(NULL); ++ p->replace_child(nullptr); + p->release(b, e); + move_back(); + } + virtual void press(guint b, RTriple e) { + Handler *p = parent; +- p->replace_child(NULL); ++ p->replace_child(nullptr); + p->press(b, e); + move_back(); + } +@@ -691,7 +691,7 @@ public: + if (stroke_action) + (*stroke_action)(s); + if (xstate->xinput_pressed.size() == 0) +- parent->replace_child(NULL); ++ parent->replace_child(nullptr); + } + virtual std::string name() { return "InstantStrokeAction"; } + virtual Grabber::State grab_mode() { return Grabber::NONE; } +@@ -821,7 +821,7 @@ public: + mods.clear(); + xstate->fake_click(b); + } +- return parent->replace_child(NULL); ++ return parent->replace_child(nullptr); + } + replay_button = 0; + mods.erase((b == button1) ? button2 : b); +@@ -975,7 +975,7 @@ protected: + + if (stroke_action) { + (*stroke_action)(s); +- return parent->replace_child(NULL); ++ return parent->replace_child(nullptr); + } + RRanking ranking; + RAction act = actions.get_action_list(grabber->current_class->get())->handle(s, ranking); +@@ -983,7 +983,7 @@ protected: + Ranking::queue_show(ranking, e); + if (!act) { + XkbBell(dpy, None, 0, None); +- return parent->replace_child(NULL); ++ return parent->replace_child(nullptr); + } + RModifiers mods = act->prepare(); + if (IS_CLICK(act)) +@@ -1008,7 +1008,7 @@ protected: + unsetenv("EASYSTROKE_Y1"); + unsetenv("EASYSTROKE_X2"); + unsetenv("EASYSTROKE_Y2"); +- parent->replace_child(NULL); ++ parent->replace_child(nullptr); + } + public: + StrokeHandler(guint b, RTriple e) : +@@ -1098,7 +1098,7 @@ std::string XState::select_window() { + return grabber->current_class->get(); + } + +-XState::XState() : current_dev(NULL), in_proximity(false), accepted(true) { ++XState::XState() : current_dev(nullptr), in_proximity(false), accepted(true), modifiers(0) { + int n, opcode, event, error; + char **ext = XListExtensions(dpy, &n); + for (int i = 0; i < n; i++) +diff -up easystroke-0.6.0/handler.h.c11 easystroke-0.6.0/handler.h +--- easystroke-0.6.0/handler.h.c11 2013-03-27 11:52:38.000000000 -0400 ++++ easystroke-0.6.0/handler.h 2019-10-18 14:46:33.217827158 -0400 +@@ -59,7 +59,7 @@ public: + bool accepted; + std::set xinput_pressed; + guint modifiers; +- std::map core_inv_map; ++ std::map core_inv_map; + private: + Window ping_window; + Handler *handler; +@@ -76,7 +76,7 @@ class Handler { + public: + Handler *child; + Handler *parent; +- Handler() : child(NULL), parent(NULL) {} ++ Handler() : child(nullptr), parent(nullptr) {} + Handler *top() { + if (child) + return child->top(); +diff -up easystroke-0.6.0/main.cc.c11 easystroke-0.6.0/main.cc +--- easystroke-0.6.0/main.cc.c11 2019-10-18 14:46:33.213827243 -0400 ++++ easystroke-0.6.0/main.cc 2019-10-18 14:46:33.217827158 -0400 +@@ -42,11 +42,11 @@ extern Source disabled; + + bool experimental = false; + int verbosity = 0; +-const char *prefs_versions[] = { "-0.5.5", "-0.4.1", "-0.4.0", "", NULL }; +-const char *actions_versions[] = { "-0.5.6", "-0.4.1", "-0.4.0", "", NULL }; ++const char *prefs_versions[] = { "-0.5.5", "-0.4.1", "-0.4.0", "", nullptr }; ++const char *actions_versions[] = { "-0.5.6", "-0.4.1", "-0.4.0", "", nullptr }; + Source current_app_window(None); + std::string config_dir; +-Win *win = NULL; ++Win *win = nullptr; + Display *dpy; + Window ROOT; + +@@ -172,7 +172,7 @@ void sig_int(int) { + class App : public Gtk::Application, Base { + public: + App(int& argc, char**& argv, const Glib::ustring& application_id, Gio::ApplicationFlags flags=Gio::APPLICATION_FLAGS_NONE) : +- Gtk::Application(argc, argv, application_id, flags), remote(false) {} ++ Gtk::Application(argc, argv, application_id, flags), remote(false), enabled(nullptr) {} + ~App(); + + static void usage(const char *me); +@@ -380,7 +380,7 @@ void App::on_activate() { + signal(SIGINT, &sig_int); + signal(SIGCHLD, SIG_IGN); + +- dpy = XOpenDisplay(NULL); ++ dpy = XOpenDisplay(nullptr); + if (!dpy) { + printf(_("Couldn't open display.\n")); + exit(EXIT_FAILURE); +@@ -400,7 +400,7 @@ void App::on_activate() { + + trace.reset(init_trace()); + Glib::RefPtr screen = Gdk::Display::get_default()->get_default_screen(); +- g_signal_connect(screen->gobj(), "composited-changed", &schedule_reload_trace, NULL); ++ g_signal_connect(screen->gobj(), "composited-changed", &schedule_reload_trace, nullptr); + screen->signal_size_changed().connect(sigc::ptr_fun(&schedule_reload_trace)); + Notifier *trace_notify = new Notifier(sigc::ptr_fun(&schedule_reload_trace)); + prefs.trace.connect(trace_notify); +@@ -462,7 +462,7 @@ void App::create_config_dir() { + config_dir += "/.easystroke"; + } + struct stat st; +- char *name = realpath(config_dir.c_str(), NULL); ++ char *name = realpath(config_dir.c_str(), nullptr); + + // check if the directory does not exist + if (lstat(name, &st) == -1) { +@@ -633,7 +633,7 @@ class Modifiers : Timeout { + Glib::ustring str; + OSD *osd; + public: +- Modifiers(guint mods_, Glib::ustring str_) : mods(mods_), str(str_), osd(NULL) { ++ Modifiers(guint mods_, Glib::ustring str_) : mods(mods_), str(str_), osd(nullptr) { + if (prefs.show_osd.get()) + set_timeout(150); + all.insert(this); +diff -up easystroke-0.6.0/prefs.cc.c11 easystroke-0.6.0/prefs.cc +--- easystroke-0.6.0/prefs.cc.c11 2013-03-27 11:52:38.000000000 -0400 ++++ easystroke-0.6.0/prefs.cc 2019-10-18 14:46:33.217827158 -0400 +@@ -299,9 +299,9 @@ Prefs::Prefs() { + + CellRendererTextish *button_renderer = cell_renderer_textish_new (); + button_renderer->mode = CELL_RENDERER_TEXTISH_MODE_Popup; +- GtkTreeViewColumn *col_button = gtk_tree_view_column_new_with_attributes(_("Button"), GTK_CELL_RENDERER (button_renderer), "text", cols.button.index(), NULL); ++ GtkTreeViewColumn *col_button = gtk_tree_view_column_new_with_attributes(_("Button"), GTK_CELL_RENDERER (button_renderer), "text", cols.button.index(), nullptr); + gtk_tree_view_append_column(tv->gobj(), col_button); +- g_object_set(button_renderer, "editable", true, NULL); ++ g_object_set(button_renderer, "editable", true, nullptr); + g_signal_connect(button_renderer, "editing-started", G_CALLBACK(on_prefs_editing_started), this); + + bbutton->signal_clicked().connect(sigc::mem_fun(*this, &Prefs::on_select_button)); +diff -up easystroke-0.6.0/shape.cc.c11 easystroke-0.6.0/shape.cc +--- easystroke-0.6.0/shape.cc.c11 2013-03-27 11:52:38.000000000 -0400 ++++ easystroke-0.6.0/shape.cc 2019-10-18 14:46:33.217827158 -0400 +@@ -73,7 +73,7 @@ void Shape::timeout() { + } + + void Shape::clear() { +- XShapeCombineRectangles(dpy, win, ShapeBounding, 0, 0, NULL, 0, ShapeSet, YXBanded); ++ XShapeCombineRectangles(dpy, win, ShapeBounding, 0, 0, nullptr, 0, ShapeSet, YXBanded); + } + + Shape::~Shape() { +diff -up easystroke-0.6.0/stats.cc.c11 easystroke-0.6.0/stats.cc +--- easystroke-0.6.0/stats.cc.c11 2013-03-27 11:52:38.000000000 -0400 ++++ easystroke-0.6.0/stats.cc 2019-10-18 14:46:33.217827158 -0400 +@@ -280,7 +280,7 @@ void Stats::on_pdf() { + printf("creating table took %ld us\n", (tv2.tv_sec - tv1.tv_sec)*1000000 + tv2.tv_usec - tv1.tv_usec); + } + if (!fork()) { +- execlp("xdg-open", "xdg-open", "/tmp/strokes.pdf", NULL); ++ execlp("xdg-open", "xdg-open", "/tmp/strokes.pdf", nullptr); + exit(EXIT_FAILURE); + } + } +diff -up easystroke-0.6.0/util.h.c11 easystroke-0.6.0/util.h +--- easystroke-0.6.0/util.h.c11 2013-03-27 11:52:38.000000000 -0400 ++++ easystroke-0.6.0/util.h 2019-10-18 14:46:33.218827137 -0400 +@@ -19,11 +19,11 @@ + #include + + class Timeout { +- // Invariant: c == &connection || c == NULL ++ // Invariant: c == &connection || c == nullptr + sigc::connection *c; + sigc::connection connection; + // We have to account for the possibilty that timeout() destroys the object +- bool to() { c = NULL; timeout(); return false; } ++ bool to() { c = nullptr; timeout(); return false; } + public: + Timeout() : c(0) {} + protected: +diff -up easystroke-0.6.0/var.h.c11 easystroke-0.6.0/var.h +--- easystroke-0.6.0/var.h.c11 2013-03-27 11:52:38.000000000 -0400 ++++ easystroke-0.6.0/var.h 2019-10-18 14:46:33.218827137 -0400 +@@ -24,6 +24,7 @@ + class Base { + public: + virtual void notify() = 0; ++ virtual ~Base() {} + }; + + class Notifier : public Base { +@@ -53,11 +54,13 @@ protected: + public: + void connect(Base *s) { out.insert(s); } + virtual T get() const = 0; ++ virtual ~Out() {} + }; + + template class In { + public: + virtual void set(const T x) = 0; ++ virtual ~In() {} + }; + + template class IO : public In, public Out {}; +diff -up easystroke-0.6.0/win.cc.c11 easystroke-0.6.0/win.cc +--- easystroke-0.6.0/win.cc.c11 2019-10-18 14:46:33.210827306 -0400 ++++ easystroke-0.6.0/win.cc 2019-10-18 14:46:33.218827137 -0400 +@@ -220,7 +220,7 @@ void Win::show_hide_icon() { + icon->signal_activate().connect(sigc::mem_fun(*this, &Win::show_hide)); + icon->signal_popup_menu().connect(sigc::mem_fun(*this, &Win::show_popup)); + if (gtk_major_version > 2 || (gtk_major_version == 2 && gtk_minor_version >= 15)) +- g_signal_connect(icon->gobj(), "button-release-event", G_CALLBACK(icon_clicked), NULL); ++ g_signal_connect(icon->gobj(), "button-release-event", G_CALLBACK(icon_clicked), nullptr); + } else { + if (icon) + icon.reset(); diff --git a/easystroke-0.6.0-dont-ignore-xshape-when-saving.patch b/easystroke-0.6.0-dont-ignore-xshape-when-saving.patch new file mode 100644 index 0000000..9c43e57 --- /dev/null +++ b/easystroke-0.6.0-dont-ignore-xshape-when-saving.patch @@ -0,0 +1,12 @@ +diff -up easystroke-0.6.0/prefdb.cc.dont-ignore-xshape-when-saving easystroke-0.6.0/prefdb.cc +--- easystroke-0.6.0/prefdb.cc.dont-ignore-xshape-when-saving 2019-10-18 15:02:18.636029441 -0400 ++++ easystroke-0.6.0/prefdb.cc 2019-10-18 15:02:53.074301963 -0400 +@@ -72,8 +72,6 @@ template void PrefDB::ser + ar & help; + } + ar & trace.unsafe_ref(); +- if (trace.get() == TraceShape) +- trace.unsafe_ref() = TraceDefault; + if (version < 3) { + int delay; + ar & delay; diff --git a/easystroke-0.6.0-duplicate-actions.patch b/easystroke-0.6.0-duplicate-actions.patch new file mode 100644 index 0000000..c979abc --- /dev/null +++ b/easystroke-0.6.0-duplicate-actions.patch @@ -0,0 +1,129 @@ +diff -up easystroke-0.6.0/actions.cc.duplicate easystroke-0.6.0/actions.cc +--- easystroke-0.6.0/actions.cc.duplicate 2019-10-18 15:08:04.421676670 -0400 ++++ easystroke-0.6.0/actions.cc 2019-10-18 15:09:32.488770556 -0400 +@@ -131,6 +131,7 @@ Actions::Actions() : + Gtk::Button *button_add, *button_add_app, *button_add_group; + widgets->get_widget("button_add_action", button_add); + widgets->get_widget("button_delete_action", button_delete); ++ widgets->get_widget("button_dup_action", button_dup); + widgets->get_widget("button_record", button_record); + widgets->get_widget("button_add_app", button_add_app); + widgets->get_widget("button_add_group", button_add_group); +@@ -141,6 +142,7 @@ Actions::Actions() : + widgets->get_widget("vpaned_apps", vpaned_apps); + button_record->signal_clicked().connect(sigc::mem_fun(*this, &Actions::on_button_record)); + button_delete->signal_clicked().connect(sigc::mem_fun(*this, &Actions::on_button_delete)); ++ button_dup->signal_clicked().connect(sigc::mem_fun(*this, &Actions::on_button_dup)); + button_add->signal_clicked().connect(sigc::mem_fun(*this, &Actions::on_button_new)); + button_add_app->signal_clicked().connect(sigc::mem_fun(*this, &Actions::on_add_app)); + button_add_group->signal_clicked().connect(sigc::mem_fun(*this, &Actions::on_add_group)); +@@ -511,6 +513,40 @@ void Actions::on_button_delete() { + update_counts(); + } + ++void Actions::on_button_dup() { ++ editing_new = true; ++ Unique *before = 0; ++ Glib::ustring name; ++ if (tv.get_selection()->count_selected_rows()) { ++ std::vector paths = tv.get_selection()->get_selected_rows(); ++ Gtk::TreeIter i = tm->get_iter(paths[paths.size()-1]); ++ //i++; ++ //if (i != tm->children().end()) ++ before = (*i)[cols.id]; ++ name = (*i)[cols.name]; ++ } ++ ++ RStrokeInfo src = action_list->get_info(before); ++ ++ Gtk::TreeModel::Row row = *(tm->append()); ++ StrokeInfo si; ++ si.action = src->action; ++ si.strokes = src->strokes; ++ Unique *id = action_list->add(si); ++ row[cols.id] = id; ++ action_list->set_name(id,name); ++ //std::string name; ++ /*if (action_list != actions.get_root()) ++ name = action_list->name + " "; ++ name += Glib::ustring::compose(_("Gesture %1"), action_list->order_size()); ++ action_list->set_name(id, name);*/ ++ ++ update_row(row); ++ focus(id, 1, true); ++ update_actions(); ++ update_counts(); ++} ++ + void Actions::on_cell_data_apps(Gtk::CellRenderer* cell, const Gtk::TreeModel::iterator& iter) { + ActionListDiff *as = (*iter)[ca.actions]; + Gtk::CellRendererText *renderer = dynamic_cast(cell); +@@ -789,6 +825,7 @@ void Actions::on_selection_changed() { + int n = tv.get_selection()->count_selected_rows(); + button_record->set_sensitive(n == 1); + button_delete->set_sensitive(n >= 1); ++ button_dup->set_sensitive(n >= 1); + bool resettable = false; + if (n) { + std::vector paths = tv.get_selection()->get_selected_rows(); +diff -up easystroke-0.6.0/actions.h.duplicate easystroke-0.6.0/actions.h +--- easystroke-0.6.0/actions.h.duplicate 2019-10-18 15:09:45.161496325 -0400 ++++ easystroke-0.6.0/actions.h 2019-10-18 15:10:18.465790648 -0400 +@@ -36,6 +36,7 @@ class Actions { + public: + Actions(); + private: ++ void on_button_dup(); + void on_button_delete(); + void on_button_new(); + void on_button_record(); +@@ -138,7 +139,7 @@ private: + + Glib::RefPtr type_store; + +- Gtk::Button *button_record, *button_delete, *button_remove_app, *button_reset_actions; ++ Gtk::Button *button_record, *button_delete, *button_remove_app, *button_reset_actions, *button_dup; + Gtk::CheckButton *check_show_deleted; + Gtk::Expander *expander_apps; + Gtk::VPaned *vpaned_apps; +diff -up easystroke-0.6.0/gui.glade.duplicate easystroke-0.6.0/gui.glade +--- easystroke-0.6.0/gui.glade.duplicate 2019-10-18 15:10:29.107565163 -0400 ++++ easystroke-0.6.0/gui.glade 2019-10-18 15:11:17.402542478 -0400 +@@ -816,6 +816,24 @@ Van Diep Duong (Vietnamese) + + + ++ ++ _Duplicate Action(s) ++ False ++ True ++ True ++ True ++ GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK ++ False ++ image4 ++ True ++ ++ ++ False ++ False ++ 4 ++ ++ ++ + + _Hide + False +diff -up easystroke-0.6.0/po/zh_CN.po.duplicate easystroke-0.6.0/po/zh_CN.po +--- easystroke-0.6.0/po/zh_CN.po.duplicate 2019-10-18 15:11:34.192187095 -0400 ++++ easystroke-0.6.0/po/zh_CN.po 2019-10-18 15:11:58.286677111 -0400 +@@ -341,6 +341,9 @@ msgstr "添加动作" + msgid "_Delete Action(s)" + msgstr "删除动作" + ++msgid "_Duplicate Action(s)" ++msgstr "复制动作" ++ + msgid "_Hide" + msgstr "隐藏(_H)" + diff --git a/easystroke-0.6.0-fix-deprecated.patch b/easystroke-0.6.0-fix-deprecated.patch new file mode 100644 index 0000000..1465459 --- /dev/null +++ b/easystroke-0.6.0-fix-deprecated.patch @@ -0,0 +1,20 @@ +diff -up easystroke-0.6.0/actions.cc.fixdeprecated easystroke-0.6.0/actions.cc +--- easystroke-0.6.0/actions.cc.fixdeprecated 2019-10-18 13:45:25.824696185 -0400 ++++ easystroke-0.6.0/actions.cc 2019-10-18 13:46:40.247139173 -0400 +@@ -23,6 +23,7 @@ + #include "grabber.h" + #include "cellrenderertextish.h" + ++#include + #include + + bool TreeViewMulti::on_button_press_event(GdkEventButton* event) { +@@ -52,7 +53,7 @@ void TreeViewMulti::on_drag_begin(const + } + + TreeViewMulti::TreeViewMulti() : Gtk::TreeView(), pending(false) { +- get_selection()->set_select_function([this](Glib::RefPtr const&, Gtk::TreeModel::Path const&, bool) { ++ get_selection()->set_select_function([this](const Glib::RefPtr&, const Gtk::TreePath&, const bool&) { return !this->pending; }); + return !pending; + }); + } diff --git a/easystroke-0.6.0-fix-no-select-crash.patch b/easystroke-0.6.0-fix-no-select-crash.patch new file mode 100644 index 0000000..c5d6f56 --- /dev/null +++ b/easystroke-0.6.0-fix-no-select-crash.patch @@ -0,0 +1,21 @@ +diff -up easystroke-0.6.0/prefs.cc.fix-no-select-crash easystroke-0.6.0/prefs.cc +--- easystroke-0.6.0/prefs.cc.fix-no-select-crash 2019-10-18 14:44:45.866097719 -0400 ++++ easystroke-0.6.0/prefs.cc 2019-10-18 14:45:20.057369624 -0400 +@@ -426,6 +426,8 @@ void Prefs::on_edit_extra() { + etv->get_cursor(path, col); + if (!path.gobj()) + return; ++ if (path.empty()) ++ return; + Gtk::TreeIter iter = *etm->get_iter(path); + std::vector::iterator i = (*iter)[ecs.i]; + SelectButton sb(*i, true, true); +@@ -448,6 +450,8 @@ void Prefs::on_remove_extra() { + etv->get_cursor(path, col); + if (!path.gobj()) + return; ++ if (path.empty()) ++ return; + Gtk::TreeIter iter = *etm->get_iter(path); + Atomic a; + std::vector::iterator i = (*iter)[ecs.i]; diff --git a/easystroke-0.6.0-g_spawn_async.patch b/easystroke-0.6.0-g_spawn_async.patch new file mode 100644 index 0000000..a2071ea --- /dev/null +++ b/easystroke-0.6.0-g_spawn_async.patch @@ -0,0 +1,21 @@ +diff -up easystroke-0.6.0/actiondb.cc.gspawnasync easystroke-0.6.0/actiondb.cc +--- easystroke-0.6.0/actiondb.cc.gspawnasync 2019-10-18 14:49:14.782420849 -0400 ++++ easystroke-0.6.0/actiondb.cc 2019-10-18 14:50:42.034827066 -0400 +@@ -119,14 +119,9 @@ template void StrokeInfo: + using namespace std; + + void Command::run() { +- pid_t pid = fork(); +- switch (pid) { +- case 0: +- execlp("/bin/sh", "sh", "-c", cmd.c_str(), nullptr); +- exit(1); +- case -1: +- printf(_("Error: can't execute command \"%s\": fork() failed\n"), cmd.c_str()); +- } ++ gchar* argv[] = {(gchar*) "/bin/sh", (gchar*) "-c", nullptr, nullptr}; ++ argv[2] = (gchar *) cmd.c_str(); ++ g_spawn_async(nullptr, argv, nullptr, G_SPAWN_SEARCH_PATH, nullptr, nullptr, nullptr, nullptr); + } + + ButtonInfo Button::get_button_info() const { diff --git a/easystroke-0.6.0-iconfix.patch b/easystroke-0.6.0-iconfix.patch new file mode 100644 index 0000000..5b04565 --- /dev/null +++ b/easystroke-0.6.0-iconfix.patch @@ -0,0 +1,12 @@ +diff -up easystroke-0.6.0/win.cc.iconfix easystroke-0.6.0/win.cc +--- easystroke-0.6.0/win.cc.iconfix 2019-10-18 13:52:30.260730455 -0400 ++++ easystroke-0.6.0/win.cc 2019-10-18 13:52:48.708344899 -0400 +@@ -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); diff --git a/easystroke-0.6.0-missingcase.patch b/easystroke-0.6.0-missingcase.patch new file mode 100644 index 0000000..df41550 --- /dev/null +++ b/easystroke-0.6.0-missingcase.patch @@ -0,0 +1,11 @@ +diff -up easystroke-0.6.0/main.cc.missingcase easystroke-0.6.0/main.cc +--- easystroke-0.6.0/main.cc.missingcase 2019-10-18 15:06:08.592171916 -0400 ++++ easystroke-0.6.0/main.cc 2019-10-18 15:06:31.957677940 -0400 +@@ -70,6 +70,7 @@ static Trace *init_trace() { + case TraceNone: + return new Trivial(); + case TraceShape: ++ case TraceDefault: + return new Shape(); + case TraceAnnotate: + return new Annotate(); diff --git a/easystroke-0.6.0-no-absolutes.patch b/easystroke-0.6.0-no-absolutes.patch new file mode 100644 index 0000000..faf4f64 --- /dev/null +++ b/easystroke-0.6.0-no-absolutes.patch @@ -0,0 +1,21 @@ +diff -up easystroke-0.6.0/handler.cc.no-absolutes easystroke-0.6.0/handler.cc +--- easystroke-0.6.0/handler.cc.no-absolutes 2019-10-18 14:54:23.167116944 -0400 ++++ easystroke-0.6.0/handler.cc 2019-10-18 14:54:49.671536045 -0400 +@@ -563,7 +563,7 @@ protected: + } + 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); + } +@@ -968,7 +968,7 @@ protected: + 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); diff --git a/easystroke-0.6.0-privatefix.patch b/easystroke-0.6.0-privatefix.patch new file mode 100644 index 0000000..c9c789d --- /dev/null +++ b/easystroke-0.6.0-privatefix.patch @@ -0,0 +1,224 @@ +diff -up easystroke-0.6.0/cellrenderertextish.c.privatefix easystroke-0.6.0/cellrenderertextish.c +--- easystroke-0.6.0/cellrenderertextish.c.privatefix 2013-03-27 11:52:38.000000000 -0400 ++++ easystroke-0.6.0/cellrenderertextish.c 2019-10-18 16:28:14.234822157 -0400 +@@ -135,20 +135,18 @@ struct _Block1Data { + gchar* path; + }; + +- +-static gpointer cell_renderer_textish_parent_class = NULL; +-static gpointer cell_editable_dummy_parent_class = NULL; +-static GtkCellEditableIface* cell_editable_dummy_gtk_cell_editable_parent_iface = NULL; +-static gpointer cell_editable_accel_parent_class = NULL; + static GtkCellEditableIface* cell_editable_accel_gtk_cell_editable_parent_iface = NULL; +-static gpointer cell_editable_combo_parent_class = NULL; + +-GType cell_renderer_textish_get_type (void) G_GNUC_CONST; + GType cell_renderer_textish_mode_get_type (void) G_GNUC_CONST; +-#define CELL_RENDERER_TEXTISH_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), TYPE_CELL_RENDERER_TEXTISH, CellRendererTextishPrivate)) + enum { + CELL_RENDERER_TEXTISH_DUMMY_PROPERTY + }; ++ ++G_DEFINE_TYPE_WITH_PRIVATE (CellRendererTextish, cell_renderer_textish, G_TYPE_OBJECT); ++G_DEFINE_TYPE_WITH_PRIVATE (CellEditableAccel, cell_editable_accel, G_TYPE_OBJECT); ++G_DEFINE_TYPE_WITH_PRIVATE (CellEditableDummy, cell_editable_dummy, G_TYPE_OBJECT); ++G_DEFINE_TYPE_WITH_PRIVATE (CellEditableCombo, cell_editable_combo, G_TYPE_OBJECT); ++ + CellRendererTextish* cell_renderer_textish_new (void); + CellRendererTextish* cell_renderer_textish_construct (GType object_type); + CellRendererTextish* cell_renderer_textish_new_with_items (gchar** items, int items_length1); +@@ -157,17 +155,14 @@ static gchar** _vala_array_dup1 (gchar** + static GtkCellEditable* cell_renderer_textish_real_start_editing (GtkCellRenderer* base, GdkEvent* event, GtkWidget* widget, const gchar* path, GdkRectangle* background_area, GdkRectangle* cell_area, GtkCellRendererState flags); + CellEditableAccel* cell_editable_accel_new (CellRendererTextish* parent, const gchar* path, GtkWidget* widget); + CellEditableAccel* cell_editable_accel_construct (GType object_type, CellRendererTextish* parent, const gchar* path, GtkWidget* widget); +-GType cell_editable_accel_get_type (void) G_GNUC_CONST; + CellEditableCombo* cell_editable_combo_new (CellRendererTextish* parent, const gchar* path, GtkWidget* widget, gchar** items, int items_length1); + CellEditableCombo* cell_editable_combo_construct (GType object_type, CellRendererTextish* parent, const gchar* path, GtkWidget* widget, gchar** items, int items_length1); +-GType cell_editable_combo_get_type (void) G_GNUC_CONST; + CellEditableDummy* cell_editable_dummy_new (void); + CellEditableDummy* cell_editable_dummy_construct (GType object_type); +-GType cell_editable_dummy_get_type (void) G_GNUC_CONST; + static void g_cclosure_user_marshal_VOID__STRING_FLAGS_UINT (GClosure * closure, GValue * return_value, guint n_param_values, const GValue * param_values, gpointer invocation_hint, gpointer marshal_data); + static void g_cclosure_user_marshal_VOID__STRING_UINT (GClosure * closure, GValue * return_value, guint n_param_values, const GValue * param_values, gpointer invocation_hint, gpointer marshal_data); + static void cell_renderer_textish_finalize (GObject* obj); +-#define CELL_EDITABLE_DUMMY_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), TYPE_CELL_EDITABLE_DUMMY, CellEditableDummyPrivate)) ++ + enum { + CELL_EDITABLE_DUMMY_DUMMY_PROPERTY, + CELL_EDITABLE_DUMMY_EDITING_CANCELED +@@ -179,7 +174,6 @@ void cell_editable_dummy_set_editing_can + static void cell_editable_dummy_finalize (GObject* obj); + static void _vala_cell_editable_dummy_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec); + static void _vala_cell_editable_dummy_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec); +-#define CELL_EDITABLE_ACCEL_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), TYPE_CELL_EDITABLE_ACCEL, CellEditableAccelPrivate)) + enum { + CELL_EDITABLE_ACCEL_DUMMY_PROPERTY, + CELL_EDITABLE_ACCEL_EDITING_CANCELED +@@ -195,7 +189,6 @@ void cell_editable_accel_set_editing_can + static void cell_editable_accel_finalize (GObject* obj); + static void _vala_cell_editable_accel_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec); + static void _vala_cell_editable_accel_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec); +-#define CELL_EDITABLE_COMBO_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), TYPE_CELL_EDITABLE_COMBO, CellEditableComboPrivate)) + enum { + CELL_EDITABLE_COMBO_DUMMY_PROPERTY + }; +@@ -232,7 +225,6 @@ CellRendererTextish* cell_renderer_texti + return self; + } + +- + CellRendererTextish* cell_renderer_textish_new (void) { + return cell_renderer_textish_construct (TYPE_CELL_RENDERER_TEXTISH); + } +@@ -418,7 +410,6 @@ static void g_cclosure_user_marshal_VOID + + static void cell_renderer_textish_class_init (CellRendererTextishClass * klass) { + cell_renderer_textish_parent_class = g_type_class_peek_parent (klass); +- g_type_class_add_private (klass, sizeof (CellRendererTextishPrivate)); + GTK_CELL_RENDERER_CLASS (klass)->start_editing = cell_renderer_textish_real_start_editing; + G_OBJECT_CLASS (klass)->finalize = cell_renderer_textish_finalize; + g_signal_new ("key_edited", TYPE_CELL_RENDERER_TEXTISH, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_user_marshal_VOID__STRING_FLAGS_UINT, G_TYPE_NONE, 3, G_TYPE_STRING, gdk_modifier_type_get_type (), G_TYPE_UINT); +@@ -426,8 +417,8 @@ static void cell_renderer_textish_class_ + } + + +-static void cell_renderer_textish_instance_init (CellRendererTextish * self) { +- self->priv = CELL_RENDERER_TEXTISH_GET_PRIVATE (self); ++static void cell_renderer_textish_init (CellRendererTextish * self) { ++ self->priv = cell_renderer_textish_get_instance_private (self); + } + + +@@ -439,7 +430,7 @@ static void cell_renderer_textish_finali + G_OBJECT_CLASS (cell_renderer_textish_parent_class)->finalize (obj); + } + +- ++/* + GType cell_renderer_textish_get_type (void) { + static volatile gsize cell_renderer_textish_type_id__volatile = 0; + if (g_once_init_enter (&cell_renderer_textish_type_id__volatile)) { +@@ -450,7 +441,7 @@ GType cell_renderer_textish_get_type (vo + } + return cell_renderer_textish_type_id__volatile; + } +- ++*/ + + static void cell_editable_dummy_real_start_editing (CellEditableDummy* self, GdkEvent* event) { + gtk_cell_editable_editing_done ((GtkCellEditable*) self); +@@ -497,7 +488,6 @@ void cell_editable_dummy_set_editing_can + + static void cell_editable_dummy_class_init (CellEditableDummyClass * klass) { + cell_editable_dummy_parent_class = g_type_class_peek_parent (klass); +- g_type_class_add_private (klass, sizeof (CellEditableDummyPrivate)); + CELL_EDITABLE_DUMMY_CLASS (klass)->start_editing = cell_editable_dummy_real_start_editing; + G_OBJECT_CLASS (klass)->get_property = _vala_cell_editable_dummy_get_property; + G_OBJECT_CLASS (klass)->set_property = _vala_cell_editable_dummy_set_property; +@@ -505,15 +495,8 @@ static void cell_editable_dummy_class_in + g_object_class_install_property (G_OBJECT_CLASS (klass), CELL_EDITABLE_DUMMY_EDITING_CANCELED, g_param_spec_boolean ("editing-canceled", "editing-canceled", "editing-canceled", FALSE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE | G_PARAM_WRITABLE)); + } + +- +-static void cell_editable_dummy_gtk_cell_editable_interface_init (GtkCellEditableIface * iface) { +- cell_editable_dummy_gtk_cell_editable_parent_iface = g_type_interface_peek_parent (iface); +- iface->start_editing = (void (*)(GtkCellEditable*, GdkEvent*)) cell_editable_dummy_start_editing; +-} +- +- +-static void cell_editable_dummy_instance_init (CellEditableDummy * self) { +- self->priv = CELL_EDITABLE_DUMMY_GET_PRIVATE (self); ++static void cell_editable_dummy_init (CellEditableDummy * self) { ++ self->priv = cell_editable_dummy_get_instance_private (self); + } + + +@@ -523,7 +506,7 @@ static void cell_editable_dummy_finalize + G_OBJECT_CLASS (cell_editable_dummy_parent_class)->finalize (obj); + } + +- ++/* + GType cell_editable_dummy_get_type (void) { + static volatile gsize cell_editable_dummy_type_id__volatile = 0; + if (g_once_init_enter (&cell_editable_dummy_type_id__volatile)) { +@@ -536,6 +519,7 @@ GType cell_editable_dummy_get_type (void + } + return cell_editable_dummy_type_id__volatile; + } ++*/ + + + static void _vala_cell_editable_dummy_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec) { +@@ -742,7 +726,6 @@ void cell_editable_accel_set_editing_can + + static void cell_editable_accel_class_init (CellEditableAccelClass * klass) { + cell_editable_accel_parent_class = g_type_class_peek_parent (klass); +- g_type_class_add_private (klass, sizeof (CellEditableAccelPrivate)); + CELL_EDITABLE_ACCEL_CLASS (klass)->start_editing = cell_editable_accel_real_start_editing; + G_OBJECT_CLASS (klass)->get_property = _vala_cell_editable_accel_get_property; + G_OBJECT_CLASS (klass)->set_property = _vala_cell_editable_accel_set_property; +@@ -757,8 +740,8 @@ static void cell_editable_accel_gtk_cell + } + + +-static void cell_editable_accel_instance_init (CellEditableAccel * self) { +- self->priv = CELL_EDITABLE_ACCEL_GET_PRIVATE (self); ++static void cell_editable_accel_init (CellEditableAccel * self) { ++ self->priv = cell_editable_accel_get_instance_private (self); + } + + +@@ -770,7 +753,7 @@ static void cell_editable_accel_finalize + G_OBJECT_CLASS (cell_editable_accel_parent_class)->finalize (obj); + } + +- ++/* + GType cell_editable_accel_get_type (void) { + static volatile gsize cell_editable_accel_type_id__volatile = 0; + if (g_once_init_enter (&cell_editable_accel_type_id__volatile)) { +@@ -783,7 +766,7 @@ GType cell_editable_accel_get_type (void + } + return cell_editable_accel_type_id__volatile; + } +- ++*/ + + static void _vala_cell_editable_accel_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec) { + CellEditableAccel * self; +@@ -927,13 +910,12 @@ CellEditableCombo* cell_editable_combo_n + + static void cell_editable_combo_class_init (CellEditableComboClass * klass) { + cell_editable_combo_parent_class = g_type_class_peek_parent (klass); +- g_type_class_add_private (klass, sizeof (CellEditableComboPrivate)); + G_OBJECT_CLASS (klass)->finalize = cell_editable_combo_finalize; + } + + +-static void cell_editable_combo_instance_init (CellEditableCombo * self) { +- self->priv = CELL_EDITABLE_COMBO_GET_PRIVATE (self); ++static void cell_editable_combo_init (CellEditableCombo * self) { ++ self->priv = cell_editable_combo_get_instance_private (self); + } + + +@@ -945,7 +927,7 @@ static void cell_editable_combo_finalize + G_OBJECT_CLASS (cell_editable_combo_parent_class)->finalize (obj); + } + +- ++/* + GType cell_editable_combo_get_type (void) { + static volatile gsize cell_editable_combo_type_id__volatile = 0; + if (g_once_init_enter (&cell_editable_combo_type_id__volatile)) { +@@ -956,7 +938,7 @@ GType cell_editable_combo_get_type (void + } + return cell_editable_combo_type_id__volatile; + } +- ++*/ + + static void _vala_array_destroy (gpointer array, gint array_length, GDestroyNotify destroy_func) { + if ((array != NULL) && (destroy_func != NULL)) { diff --git a/easystroke-0.6.0-scorefix.patch b/easystroke-0.6.0-scorefix.patch new file mode 100644 index 0000000..9c4edad --- /dev/null +++ b/easystroke-0.6.0-scorefix.patch @@ -0,0 +1,15 @@ +diff -up easystroke-0.6.0/gesture.cc.scorefix easystroke-0.6.0/gesture.cc +--- easystroke-0.6.0/gesture.cc.scorefix 2019-10-18 14:56:23.512506176 -0400 ++++ easystroke-0.6.0/gesture.cc 2019-10-18 14:56:43.932073791 -0400 +@@ -104,9 +104,9 @@ int Stroke::compare(RStroke a, RStroke b + 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 Stroke::draw(int size, double width, bool inv) const { diff --git a/easystroke-0.6.0-sendfix.patch b/easystroke-0.6.0-sendfix.patch new file mode 100644 index 0000000..0a496d3 --- /dev/null +++ b/easystroke-0.6.0-sendfix.patch @@ -0,0 +1,30 @@ +diff -up easystroke-0.6.0/handler.cc.sendfix easystroke-0.6.0/handler.cc +--- easystroke-0.6.0/handler.cc.sendfix 2019-10-18 13:57:53.206976325 -0400 ++++ easystroke-0.6.0/handler.cc 2019-10-18 13:58:59.254594046 -0400 +@@ -545,7 +545,7 @@ class AbstractScrollHandler : public Han + + protected: + AbstractScrollHandler() : last_t(0), offset_x(0.0), offset_y(0.0) { +- if (!prefs.move_back.get() || xstate->current_dev->absolute) ++ if (!prefs.move_back.get() || (xstate->current_dev && xstate->current_dev->absolute)) + return; + Window dummy1, dummy2; + int dummy3, dummy4; +@@ -563,7 +563,7 @@ protected: + } + protected: + void move_back() { +- if (!prefs.move_back.get() || xstate->current_dev->absolute) ++ if (!prefs.move_back.get() || (xstate->current_dev && xstate->current_dev->absolute)) + return; + XTestFakeMotionEvent(dpy, DefaultScreen(dpy), orig_x, orig_y, 0); + } +@@ -1115,6 +1115,8 @@ XState::XState() : current_dev(NULL), in + + void XState::run_action(RAction act) { + RModifiers mods = act->prepare(); ++ IF_BUTTON(act, b) ++ return handler->replace_child(new ButtonHandler(mods, b)); + if (IS_IGNORE(act)) + return handler->replace_child(new IgnoreHandler(mods)); + if (IS_SCROLL(act)) diff --git a/easystroke-0.6.0-signal-handler-fix.patch b/easystroke-0.6.0-signal-handler-fix.patch new file mode 100644 index 0000000..51a5f2f --- /dev/null +++ b/easystroke-0.6.0-signal-handler-fix.patch @@ -0,0 +1,28 @@ +diff -up easystroke-0.6.0/main.cc.signal-handler-fix easystroke-0.6.0/main.cc +--- easystroke-0.6.0/main.cc.signal-handler-fix 2019-10-18 14:00:25.146796452 -0400 ++++ easystroke-0.6.0/main.cc 2019-10-18 14:01:50.034019519 -0400 +@@ -161,7 +161,12 @@ void quit() { + xstate->bail_out(); + dead = true; + win->hide(); +- xstate->queue(sigc::ptr_fun(&Gtk::Main::quit)); ++ Glib::RefPtr app = Gio::Application::get_default(); ++ xstate->queue(sigc::mem_fun(*app.operator->(), &Gio::Application::quit)); ++} ++ ++void sig_int(int) { ++ quit(); + } + + class App : public Gtk::Application, Base { +@@ -371,6 +376,10 @@ void App::on_activate() { + + create_config_dir(); + unsetenv("DESKTOP_AUTOSTART_ID"); ++ ++ signal(SIGINT, &sig_int); ++ signal(SIGCHLD, SIG_IGN); ++ + dpy = XOpenDisplay(NULL); + if (!dpy) { + printf(_("Couldn't open display.\n")); diff --git a/easystroke-0.6.0-toggle.patch b/easystroke-0.6.0-toggle.patch new file mode 100644 index 0000000..296044c --- /dev/null +++ b/easystroke-0.6.0-toggle.patch @@ -0,0 +1,20 @@ +diff -up easystroke-0.6.0/main.cc.toggle easystroke-0.6.0/main.cc +--- easystroke-0.6.0/main.cc.toggle 2019-10-18 14:59:37.517415326 -0400 ++++ easystroke-0.6.0/main.cc 2019-10-18 15:00:55.869769196 -0400 +@@ -320,6 +320,8 @@ int App::on_command_line(const Glib::Ref + disabled.set(true); + } else if (!strcmp(arg[i], "enable")) { + disabled.set(false); ++ } else if (!strcmp(arg[i], "toggle")) { ++ disabled.set(!disabled.get()); + } else if (!strcmp(arg[i], "about")) { + win->show_about(); + } else if (!strcmp(arg[i], "quit")) { +@@ -437,6 +439,7 @@ void App::usage(const char *me) { + printf(" hide Hide configuration window\n"); + printf(" disable Disable easystroke\n"); + printf(" enable Enable easystroke\n"); ++ printf(" toggle Toggle easystroke\n"); + printf(" about Show about dialog\n"); + printf(" quit Quit easystroke\n"); + printf("\n"); diff --git a/easystroke-0.6.0-unused.patch b/easystroke-0.6.0-unused.patch new file mode 100644 index 0000000..1039f94 --- /dev/null +++ b/easystroke-0.6.0-unused.patch @@ -0,0 +1,33 @@ +diff -up easystroke-0.6.0/actions.h.unused easystroke-0.6.0/actions.h +--- easystroke-0.6.0/actions.h.unused 2019-10-18 14:03:10.237334525 -0400 ++++ easystroke-0.6.0/actions.h 2019-10-18 14:03:20.983108769 -0400 +@@ -25,7 +25,6 @@ class ActionListDiff; + class TreeViewMulti : public Gtk::TreeView { + bool pending; + Gtk::TreePath path; +- Gtk::TreeViewColumn *column; + virtual bool on_button_press_event(GdkEventButton* event); + virtual bool on_button_release_event(GdkEventButton* event); + virtual void on_drag_begin(const Glib::RefPtr &context); +diff -up easystroke-0.6.0/handler.cc.unused easystroke-0.6.0/handler.cc +--- easystroke-0.6.0/handler.cc.unused 2019-10-18 14:03:30.927899843 -0400 ++++ easystroke-0.6.0/handler.cc 2019-10-18 14:03:40.967688918 -0400 +@@ -626,7 +626,6 @@ public: + + class ScrollHandler : public AbstractScrollHandler { + RModifiers mods; +- int orig_x, orig_y; + bool proximity; + public: + ScrollHandler(RModifiers mods_) : mods(mods_) { +diff -up easystroke-0.6.0/prefs.h.unused easystroke-0.6.0/prefs.h +--- easystroke-0.6.0/prefs.h.unused 2019-10-18 14:03:51.670464065 -0400 ++++ easystroke-0.6.0/prefs.h 2019-10-18 14:04:03.526214991 -0400 +@@ -79,7 +79,6 @@ private: + Gtk::TreeView *etv; + Glib::RefPtr etm; + +- Gtk::SpinButton *spin_radius; + Gtk::Label* blabel; + Gtk::Frame *frame_tablet; + bool ignore_device_toggled; diff --git a/easystroke-0.6.0-workarea.patch b/easystroke-0.6.0-workarea.patch new file mode 100644 index 0000000..a4b1453 --- /dev/null +++ b/easystroke-0.6.0-workarea.patch @@ -0,0 +1,38 @@ +diff -up easystroke-0.6.0/composite.cc.workarea easystroke-0.6.0/composite.cc +--- easystroke-0.6.0/composite.cc.workarea 2019-10-18 15:26:28.437229759 -0400 ++++ easystroke-0.6.0/composite.cc 2019-10-18 15:26:33.667118848 -0400 +@@ -47,10 +47,13 @@ void Popup::invalidate(int x1, int y1, i + + Composite::Composite() { + #define N 128 +- int w = gdk_screen_width(); +- int h = gdk_screen_height(); +- num_x = (gdk_screen_width() - 1)/N + 1; +- num_y = (gdk_screen_height() - 1)/N + 1; ++ GdkRectangle workarea = {0}; ++ gdk_monitor_get_workarea(gdk_display_get_primary_monitor(gdk_display_get_default()), &workarea); ++ ++ int w = workarea.width; ++ int h = workarea.height; ++ num_x = (workarea.width - 1)/N + 1; ++ num_y = (workarea.height - 1)/N + 1; + pieces = new Popup**[num_x]; + for (int i = 0; i < num_x; i++) { + pieces[i] = new Popup*[num_y]; +diff -up easystroke-0.6.0/shape.cc.workarea easystroke-0.6.0/shape.cc +--- easystroke-0.6.0/shape.cc.workarea 2019-10-18 15:27:21.515104163 -0400 ++++ easystroke-0.6.0/shape.cc 2019-10-18 15:28:36.273518829 -0400 +@@ -21,8 +21,11 @@ + #include + + Shape::Shape() { +- int w = gdk_screen_width(); +- int h = gdk_screen_height(); ++ GdkRectangle workarea = {0}; ++ gdk_monitor_get_workarea(gdk_display_get_primary_monitor(gdk_display_get_default()), &workarea); ++ ++ int w = workarea.width; ++ int h = workarea.height; + Gdk::Color col = prefs.color.get().color; + unsigned long bg = ((col.get_red()/257)<<16) + ((col.get_green()/257)<<8) + col.get_blue()/257; + win = XCreateSimpleWindow(dpy, ROOT, 0, 0, w, h, 0, CopyFromParent, bg); diff --git a/easystroke.spec b/easystroke.spec index 6807ec8..c83491d 100644 --- a/easystroke.spec +++ b/easystroke.spec @@ -1,6 +1,6 @@ Name: easystroke Version: 0.6.0 -Release: 28%{?dist} +Release: 29%{?dist} Summary: Gesture-recognition application for X11 License: ISC URL: https://github.com/thjaeger/easystroke @@ -13,6 +13,38 @@ Patch1: easystroke-0.6.0-gnome3-fix.patch Patch2: easystroke-0.6.0-lambda.patch # https://github.com/thjaeger/easystroke/pull/8 Patch3: easystroke-0.6.0-abs.patch +# https://github.com/thjaeger/easystroke/pull/10/commits/140b9cae66ba874bf0994eea71210baf417a136e +Patch4: easystroke-0.6.0-iconfix.patch +# https://github.com/thjaeger/easystroke/commit/5388934e722308cd314d65e362ddfaf6e5ab6c94 +Patch5: easystroke-0.6.0-sendfix.patch +# https://github.com/thjaeger/easystroke/commit/7bda4bd9c705413598ee9b534884bc7f23704932 +Patch6: easystroke-0.6.0-signal-handler-fix.patch +# https://github.com/thjaeger/easystroke/commit/040ba64e8c7dbf5b270aa3e7145e625ccb8d49c8 +Patch7: easystroke-0.6.0-unused.patch +# https://github.com/thjaeger/easystroke/commit/30a879fc81c4093c0a0c66116042079f11d246ab +Patch8: easystroke-0.6.0-c11.patch +# https://github.com/thjaeger/easystroke/commit/cdf1d1a73c255c198ff0356472bb0ea76937ae76 +Patch9: easystroke-0.6.0-fix-no-select-crash.patch +# https://github.com/thjaeger/easystroke/pull/6 +Patch10: easystroke-0.6.0-g_spawn_async.patch +# https://github.com/thjaeger/easystroke/pull/9/commits/5f6885c59d1366e28317c9553c2e406fbd6569f9 +Patch11: easystroke-0.6.0-no-absolutes.patch +# https://github.com/thjaeger/easystroke/pull/9/commits/c328ef36d7d85e899fa1ccbc9f11aa1b2317f7bc +Patch12: easystroke-0.6.0-scorefix.patch +# https://aur.archlinux.org/cgit/aur.git/tree/add-toggle-option.patch?h=easystroke-git +Patch13: easystroke-0.6.0-toggle.patch +# https://aur.archlinux.org/cgit/aur.git/tree/dont-ignore-xshape-when-saving.patch?h=easystroke-git +Patch14: easystroke-0.6.0-dont-ignore-xshape-when-saving.patch +# https://github.com/debuggerx01/easystroke/commit/31023e7a253bde9fabb273a294fc3d0837dcaf96 +Patch15: easystroke-0.6.0-missingcase.patch +# https://github.com/tzraeq/easystroke/commit/1c0a0609489035805fedfe88fe97542d2aa37bf5 +Patch16: easystroke-0.6.0-duplicate-actions.patch +# Replace gdk_screen_width/gdk_screen_height +Patch17: easystroke-0.6.0-workarea.patch +# fix private handling +# Work in progress +Patch18: easystroke-0.6.0-privatefix.patch + BuildRequires: gcc-c++ BuildRequires: gtkmm30-devel BuildRequires: dbus-glib-devel @@ -38,6 +70,21 @@ execute shell commands, hold down modifiers and emulate a scroll wheel. %patch1 -p1 -b .gnome3fix %patch2 -p1 -b .lambda %patch3 -p1 -b .abs +%patch4 -p1 -b .iconfix +%patch5 -p1 -b .sendfix +%patch6 -p1 -b .signal-handler-fix +%patch7 -p1 -b .unused +%patch8 -p1 -b .c11 +%patch9 -p1 -b .fix-no-select-crash +%patch10 -p1 -b .g_spawn_async +%patch11 -p1 -b .no-absolutes +%patch12 -p1 -b .scorefix +%patch13 -p1 -b .toggle +%patch14 -p1 -b .dont-ignore-xshape-when-saving +%patch15 -p1 -b .missingcase +%patch16 -p1 -b .duplicate +%patch17 -p1 -b .workarea +# %%patch18 -p1 -b .privatefix cp -a %{SOURCE1} . # Resolve debuginfo @@ -69,6 +116,9 @@ appstream-util validate-relax --nonet %{buildroot}/%{_datadir}/appdata/*.appdata %{_datadir}/appdata/%{name}.appdata.xml %changelog +* Fri Oct 18 2019 Tom Callaway - 0.6.0-29 +- merge a big old pile of patches from various places, thanks to revast on github + * Wed Jul 24 2019 Fedora Release Engineering - 0.6.0-28 - Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild