From 314b5327b6494756882817e8507c43995ec427a5 Mon Sep 17 00:00:00 2001 From: Xaver Hugl Date: Fri, 21 Oct 2022 21:14:42 +0200 Subject: [PATCH] inputpanelv1window: never hide overlay panels Hiding them never makes sense, and the protocol specifies that the show and hide requests are about virtual keyboards, not about overlay planels. --- src/inputpanelv1window.cpp | 12 ++++++------ src/inputpanelv1window.h | 4 ++-- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/inputpanelv1window.cpp b/src/inputpanelv1window.cpp index 1191847d20..719aaf028d 100644 --- a/src/inputpanelv1window.cpp +++ b/src/inputpanelv1window.cpp @@ -53,7 +53,7 @@ void InputPanelV1Window::showOverlayPanel() void InputPanelV1Window::showTopLevel(OutputInterface *output, InputPanelSurfaceV1Interface::Position position) { Q_UNUSED(position); - m_mode = Mode::Toplevel; + m_mode = Mode::VirtualKeyboard; setOutput(output); maybeShow(); } @@ -66,14 +66,14 @@ void InputPanelV1Window::allow() void InputPanelV1Window::show() { - m_shouldBeShown = true; + m_virtualKeyboardShouldBeShown = true; maybeShow(); } void InputPanelV1Window::hide() { - m_shouldBeShown = false; - if (readyForPainting()) { + m_virtualKeyboardShouldBeShown = false; + if (readyForPainting() && m_mode != Mode::Overlay) { hideClient(); } } @@ -88,7 +88,7 @@ void KWin::InputPanelV1Window::reposition() case Mode::None: { // should never happen }; break; - case Mode::Toplevel: { + case Mode::VirtualKeyboard: { QSizeF panelSize = surface()->size(); if (!panelSize.isValid() || panelSize.isEmpty()) { return; @@ -203,7 +203,7 @@ void InputPanelV1Window::handleMapped() void InputPanelV1Window::maybeShow() { - const bool shouldShow = m_mode == Mode::Overlay || (m_mode == Mode::Toplevel && m_allowed && m_shouldBeShown); + const bool shouldShow = m_mode == Mode::Overlay || (m_mode == Mode::VirtualKeyboard && m_allowed && m_virtualKeyboardShouldBeShown); if (shouldShow && !isZombie() && surface()->isMapped()) { setReadyForPainting(); reposition(); diff --git a/src/inputpanelv1window.h b/src/inputpanelv1window.h index a315a7f444..7fba3d7af3 100644 --- a/src/inputpanelv1window.h +++ b/src/inputpanelv1window.h @@ -25,7 +25,7 @@ public: enum class Mode { None, - Toplevel, + VirtualKeyboard, Overlay, }; Q_ENUM(Mode) @@ -95,7 +95,7 @@ private: QPointer m_output; Mode m_mode = Mode::None; bool m_allowed = false; - bool m_shouldBeShown = false; + bool m_virtualKeyboardShouldBeShown = false; const QPointer m_panelSurface; };