mirror of
https://github.com/hyprwm/Hyprland.git
synced 2025-08-06 07:01:57 -07:00
@@ -4,6 +4,7 @@
|
|||||||
#include "../protocols/LayerShell.hpp"
|
#include "../protocols/LayerShell.hpp"
|
||||||
#include "../protocols/ShortcutsInhibit.hpp"
|
#include "../protocols/ShortcutsInhibit.hpp"
|
||||||
#include "../protocols/GlobalShortcuts.hpp"
|
#include "../protocols/GlobalShortcuts.hpp"
|
||||||
|
#include "../protocols/core/DataDevice.hpp"
|
||||||
#include "../render/decorations/CHyprGroupBarDecoration.hpp"
|
#include "../render/decorations/CHyprGroupBarDecoration.hpp"
|
||||||
#include "KeybindManager.hpp"
|
#include "KeybindManager.hpp"
|
||||||
#include "PointerManager.hpp"
|
#include "PointerManager.hpp"
|
||||||
@@ -432,6 +433,9 @@ bool CKeybindManager::onKeyEvent(std::any event, SP<IKeyboard> pKeyboard) {
|
|||||||
const xkb_keysym_t keysym = xkb_state_key_get_one_sym(pKeyboard->resolveBindsBySym ? pKeyboard->xkbSymState : m_pXKBTranslationState, KEYCODE);
|
const xkb_keysym_t keysym = xkb_state_key_get_one_sym(pKeyboard->resolveBindsBySym ? pKeyboard->xkbSymState : m_pXKBTranslationState, KEYCODE);
|
||||||
const xkb_keysym_t internalKeysym = xkb_state_key_get_one_sym(pKeyboard->xkbState, KEYCODE);
|
const xkb_keysym_t internalKeysym = xkb_state_key_get_one_sym(pKeyboard->xkbState, KEYCODE);
|
||||||
|
|
||||||
|
if (keysym == XKB_KEY_Escape || internalKeysym == XKB_KEY_Escape)
|
||||||
|
PROTO::data->abortDndIfPresent();
|
||||||
|
|
||||||
// handleInternalKeybinds returns true when the key should be suppressed,
|
// handleInternalKeybinds returns true when the key should be suppressed,
|
||||||
// while this function returns true when the key event should be sent
|
// while this function returns true when the key event should be sent
|
||||||
if (handleInternalKeybinds(internalKeysym))
|
if (handleInternalKeybinds(internalKeysym))
|
||||||
|
@@ -814,3 +814,9 @@ void CWLDataDeviceProtocol::renderDND(PHLMONITOR pMonitor, timespec* when) {
|
|||||||
bool CWLDataDeviceProtocol::dndActive() {
|
bool CWLDataDeviceProtocol::dndActive() {
|
||||||
return dnd.currentSource;
|
return dnd.currentSource;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CWLDataDeviceProtocol::abortDndIfPresent() {
|
||||||
|
if (!dndActive())
|
||||||
|
return;
|
||||||
|
abortDrag();
|
||||||
|
}
|
||||||
|
@@ -144,6 +144,9 @@ class CWLDataDeviceProtocol : public IWaylandProtocol {
|
|||||||
// TODO: move handling to seatmgr
|
// TODO: move handling to seatmgr
|
||||||
bool dndActive();
|
bool dndActive();
|
||||||
|
|
||||||
|
// called on an escape key pressed, for moments where it gets stuck
|
||||||
|
void abortDndIfPresent();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void destroyResource(CWLDataDeviceManagerResource* resource);
|
void destroyResource(CWLDataDeviceManagerResource* resource);
|
||||||
void destroyResource(CWLDataDeviceResource* resource);
|
void destroyResource(CWLDataDeviceResource* resource);
|
||||||
|
Reference in New Issue
Block a user