delay showing popups until the next processing of events
allows things like hidden panels to show before calculating where to show the popup BUG:288999
This commit is contained in:
parent
645439c299
commit
1b2d92c085
@ -600,6 +600,9 @@ void PopupApplet::timerEvent(QTimerEvent *event)
|
||||
d->autohideTimer->stop();
|
||||
}
|
||||
}
|
||||
} else if (event->timerId() == d->showDialogTimer.timerId()) {
|
||||
d->showDialogTimer.stop();
|
||||
d->showDialog();
|
||||
} else {
|
||||
Applet::timerEvent(event);
|
||||
}
|
||||
@ -607,6 +610,7 @@ void PopupApplet::timerEvent(QTimerEvent *event)
|
||||
|
||||
void PopupApplet::hidePopup()
|
||||
{
|
||||
d->showDialogTimer.stop();
|
||||
d->delayedShowTimer.stop();
|
||||
|
||||
Dialog *dialog = d->dialogPtr.data();
|
||||
@ -748,24 +752,34 @@ void PopupAppletPrivate::internalTogglePopup(bool fromActivatedSignal)
|
||||
}
|
||||
|
||||
ToolTipManager::self()->hide(q);
|
||||
updateDialogPosition();
|
||||
showDialogTimer.start(0, q);
|
||||
}
|
||||
}
|
||||
|
||||
KWindowSystem::setOnAllDesktops(dialog->winId(), true);
|
||||
KWindowSystem::setState(dialog->winId(), NET::SkipTaskbar | NET::SkipPager);
|
||||
void PopupAppletPrivate::showDialog()
|
||||
{
|
||||
Plasma::Dialog *dialog = dialogPtr.data();
|
||||
if (!dialog) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (icon) {
|
||||
dialog->setAspectRatioMode(savedAspectRatio);
|
||||
}
|
||||
updateDialogPosition();
|
||||
|
||||
if (q->location() != Floating) {
|
||||
dialog->animatedShow(locationToDirection(q->location()));
|
||||
} else {
|
||||
dialog->show();
|
||||
}
|
||||
KWindowSystem::setOnAllDesktops(dialog->winId(), true);
|
||||
KWindowSystem::setState(dialog->winId(), NET::SkipTaskbar | NET::SkipPager);
|
||||
|
||||
if (!(dialog->windowFlags() & Qt::X11BypassWindowManagerHint)) {
|
||||
KWindowSystem::activateWindow(dialog->winId());
|
||||
}
|
||||
if (icon) {
|
||||
dialog->setAspectRatioMode(savedAspectRatio);
|
||||
}
|
||||
|
||||
if (q->location() != Floating) {
|
||||
dialog->animatedShow(locationToDirection(q->location()));
|
||||
} else {
|
||||
dialog->show();
|
||||
}
|
||||
|
||||
if (!(dialog->windowFlags() & Qt::X11BypassWindowManagerHint)) {
|
||||
KWindowSystem::activateWindow(dialog->winId());
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -107,6 +107,7 @@ void PlasmoidPackage::createNewWidgetBrowser(QWidget *parent)
|
||||
KNS3::DownloadDialog *knsDialog = m_knsDialog.data();
|
||||
if (!knsDialog) {
|
||||
m_knsDialog = knsDialog = new KNS3::DownloadDialog("plasmoids.knsrc", parent);
|
||||
knsDialog->setProperty("DoNotCloseController", true);
|
||||
connect(knsDialog, SIGNAL(accepted()), this, SIGNAL(newWidgetBrowserFinished()));
|
||||
}
|
||||
|
||||
|
@ -36,6 +36,7 @@ public:
|
||||
|
||||
void iconSizeChanged(int group);
|
||||
void internalTogglePopup(bool fromActivatedSignal = false);
|
||||
void showDialog();
|
||||
void hideTimedPopup();
|
||||
void clearPopupLostFocus();
|
||||
void dialogSizeChanged();
|
||||
@ -61,6 +62,7 @@ public:
|
||||
Plasma::AspectRatioMode savedAspectRatio;
|
||||
QTimer *autohideTimer;
|
||||
QBasicTimer delayedShowTimer;
|
||||
QBasicTimer showDialogTimer;
|
||||
QPoint clicked;
|
||||
ItemStatus preShowStatus;
|
||||
bool popupLostFocus : 1;
|
||||
|
Loading…
Reference in New Issue
Block a user