diff options
Diffstat (limited to 'opentrack/work.hpp')
-rw-r--r-- | opentrack/work.hpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/opentrack/work.hpp b/opentrack/work.hpp index c0962b9a..73ba691b 100644 --- a/opentrack/work.hpp +++ b/opentrack/work.hpp @@ -15,11 +15,13 @@ struct Work SelectedLibraries libs; ptr<Tracker> tracker; ptr<Shortcuts> sc; + WId handle; Work(main_settings& s, Mappings& m, SelectedLibraries& libs, QObject* recv, WId handle) : s(s), libs(libs), tracker(std::make_shared<Tracker>(s, m, libs)), - sc(std::make_shared<Shortcuts>(handle)) + sc(std::make_shared<Shortcuts>(handle)), + handle(handle) { #ifndef _WIN32 QObject::connect(&sc->keyCenter, SIGNAL(activated()), recv, SLOT(shortcutRecentered())); @@ -31,6 +33,11 @@ struct Work tracker->start(); } + void reload_shortcuts() + { + sc = std::make_shared<Shortcuts>(handle); + } + ~Work() { // order matters, otherwise use-after-free -sh |