mirror of
https://github.com/hyprwm/hyprland-plugins.git
synced 2024-11-24 03:05:58 +01:00
expo: add swipe gesture to close overview (#186)
This commit is contained in:
parent
d92d9d6cd9
commit
667ea74c36
1 changed files with 18 additions and 8 deletions
|
@ -87,15 +87,25 @@ static void swipeUpdate(void* self, SCallbackInfo& info, std::any param) {
|
||||||
|
|
||||||
info.cancelled = true;
|
info.cancelled = true;
|
||||||
if (!swipeActive) {
|
if (!swipeActive) {
|
||||||
if (g_pOverview)
|
if (g_pOverview && (**PPOSITIVE ? 1.0 : -1.0) * e.delta.y <= 0) {
|
||||||
|
renderingOverview = true;
|
||||||
|
g_pOverview = std::make_unique<COverview>(g_pCompositor->m_pLastMonitor->activeWorkspace, true);
|
||||||
|
renderingOverview = false;
|
||||||
|
gestured = 300;
|
||||||
|
swipeActive = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
else if (!g_pOverview && (**PPOSITIVE ? 1.0 : -1.0) * e.delta.y > 0) {
|
||||||
|
renderingOverview = true;
|
||||||
|
g_pOverview = std::make_unique<COverview>(g_pCompositor->m_pLastMonitor->activeWorkspace, true);
|
||||||
|
renderingOverview = false;
|
||||||
|
gestured = 0;
|
||||||
|
swipeActive = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
else {
|
||||||
return;
|
return;
|
||||||
if ((**PPOSITIVE ? 1.0 : -1.0) * e.delta.y <= 0)
|
}
|
||||||
return;
|
|
||||||
renderingOverview = true;
|
|
||||||
g_pOverview = std::make_unique<COverview>(g_pCompositor->m_pLastMonitor->activeWorkspace, true);
|
|
||||||
renderingOverview = false;
|
|
||||||
gestured = 0;
|
|
||||||
swipeActive = true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
gestured += (**PPOSITIVE ? 1.0 : -1.0) * e.delta.y;
|
gestured += (**PPOSITIVE ? 1.0 : -1.0) * e.delta.y;
|
||||||
|
|
Loading…
Reference in a new issue