add button single click check to hyprland workspaces

This commit is contained in:
Jeremy Huang 2023-11-27 16:20:05 -08:00
parent 1fe4a4ee9d
commit 0162dbd485
1 changed files with 15 additions and 13 deletions

View File

@ -849,6 +849,7 @@ std::string &Workspace::select_icon(std::map<std::string, std::string> &icons_ma
}
bool Workspace::handle_clicked(GdkEventButton *bt) const {
if (bt->type == GDK_BUTTON_PRESS) {
try {
if (id() > 0) { // normal or numbered persistent
gIPC->getSocket1Reply("dispatch workspace " + std::to_string(id()));
@ -863,6 +864,7 @@ bool Workspace::handle_clicked(GdkEventButton *bt) const {
} catch (const std::exception &e) {
spdlog::error("Failed to dispatch workspace: {}", e.what());
}
}
return false;
}