mirror of
https://github.com/hyprwm/Hyprland
synced 2024-12-23 03:09:48 +01:00
move window to top if floating activate
This commit is contained in:
parent
df30f0519a
commit
c4e422644b
1 changed files with 6 additions and 0 deletions
|
@ -808,6 +808,9 @@ void Events::listener_activateXDG(wl_listener* listener, void* data) {
|
||||||
if (!PWINDOW || PWINDOW == g_pCompositor->m_pLastWindow)
|
if (!PWINDOW || PWINDOW == g_pCompositor->m_pLastWindow)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
if (PWINDOW->m_bIsFloating)
|
||||||
|
g_pCompositor->moveWindowToTop(PWINDOW);
|
||||||
|
|
||||||
g_pCompositor->focusWindow(PWINDOW);
|
g_pCompositor->focusWindow(PWINDOW);
|
||||||
Vector2D middle = PWINDOW->m_vRealPosition.goalv() + PWINDOW->m_vRealSize.goalv() / 2.f;
|
Vector2D middle = PWINDOW->m_vRealPosition.goalv() + PWINDOW->m_vRealSize.goalv() / 2.f;
|
||||||
g_pCompositor->warpCursorTo(middle);
|
g_pCompositor->warpCursorTo(middle);
|
||||||
|
@ -823,6 +826,9 @@ void Events::listener_activateX11(void* owner, void* data) {
|
||||||
if (!*PFOCUSONACTIVATE || PWINDOW->m_iX11Type != 1 || PWINDOW == g_pCompositor->m_pLastWindow)
|
if (!*PFOCUSONACTIVATE || PWINDOW->m_iX11Type != 1 || PWINDOW == g_pCompositor->m_pLastWindow)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
if (PWINDOW->m_bIsFloating)
|
||||||
|
g_pCompositor->moveWindowToTop(PWINDOW);
|
||||||
|
|
||||||
g_pCompositor->focusWindow(PWINDOW);
|
g_pCompositor->focusWindow(PWINDOW);
|
||||||
Vector2D middle = PWINDOW->m_vRealPosition.goalv() + PWINDOW->m_vRealSize.goalv() / 2.f;
|
Vector2D middle = PWINDOW->m_vRealPosition.goalv() + PWINDOW->m_vRealSize.goalv() / 2.f;
|
||||||
g_pCompositor->warpCursorTo(middle);
|
g_pCompositor->warpCursorTo(middle);
|
||||||
|
|
Loading…
Reference in a new issue