mirror of
https://github.com/hyprwm/Hyprland
synced 2024-11-26 09:25:59 +01:00
input: simulate mouse movement to fix focus on open/close window
fixes #3679
This commit is contained in:
parent
c44e255194
commit
a4db48b46b
1 changed files with 6 additions and 7 deletions
|
@ -648,6 +648,8 @@ void Events::listener_mapWindow(void* owner, void* data) {
|
||||||
|
|
||||||
g_pCompositor->setPreferredScaleForSurface(PWINDOW->m_pWLSurface.wlr(), PMONITOR->scale);
|
g_pCompositor->setPreferredScaleForSurface(PWINDOW->m_pWLSurface.wlr(), PMONITOR->scale);
|
||||||
g_pCompositor->setPreferredTransformForSurface(PWINDOW->m_pWLSurface.wlr(), PMONITOR->transform);
|
g_pCompositor->setPreferredTransformForSurface(PWINDOW->m_pWLSurface.wlr(), PMONITOR->transform);
|
||||||
|
|
||||||
|
g_pInputManager->simulateMouseMovement();
|
||||||
}
|
}
|
||||||
|
|
||||||
void Events::listener_unmapWindow(void* owner, void* data) {
|
void Events::listener_unmapWindow(void* owner, void* data) {
|
||||||
|
@ -735,12 +737,9 @@ void Events::listener_unmapWindow(void* owner, void* data) {
|
||||||
|
|
||||||
Debug::log(LOG, "On closed window, new focused candidate is {}", PWINDOWCANDIDATE);
|
Debug::log(LOG, "On closed window, new focused candidate is {}", PWINDOWCANDIDATE);
|
||||||
|
|
||||||
if (PWINDOWCANDIDATE != g_pCompositor->m_pLastWindow) {
|
if (PWINDOWCANDIDATE != g_pCompositor->m_pLastWindow && PWINDOWCANDIDATE)
|
||||||
if (!PWINDOWCANDIDATE)
|
|
||||||
g_pInputManager->simulateMouseMovement();
|
|
||||||
else
|
|
||||||
g_pCompositor->focusWindow(PWINDOWCANDIDATE);
|
g_pCompositor->focusWindow(PWINDOWCANDIDATE);
|
||||||
} else
|
|
||||||
g_pInputManager->simulateMouseMovement();
|
g_pInputManager->simulateMouseMovement();
|
||||||
|
|
||||||
// CWindow::onUnmap will remove this window's active status, but we can't really do it above.
|
// CWindow::onUnmap will remove this window's active status, but we can't really do it above.
|
||||||
|
|
Loading…
Reference in a new issue