parent
461757e2fb
commit
d2b42e29c6
5 changed files with 53 additions and 11 deletions
|
|
@ -244,3 +244,39 @@ void SKeyboard::updateXKBTranslationState(xkb_keymap* const keymap) {
|
|||
xkb_keymap_unref(NEWKEYMAP);
|
||||
xkb_context_unref(PCONTEXT);
|
||||
}
|
||||
|
||||
void STextInput::setFocusedSurface(wlr_surface* pSurface) {
|
||||
focusedSurface = pSurface;
|
||||
|
||||
hyprListener_surfaceUnmapped.removeCallback();
|
||||
hyprListener_surfaceDestroyed.removeCallback();
|
||||
|
||||
if (!pSurface)
|
||||
return;
|
||||
|
||||
hyprListener_surfaceUnmapped.initCallback(
|
||||
&pSurface->events.unmap,
|
||||
[this](void* owner, void* data) {
|
||||
if (!focusedSurface)
|
||||
return;
|
||||
|
||||
focusedSurface = nullptr;
|
||||
hyprListener_surfaceUnmapped.removeCallback();
|
||||
hyprListener_surfaceDestroyed.removeCallback();
|
||||
g_pInputManager->m_sIMERelay.removeSurfaceToPTI(this);
|
||||
},
|
||||
this, "STextInput");
|
||||
|
||||
hyprListener_surfaceDestroyed.initCallback(
|
||||
&pSurface->events.destroy,
|
||||
[this](void* owner, void* data) {
|
||||
if (!focusedSurface)
|
||||
return;
|
||||
|
||||
focusedSurface = nullptr;
|
||||
hyprListener_surfaceUnmapped.removeCallback();
|
||||
hyprListener_surfaceDestroyed.removeCallback();
|
||||
g_pInputManager->m_sIMERelay.removeSurfaceToPTI(this);
|
||||
},
|
||||
this, "STextInput");
|
||||
}
|
||||
|
|
@ -295,10 +295,14 @@ struct STextInput {
|
|||
STextInputV1* pV1Input = nullptr;
|
||||
wlr_surface* focusedSurface = nullptr;
|
||||
|
||||
void setFocusedSurface(wlr_surface* pSurface);
|
||||
|
||||
DYNLISTENER(textInputEnable);
|
||||
DYNLISTENER(textInputDisable);
|
||||
DYNLISTENER(textInputCommit);
|
||||
DYNLISTENER(textInputDestroy);
|
||||
DYNLISTENER(surfaceUnmapped);
|
||||
DYNLISTENER(surfaceDestroyed);
|
||||
};
|
||||
|
||||
struct SIMEKbGrab {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue