mirror of
https://github.com/hyprwm/hyprland-plugins.git
synced 2024-11-21 18:25:58 +01:00
hyprexpo: chase hyprland
This commit is contained in:
parent
667ea74c36
commit
dbd1f372cf
1 changed files with 6 additions and 10 deletions
|
@ -35,15 +35,14 @@ COverview::COverview(PHLWORKSPACE startedOn_, bool swipe_) : startedOn(startedOn
|
||||||
BG_COLOR = **PCOL;
|
BG_COLOR = **PCOL;
|
||||||
|
|
||||||
// process the method
|
// process the method
|
||||||
bool methodCenter = true;
|
bool methodCenter = true;
|
||||||
int methodStartID = pMonitor->activeWorkspaceID();
|
int methodStartID = pMonitor->activeWorkspaceID();
|
||||||
CVarList method{*PMETHOD, 0, 's', true};
|
CVarList method{*PMETHOD, 0, 's', true};
|
||||||
if (method.size() < 2)
|
if (method.size() < 2)
|
||||||
Debug::log(ERR, "[he] invalid workspace_method");
|
Debug::log(ERR, "[he] invalid workspace_method");
|
||||||
else {
|
else {
|
||||||
methodCenter = method[0] == "center";
|
methodCenter = method[0] == "center";
|
||||||
std::string s;
|
methodStartID = getWorkspaceIDNameFromString(method[1]).id;
|
||||||
methodStartID = getWorkspaceIDFromString(method[1], s);
|
|
||||||
if (methodStartID == WORKSPACE_INVALID)
|
if (methodStartID == WORKSPACE_INVALID)
|
||||||
methodStartID = pMonitor->activeWorkspaceID();
|
methodStartID = pMonitor->activeWorkspaceID();
|
||||||
}
|
}
|
||||||
|
@ -57,8 +56,7 @@ COverview::COverview(PHLWORKSPACE startedOn_, bool swipe_) : startedOn(startedOn
|
||||||
int backtracked = 0;
|
int backtracked = 0;
|
||||||
|
|
||||||
for (size_t i = 1; i < images.size() / 2; ++i) {
|
for (size_t i = 1; i < images.size() / 2; ++i) {
|
||||||
std::string s;
|
currentID = getWorkspaceIDNameFromString("r-" + std::to_string(i)).id;
|
||||||
currentID = getWorkspaceIDFromString("r-" + std::to_string(i), s);
|
|
||||||
if (currentID >= firstID)
|
if (currentID >= firstID)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -68,9 +66,8 @@ COverview::COverview(PHLWORKSPACE startedOn_, bool swipe_) : startedOn(startedOn
|
||||||
|
|
||||||
for (size_t i = 0; i < SIDE_LENGTH * SIDE_LENGTH; ++i) {
|
for (size_t i = 0; i < SIDE_LENGTH * SIDE_LENGTH; ++i) {
|
||||||
auto& image = images[i];
|
auto& image = images[i];
|
||||||
std::string s;
|
|
||||||
currentID =
|
currentID =
|
||||||
getWorkspaceIDFromString("r" + ((int64_t)i - backtracked < 0 ? std::to_string((int64_t)i - backtracked) : "+" + std::to_string((int64_t)i - backtracked)), s);
|
getWorkspaceIDNameFromString("r" + ((int64_t)i - backtracked < 0 ? std::to_string((int64_t)i - backtracked) : "+" + std::to_string((int64_t)i - backtracked))).id;
|
||||||
image.workspaceID = currentID;
|
image.workspaceID = currentID;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
@ -85,8 +82,7 @@ COverview::COverview(PHLWORKSPACE startedOn_, bool swipe_) : startedOn(startedOn
|
||||||
|
|
||||||
for (size_t i = 1; i < SIDE_LENGTH * SIDE_LENGTH; ++i) {
|
for (size_t i = 1; i < SIDE_LENGTH * SIDE_LENGTH; ++i) {
|
||||||
auto& image = images[i];
|
auto& image = images[i];
|
||||||
std::string s;
|
currentID = getWorkspaceIDNameFromString("r+" + std::to_string(i)).id;
|
||||||
currentID = getWorkspaceIDFromString("r+" + std::to_string(i), s);
|
|
||||||
image.workspaceID = currentID;
|
image.workspaceID = currentID;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -209,7 +205,7 @@ COverview::COverview(PHLWORKSPACE startedOn_, bool swipe_) : startedOn(startedOn
|
||||||
touchMoveHook = g_pHookSystem->hookDynamic("touchMove", onCursorMove);
|
touchMoveHook = g_pHookSystem->hookDynamic("touchMove", onCursorMove);
|
||||||
|
|
||||||
mouseButtonHook = g_pHookSystem->hookDynamic("mouseButton", onCursorSelect);
|
mouseButtonHook = g_pHookSystem->hookDynamic("mouseButton", onCursorSelect);
|
||||||
touchUpHook = g_pHookSystem->hookDynamic("touchUp", onCursorSelect);
|
touchUpHook = g_pHookSystem->hookDynamic("touchUp", onCursorSelect);
|
||||||
}
|
}
|
||||||
|
|
||||||
void COverview::redrawID(int id, bool forcelowres) {
|
void COverview::redrawID(int id, bool forcelowres) {
|
||||||
|
|
Loading…
Reference in a new issue