refactor: utilize 'middle()' method for window/montior center (#3253)

This commit is contained in:
memchr 2023-09-11 09:09:34 +00:00 committed by GitHub
parent 3859607b6c
commit e96e0dc02d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 20 additions and 23 deletions

View file

@ -98,7 +98,7 @@ void Events::listener_newOutput(wl_listener* listener, void* data) {
g_pHyprRenderer->m_pMostHzMonitor = PNEWMONITOR;
const auto POS = PNEWMONITOR->vecPosition + PNEWMONITOR->vecSize / 2.f;
const auto POS = PNEWMONITOR->middle();
if (g_pCompositor->m_sSeat.mouse)
wlr_cursor_warp(g_pCompositor->m_sWLRCursor, g_pCompositor->m_sSeat.mouse->mouse, POS.x, POS.y);
}
@ -112,7 +112,7 @@ void Events::listener_newOutput(wl_listener* listener, void* data) {
if (firstLaunch) {
firstLaunch = false;
const auto POS = PNEWMONITOR->vecPosition + PNEWMONITOR->vecSize / 2.f;
const auto POS = PNEWMONITOR->middle();
if (g_pCompositor->m_sSeat.mouse)
wlr_cursor_warp(g_pCompositor->m_sWLRCursor, g_pCompositor->m_sSeat.mouse->mouse, POS.x, POS.y);
} else {