blob: 33f018cd52cf42611f09ec7851a106ab92d92419 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
|
#include "ResizeGesture.hpp"
#include "../../../../desktop/state/FocusState.hpp"
#include "../../../../desktop/view/Window.hpp"
#include "../../../../managers/LayoutManager.hpp"
#include "../../../../render/Renderer.hpp"
void CResizeTrackpadGesture::begin(const ITrackpadGesture::STrackpadGestureBegin& e) {
ITrackpadGesture::begin(e);
m_window = Desktop::focusState()->window();
}
void CResizeTrackpadGesture::update(const ITrackpadGesture::STrackpadGestureUpdate& e) {
if (!m_window)
return;
g_pHyprRenderer->damageWindow(m_window.lock());
g_pLayoutManager->getCurrentLayout()->resizeActiveWindow((e.swipe ? e.swipe->delta : e.pinch->delta),
cornerFromBox(m_window->getWindowMainSurfaceBox(), g_pInputManager->getMouseCoordsInternal()), m_window.lock());
m_window->m_realSize->warp();
m_window->m_realPosition->warp();
g_pHyprRenderer->damageWindow(m_window.lock());
}
void CResizeTrackpadGesture::end(const ITrackpadGesture::STrackpadGestureEnd& e) {
m_window.reset();
}
|