mirror of
https://github.com/hyprwm/Hyprland.git
synced 2024-12-26 01:03:51 +03:00
input: refocus last window on keyboard unfocusable surfaces
fixes #4460
This commit is contained in:
parent
84227eb587
commit
729b47d46d
@ -17,6 +17,7 @@
|
|||||||
#include "../../protocols/LayerShell.hpp"
|
#include "../../protocols/LayerShell.hpp"
|
||||||
#include "../../protocols/core/Seat.hpp"
|
#include "../../protocols/core/Seat.hpp"
|
||||||
#include "../../protocols/core/DataDevice.hpp"
|
#include "../../protocols/core/DataDevice.hpp"
|
||||||
|
#include "../../protocols/core/Compositor.hpp"
|
||||||
#include "../../protocols/XDGShell.hpp"
|
#include "../../protocols/XDGShell.hpp"
|
||||||
|
|
||||||
#include "../../devices/Mouse.hpp"
|
#include "../../devices/Mouse.hpp"
|
||||||
@ -1382,6 +1383,12 @@ void CInputManager::refocusLastWindow(CMonitor* pMonitor) {
|
|||||||
g_pCompositor->focusWindow(PLASTWINDOW);
|
g_pCompositor->focusWindow(PLASTWINDOW);
|
||||||
} else {
|
} else {
|
||||||
// otherwise fall back to a normal refocus.
|
// otherwise fall back to a normal refocus.
|
||||||
|
|
||||||
|
if (foundSurface && !foundSurface->hlSurface->keyboardFocusable()) {
|
||||||
|
const auto PLASTWINDOW = g_pCompositor->m_pLastWindow.lock();
|
||||||
|
g_pCompositor->focusWindow(PLASTWINDOW);
|
||||||
|
}
|
||||||
|
|
||||||
refocus();
|
refocus();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -134,11 +134,11 @@ class CWLSurfaceResource {
|
|||||||
SP<CWlSurface> resource;
|
SP<CWlSurface> resource;
|
||||||
wl_client* pClient = nullptr;
|
wl_client* pClient = nullptr;
|
||||||
|
|
||||||
int stateLocks = 0;
|
int stateLocks = 0;
|
||||||
|
|
||||||
void destroy();
|
void destroy();
|
||||||
void commitPendingState();
|
void commitPendingState();
|
||||||
void bfHelper(std::vector<SP<CWLSurfaceResource>> nodes, std::function<void(SP<CWLSurfaceResource>, const Vector2D&, void*)> fn, void* data);
|
void bfHelper(std::vector<SP<CWLSurfaceResource>> nodes, std::function<void(SP<CWLSurfaceResource>, const Vector2D&, void*)> fn, void* data);
|
||||||
};
|
};
|
||||||
|
|
||||||
class CWLCompositorResource {
|
class CWLCompositorResource {
|
||||||
|
Loading…
Reference in New Issue
Block a user