refactor: utilize 'middle()' method for window/montior center (#3253)
This commit is contained in:
parent
3859607b6c
commit
e96e0dc02d
7 changed files with 20 additions and 23 deletions
|
|
@ -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 {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue