Fix clicking and scrolling through workspaces

The way waybar used the workspace "num", clicking a workspace called "1:
something" resulted in going to a newly created workspace called "1",
because the workspace ipc command expects the workspace name, not its number.
This commit is contained in:
David96
2018-11-05 20:16:19 +01:00
parent d6af63d84a
commit 168415440f
2 changed files with 24 additions and 24 deletions

View File

@ -20,8 +20,8 @@ class Workspaces : public IModule {
void addWorkspace(Json::Value);
std::string getIcon(std::string, Json::Value);
bool handleScroll(GdkEventScroll*);
int getPrevWorkspace();
int getNextWorkspace();
std::string getPrevWorkspace();
std::string getNextWorkspace();
Bar& bar_;
const Json::Value& config_;
@ -30,7 +30,7 @@ class Workspaces : public IModule {
util::JsonParser parser_;
std::mutex mutex_;
bool scrolling_;
std::unordered_map<int, Gtk::Button> buttons_;
std::unordered_map<std::string, Gtk::Button> buttons_;
Json::Value workspaces_;
Ipc ipc_;
};