mirror of
https://github.com/hyprwm/Hyprland
synced 2024-12-23 13:09:50 +01:00
minor constraint fixes
This commit is contained in:
parent
d4d72ae54d
commit
1d21e5303b
1 changed files with 13 additions and 8 deletions
|
@ -141,12 +141,16 @@ void CInputManager::mouseMoveUnified(uint32_t time, bool refocus) {
|
||||||
|
|
||||||
// constraints
|
// constraints
|
||||||
// All constraints TODO: multiple mice?
|
// All constraints TODO: multiple mice?
|
||||||
if (g_pCompositor->m_sSeat.mouse->currentConstraint) {
|
if (g_pCompositor->m_sSeat.mouse->currentConstraint && pFoundWindow) { // TODO: make this match the pFoundWindow in SOME way. We don't want to constrain the mouse on another window.
|
||||||
|
// XWayland windows sometimes issue constraints weirdly.
|
||||||
const auto CONSTRAINTWINDOW = g_pCompositor->getConstraintWindow(g_pCompositor->m_sSeat.mouse);
|
const auto CONSTRAINTWINDOW = g_pCompositor->getConstraintWindow(g_pCompositor->m_sSeat.mouse);
|
||||||
|
|
||||||
if (!CONSTRAINTWINDOW) {
|
if (!CONSTRAINTWINDOW) {
|
||||||
g_pCompositor->m_sSeat.mouse->currentConstraint = nullptr;
|
g_pCompositor->m_sSeat.mouse->currentConstraint = nullptr;
|
||||||
} else {
|
} else {
|
||||||
|
// Native Wayland apps know how 2 constrain themselves.
|
||||||
|
// XWayland, we just have to accept them. Might cause issues, but thats XWayland for ya.
|
||||||
|
if (CONSTRAINTWINDOW->m_bIsX11 || pFoundWindow == CONSTRAINTWINDOW) {
|
||||||
const auto CONSTRAINTPOS = CONSTRAINTWINDOW->m_bIsX11 ? Vector2D(CONSTRAINTWINDOW->m_uSurface.xwayland->x, CONSTRAINTWINDOW->m_uSurface.xwayland->y) : CONSTRAINTWINDOW->m_vRealPosition.vec();
|
const auto CONSTRAINTPOS = CONSTRAINTWINDOW->m_bIsX11 ? Vector2D(CONSTRAINTWINDOW->m_uSurface.xwayland->x, CONSTRAINTWINDOW->m_uSurface.xwayland->y) : CONSTRAINTWINDOW->m_vRealPosition.vec();
|
||||||
const auto CONSTRAINTSIZE = CONSTRAINTWINDOW->m_bIsX11 ? Vector2D(CONSTRAINTWINDOW->m_uSurface.xwayland->width, CONSTRAINTWINDOW->m_uSurface.xwayland->height) : CONSTRAINTWINDOW->m_vRealSize.vec();
|
const auto CONSTRAINTSIZE = CONSTRAINTWINDOW->m_bIsX11 ? Vector2D(CONSTRAINTWINDOW->m_uSurface.xwayland->width, CONSTRAINTWINDOW->m_uSurface.xwayland->height) : CONSTRAINTWINDOW->m_vRealSize.vec();
|
||||||
|
|
||||||
|
@ -158,6 +162,7 @@ void CInputManager::mouseMoveUnified(uint32_t time, bool refocus) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void CInputManager::onMouseButton(wlr_pointer_button_event* e) {
|
void CInputManager::onMouseButton(wlr_pointer_button_event* e) {
|
||||||
|
|
Loading…
Reference in a new issue