Commit b842ea4b authored by Waqar Ahmed's avatar Waqar Ahmed
Browse files

Use Hide/Show to add/remove us as active client

Much better than working with focus.
parent 979fe01b
Pipeline #89303 passed with stage
in 2 minutes and 50 seconds
......@@ -156,10 +156,12 @@ void CEWidget::setViewAsActiveXMLGuiClient()
bool CEWidget::eventFilter(QObject *o, QEvent *e)
{
if (o == m_textEditor->focusProxy() && e->type() == QEvent::FocusIn) {
// We live in a stacked widget in kateviewspace
// use hide/show to figure out when we are not active
if (e->type() == QEvent::Show) {
setViewAsActiveXMLGuiClient();
return QWidget::eventFilter(o, e);
} else if (o == m_textEditor->focusProxy() && e->type() == QEvent::FocusOut) {
} else if (e->type() == QEvent::Hide) {
removeViewAsActiveXMLGuiClient();
return QWidget::eventFilter(o, e);
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment