Change InputMethod::show() and InputMethod::hide() to not change active state.
Qt usually request InputMethod::hide() upon unfocus, but InputMethod::show() is actually never called if focus transfer is done by keyboard, which leads to a permanent disabled input method state. It can be easily reproduced with a window with two text field, e.g. QFileDialog, by pressing tab to switch the focused widget. The semantics of hide/show should not deactivate the input method. Instead, it should simply hide/show the input panel. Also it should not be a hard request for input method to permanently hide the window. When input method asked to show it again, the input panel window should be shown.
This commit is contained in:
parent
119f0d02be
commit
4f2c3a00c4
2 changed files with 15 additions and 1 deletions
|
@ -111,12 +111,24 @@ void InputMethod::init()
|
|||
|
||||
void InputMethod::show()
|
||||
{
|
||||
if (m_inputClient) {
|
||||
m_inputClient->showClient();
|
||||
updateInputPanelState();
|
||||
}
|
||||
setActive(true);
|
||||
}
|
||||
|
||||
void InputMethod::hide()
|
||||
{
|
||||
setActive(false);
|
||||
if (m_inputClient) {
|
||||
m_inputClient->hideClient();
|
||||
updateInputPanelState();
|
||||
}
|
||||
auto inputContext = waylandServer()->inputMethod()->context();
|
||||
if (!inputContext) {
|
||||
return;
|
||||
}
|
||||
inputContext->sendReset();
|
||||
}
|
||||
|
||||
bool InputMethod::touchEventTriggered() const
|
||||
|
|
|
@ -49,6 +49,7 @@ void InputPanelV1Client::showOverlayPanel()
|
|||
setOutput(nullptr);
|
||||
m_mode = Overlay;
|
||||
reposition();
|
||||
showClient();
|
||||
setReadyForPainting();
|
||||
}
|
||||
|
||||
|
@ -57,6 +58,7 @@ void InputPanelV1Client::showTopLevel(OutputInterface *output, InputPanelSurface
|
|||
Q_UNUSED(position);
|
||||
m_mode = Toplevel;
|
||||
setOutput(output);
|
||||
showClient();
|
||||
}
|
||||
|
||||
void InputPanelV1Client::allow()
|
||||
|
|
Loading…
Reference in a new issue