mirror of
https://github.com/hyprwm/Hyprland.git
synced 2025-08-11 02:01:53 -07:00
layout: warp the cursor when focusing windows (#4982)
Similar to the `focuswindow` dispatcher, when focusing a window with wlr-foreign-toplevel-management, the cursor should be warped. Otherwise, the focus is lost immediately after the cursor moves.
This commit is contained in:
@@ -593,6 +593,7 @@ void IHyprLayout::bringWindowToTop(CWindow* pWindow) {
|
|||||||
void IHyprLayout::requestFocusForWindow(CWindow* pWindow) {
|
void IHyprLayout::requestFocusForWindow(CWindow* pWindow) {
|
||||||
bringWindowToTop(pWindow);
|
bringWindowToTop(pWindow);
|
||||||
g_pCompositor->focusWindow(pWindow);
|
g_pCompositor->focusWindow(pWindow);
|
||||||
|
g_pCompositor->warpCursorTo(pWindow->middle());
|
||||||
}
|
}
|
||||||
|
|
||||||
Vector2D IHyprLayout::predictSizeForNewWindow() {
|
Vector2D IHyprLayout::predictSizeForNewWindow() {
|
||||||
|
Reference in New Issue
Block a user