expo: add swipe gesture to close overview (#186)

This commit is contained in:
Mathis H 2024-06-17 21:43:34 +00:00 committed by GitHub
parent d92d9d6cd9
commit 667ea74c36
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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;