Skip to content

Commit

Permalink
expo: add swipe gesture to close overview (#186)
Browse files Browse the repository at this point in the history
  • Loading branch information
matt1432 authored Jun 17, 2024
1 parent d92d9d6 commit 667ea74
Showing 1 changed file with 18 additions and 8 deletions.
26 changes: 18 additions & 8 deletions hyprexpo/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -87,15 +87,25 @@ static void swipeUpdate(void* self, SCallbackInfo& info, std::any param) {

info.cancelled = true;
if (!swipeActive) {
if (g_pOverview)
return;
if ((**PPOSITIVE ? 1.0 : -1.0) * e.delta.y <= 0)
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;
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;
Expand Down

0 comments on commit 667ea74

Please sign in to comment.