From 9f2ed02f35232f0362db45d5f580025f5724500a Mon Sep 17 00:00:00 2001 From: Vaxry Date: Fri, 22 Mar 2024 23:08:52 +0000 Subject: IME/TI: Fixes and refactoring Fixes #5189 --- src/helpers/WLClasses.cpp | 36 ------------------------------------ src/helpers/WLClasses.hpp | 19 +------------------ 2 files changed, 1 insertion(+), 54 deletions(-) (limited to 'src/helpers') diff --git a/src/helpers/WLClasses.cpp b/src/helpers/WLClasses.cpp index 1c14567d..d46f7e40 100644 --- a/src/helpers/WLClasses.cpp +++ b/src/helpers/WLClasses.cpp @@ -244,39 +244,3 @@ 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"); -} \ No newline at end of file diff --git a/src/helpers/WLClasses.hpp b/src/helpers/WLClasses.hpp index 210405f6..a2e72282 100644 --- a/src/helpers/WLClasses.hpp +++ b/src/helpers/WLClasses.hpp @@ -288,23 +288,6 @@ struct SSwipeGesture { CMonitor* pMonitor = nullptr; }; -struct STextInputV1; - -struct STextInput { - wlr_text_input_v3* pWlrInput = nullptr; - 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 { wlr_input_method_keyboard_grab_v2* pWlrKbGrab = nullptr; @@ -319,7 +302,7 @@ struct SIMEPopup { int x, y; int realX, realY; bool visible; - Vector2D lastSize; + CBox lastBox; DYNLISTENER(mapPopup); DYNLISTENER(unmapPopup); -- cgit v1.2.3