fix #559,fix wayland crashesm show/hide configview

pull/1/head
Michail Vourlakos 8 years ago
parent 31ad5d5a19
commit 4b8f3a4b33

@ -45,7 +45,7 @@ DockConfigView::DockConfigView(Plasma::Containment *containment, DockView *dockV
m_blockFocusLost(false), m_blockFocusLost(false),
m_dockView(dockView) m_dockView(dockView)
{ {
setupWaylandIntegration(); //setupWaylandIntegration();
setScreen(m_dockView->screen()); setScreen(m_dockView->screen());
@ -113,8 +113,8 @@ void DockConfigView::init()
kdeclarative.setupBindings(); kdeclarative.setupBindings();
auto source = QUrl::fromLocalFile(m_dockView->containment()->corona()->kPackage().filePath("lattedockconfigurationui")); auto source = QUrl::fromLocalFile(m_dockView->containment()->corona()->kPackage().filePath("lattedockconfigurationui"));
setSource(source); setSource(source);
syncGeometry(); //syncGeometry();
syncSlideEffect(); //syncSlideEffect();
} }
inline Qt::WindowFlags DockConfigView::wFlags() const inline Qt::WindowFlags DockConfigView::wFlags() const
@ -279,7 +279,8 @@ void DockConfigView::focusOutEvent(QFocusEvent *ev)
return; return;
if (!m_blockFocusLost) { if (!m_blockFocusLost) {
hide(); setVisible(false);
//hide();
} }
} }
@ -307,6 +308,8 @@ void DockConfigView::setupWaylandIntegration()
qDebug() << "wayland dock window surface was created..."; qDebug() << "wayland dock window surface was created...";
m_shellSurface = interface->createSurface(s, this); m_shellSurface = interface->createSurface(s, this);
syncGeometry();
} }
} }
@ -343,7 +346,8 @@ bool DockConfigView::event(QEvent *e)
void DockConfigView::immutabilityChanged(Plasma::Types::ImmutabilityType type) void DockConfigView::immutabilityChanged(Plasma::Types::ImmutabilityType type)
{ {
if (type != Plasma::Types::Mutable && isVisible()) { if (type != Plasma::Types::Mutable && isVisible()) {
hide(); setVisible(false);
//hide();
} }
} }
@ -365,7 +369,8 @@ void DockConfigView::addPanelSpacer()
void DockConfigView::hideConfigWindow() void DockConfigView::hideConfigWindow()
{ {
hide(); setVisible(false);
//hide();
} }

@ -91,7 +91,7 @@ private:
QTimer m_screenSyncTimer; QTimer m_screenSyncTimer;
QList<QMetaObject::Connection> connections; QList<QMetaObject::Connection> connections;
QPointer<KWayland::Client::PlasmaShellSurface> m_shellSurface; KWayland::Client::PlasmaShellSurface *m_shellSurface{nullptr};
}; };
} }

@ -143,7 +143,7 @@ DockView::~DockView()
//! this->disconnect(); //! this->disconnect();
if (m_configView) if (m_configView)
m_configView->hide(); m_configView->setVisible(false);//hide();
if (m_visibility) if (m_visibility)
delete m_visibility; delete m_visibility;
@ -440,19 +440,23 @@ void DockView::showConfigurationInterface(Plasma::Applet *applet)
if (m_configView && c && c->isContainment() && c == this->containment()) { if (m_configView && c && c->isContainment() && c == this->containment()) {
if (m_configView->isVisible()) { if (m_configView->isVisible()) {
m_configView->hide(); m_configView->setVisible(false);
//m_configView->hide();
} else { } else {
m_configView->show(); m_configView->setVisible(true);
//m_configView->show();
} }
return; return;
} else if (m_configView) { } else if (m_configView) {
if (m_configView->applet() == applet) { if (m_configView->applet() == applet) {
m_configView->show(); m_configView->setVisible(true);
//m_configView->show();
m_configView->requestActivate(); m_configView->requestActivate();
return; return;
} else { } else {
m_configView->hide(); m_configView->setVisible(false);
//m_configView->hide();
m_configView->deleteLater(); m_configView->deleteLater();
} }
} }
@ -469,12 +473,19 @@ void DockView::showConfigurationInterface(Plasma::Applet *applet)
m_configView.data()->init(); m_configView.data()->init();
if (!delayConfigView) { if (!delayConfigView) {
m_configView.data()->show(); m_configView->setVisible(true);
//m_configView.data()->show();
} else { } else {
//add a timer for showing the configuration window the first time it is //add a timer for showing the configuration window the first time it is
//created in order to give the containmnent's layouts the time to //created in order to give the containmnent's layouts the time to
//calculate the window's height //calculate the window's height
QTimer::singleShot(150, m_configView, SLOT(show())); if (!KWindowSystem::isPlatformWayland()) {
QTimer::singleShot(150, m_configView, SLOT(show()));
} else {
QTimer::singleShot(150, [this]() {
m_configView->setVisible(true);
});
}
} }
} }

Loading…
Cancel
Save