This is a workaround for a possible bug in KRootPixmap. After resizing
Konsole with multiple sessions and switching to another session, the
tab widget sends resize events, but obviously KRootPixmap isn't able
to handle them correctly.
Please try if it also fixes #71213 and similar.

CCMAIL: 66843-done@bugs.kde.org, 71213@bugs.kde.org, jansen@kde.org

svn path=/trunk/kdebase/konsole/; revision=312965
wilder-portage
Sandro Giessl 22 years ago
parent 48bcfde4ab
commit 8bdbccd8ed
  1. 21
      konsole/konsole.cpp
  2. 1
      konsole/konsole.h

@ -880,6 +880,7 @@ void Konsole::makeGUI()
void Konsole::makeTabWidget()
{
tabwidget = new KTabWidget(this);
tabwidget->installEventFilter(this);
tabwidget->setTabReorderingEnabled(true);
if (n_tabbar==TabTop)
tabwidget->setTabPosition(QTabWidget::Top);
@ -942,6 +943,21 @@ bool Konsole::eventFilter( QObject *o, QEvent *ev )
}
}
}
else if (o == tabwidget)
{
// There is probably a bug in KRootPixmap which makes this workaround
// neccesary:
// Mark the background of invisible TEWidgets dirty so they can be
// repainted when they are displayed next.
if (tabwidget && ev->type() == QEvent::Resize) {
for(int i = 0; i < tabwidget->count(); i++) {
QWidget *page = tabwidget->page(i);
if (page != tabwidget->currentPage()) {
rootxpmsDirty[page] = true;
}
}
}
}
return KMainWindow::eventFilter(o, ev);
}
@ -2425,6 +2441,11 @@ void Konsole::activateSession(QWidget* w)
{
activateSession(tabwidget->indexOf(w));
w->setFocus();
if( rootxpmsDirty[w] ) {
// force repaint!
rootxpms[w]->repaint(true);
rootxpmsDirty.remove(w);
}
}
void Konsole::activateSession(const QString &sessionId)

@ -284,6 +284,7 @@ private:
ColorSchemaList* colors;
QPtrDict<KRootPixmap> rootxpms;
QMap<QWidget*, bool> rootxpmsDirty;
KWinModule* kWinModule;
KMenuBar* menubar;

Loading…
Cancel
Save