mirror of
https://github.com/hyprwm/Hyprland
synced 2024-12-22 22:09:49 +01:00
seat/dnd: unfocus pointer from surfaces on dnd start
GTK is speshyal and requires this for functioning properly. Ugh. It's technically not required by spec, f you gtk. Ref #6509
This commit is contained in:
parent
3eaf35f1e2
commit
1b5444494d
2 changed files with 12 additions and 2 deletions
|
@ -191,6 +191,11 @@ void CSeatManager::setPointerFocus(SP<CWLSurfaceResource> surf, const Vector2D&
|
|||
if (state.pointerFocus == surf)
|
||||
return;
|
||||
|
||||
if (PROTO::data->dndActive() && surf) {
|
||||
Debug::log(LOG, "[seatmgr] Refusing pointer focus during an active dnd");
|
||||
return;
|
||||
}
|
||||
|
||||
if (!mouse || !mouse->wlr()) {
|
||||
Debug::log(ERR, "BUG THIS: setPointerFocus without a valid mouse set");
|
||||
return;
|
||||
|
|
|
@ -542,6 +542,11 @@ void CWLDataDeviceProtocol::initiateDrag(WP<CWLDataSourceResource> currentSource
|
|||
}
|
||||
});
|
||||
|
||||
// unfocus the pointer from the surface, this is part of """standard""" wayland procedure and gtk will freak out if this isn't happening.
|
||||
// BTW, the spec does NOT require this explicitly...
|
||||
// Fuck you gtk.
|
||||
g_pSeatManager->setPointerFocus(nullptr, {});
|
||||
|
||||
// make a new offer, etc
|
||||
updateDrag();
|
||||
}
|
||||
|
@ -638,7 +643,7 @@ void CWLDataDeviceProtocol::completeDrag() {
|
|||
dnd.focusedDevice.reset();
|
||||
dnd.currentSource.reset();
|
||||
|
||||
g_pSeatManager->resendEnterEvents();
|
||||
g_pInputManager->simulateMouseMovement();
|
||||
}
|
||||
|
||||
void CWLDataDeviceProtocol::abortDrag() {
|
||||
|
@ -657,7 +662,7 @@ void CWLDataDeviceProtocol::abortDrag() {
|
|||
dnd.focusedDevice.reset();
|
||||
dnd.currentSource.reset();
|
||||
|
||||
g_pSeatManager->resendEnterEvents();
|
||||
g_pInputManager->simulateMouseMovement();
|
||||
}
|
||||
|
||||
void CWLDataDeviceProtocol::renderDND(CMonitor* pMonitor, timespec* when) {
|
||||
|
|
Loading…
Reference in a new issue