mirror of
https://github.com/hyprwm/Hypr.git
synced 2024-11-22 13:35:57 +01:00
fix floating top and cursor warping
This commit is contained in:
parent
1932214bdb
commit
cb0371dab1
3 changed files with 11 additions and 8 deletions
|
@ -189,5 +189,7 @@ void KeybindManager::toggleActiveWindowFloating(std::string unusedArg) {
|
||||||
EWMH::updateClientList();
|
EWMH::updateClientList();
|
||||||
|
|
||||||
EWMH::updateWindow(PWINDOW->getDrawable());
|
EWMH::updateWindow(PWINDOW->getDrawable());
|
||||||
|
|
||||||
|
g_pWindowManager->setAllFloatingWindowsTop();
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -52,6 +52,10 @@ void CWindow::bringTopRecursiveTransients() {
|
||||||
if (ConfigManager::getInt("intelligent_transients") != 1)
|
if (ConfigManager::getInt("intelligent_transients") != 1)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
// if this is a floating window, top
|
||||||
|
if (m_bIsFloating && m_iDrawable > 0)
|
||||||
|
g_pWindowManager->setAWindowTop(m_iDrawable);
|
||||||
|
|
||||||
// first top all the children if floating
|
// first top all the children if floating
|
||||||
for (auto& c : m_vecChildren) {
|
for (auto& c : m_vecChildren) {
|
||||||
if (const auto PWINDOW = g_pWindowManager->getWindowFromDrawable(c); PWINDOW) {
|
if (const auto PWINDOW = g_pWindowManager->getWindowFromDrawable(c); PWINDOW) {
|
||||||
|
|
|
@ -1249,9 +1249,6 @@ CWindow* CWindowManager::getNeighborInDir(char dir) {
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
// I don't know if this works, it might be an issue with my nested Xorg session I am using rn to test this.
|
|
||||||
// Will check later.
|
|
||||||
// TODO:
|
|
||||||
void CWindowManager::warpCursorTo(Vector2D to) {
|
void CWindowManager::warpCursorTo(Vector2D to) {
|
||||||
const auto POINTERCOOKIE = xcb_query_pointer(DisplayConnection, Screen->root);
|
const auto POINTERCOOKIE = xcb_query_pointer(DisplayConnection, Screen->root);
|
||||||
|
|
||||||
|
@ -1262,7 +1259,7 @@ void CWindowManager::warpCursorTo(Vector2D to) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
xcb_warp_pointer(DisplayConnection, XCB_NONE, Screen->root, 0, 0, 0, 0, (int)to.x, (int)to.y);
|
xcb_warp_pointer(DisplayConnection, XCB_NONE, Screen->root, 0, 0, Screen->width_in_pixels, Screen->height_in_pixels, (int)to.x, (int)to.y);
|
||||||
free(pointerreply);
|
free(pointerreply);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1343,7 +1340,7 @@ void CWindowManager::moveActiveWindowTo(char dir) {
|
||||||
CURRENTWINDOW->setDirty(true);
|
CURRENTWINDOW->setDirty(true);
|
||||||
neighbor->setDirty(true);
|
neighbor->setDirty(true);
|
||||||
|
|
||||||
// finish by moving the cursor to the current window
|
// finish by moving the cursor to the new current window
|
||||||
warpCursorTo(CURRENTWINDOW->getPosition() + CURRENTWINDOW->getSize() / 2.f);
|
warpCursorTo(CURRENTWINDOW->getPosition() + CURRENTWINDOW->getSize() / 2.f);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1375,8 +1372,8 @@ void CWindowManager::moveActiveFocusTo(char dir) {
|
||||||
// move the focus
|
// move the focus
|
||||||
setFocusedWindow(NEIGHBOR->getDrawable());
|
setFocusedWindow(NEIGHBOR->getDrawable());
|
||||||
|
|
||||||
// finish by moving the cursor to the current window
|
// finish by moving the cursor to the neighbor window
|
||||||
warpCursorTo(CURRENTWINDOW->getPosition() + CURRENTWINDOW->getSize() / 2.f);
|
warpCursorTo(NEIGHBOR->getPosition() + (NEIGHBOR->getSize() / 2.f));
|
||||||
}
|
}
|
||||||
|
|
||||||
void CWindowManager::changeWorkspaceByID(int ID) {
|
void CWindowManager::changeWorkspaceByID(int ID) {
|
||||||
|
@ -1609,7 +1606,7 @@ void CWindowManager::setAllFloatingWindowsTop() {
|
||||||
xcb_configure_window(g_pWindowManager->DisplayConnection, window.getDrawable(), XCB_CONFIG_WINDOW_STACK_MODE, Values);
|
xcb_configure_window(g_pWindowManager->DisplayConnection, window.getDrawable(), XCB_CONFIG_WINDOW_STACK_MODE, Values);
|
||||||
|
|
||||||
window.bringTopRecursiveTransients();
|
window.bringTopRecursiveTransients();
|
||||||
} else if (window.getChildren().size() > 0) {
|
} else {
|
||||||
window.bringTopRecursiveTransients();
|
window.bringTopRecursiveTransients();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue