fix crash with qt5.9 and wayland

--the show() function of a wayland surface shouldnt
be called before the surface is created. In other case
in qt 5.9 creates a crash
pull/1/head
Michail Vourlakos 8 years ago
parent ab045b2e9d
commit 111d59e1c5

@ -842,14 +842,15 @@ void DockCorona::addDock(Plasma::Containment *containment, int expDockScreen)
bool onPrimary = containment->config().readEntry("onPrimary", true);
int id = containment->screen();
if (id == -1 && expDockScreen==-1) {
if (id == -1 && expDockScreen == -1) {
id = containment->lastScreen();
}
if (expDockScreen>-1) {
if (expDockScreen > -1) {
id = expDockScreen;
}
qDebug() << "add dock - containment id : " << id << " onprimary:"<<onPrimary<<" forceDockLoad:"<<forceDockLoading;
qDebug() << "add dock - containment id : " << id << " onprimary:" << onPrimary << " forceDockLoad:" << forceDockLoading;
if (id >= 0 && !onPrimary && !forceDockLoading) {
QString connector = m_screenPool->connector(id);
@ -903,7 +904,8 @@ void DockCorona::addDock(Plasma::Containment *containment, int expDockScreen)
connect(containment, &Plasma::Containment::appletAlternativesRequested
, this, &DockCorona::showAlternativesForApplet, Qt::QueuedConnection);
dockView->show();
//! Qt 5.9 creates a crash for this in wayland
//dockView->show();
m_dockViews[containment] = dockView;
if (m_waitingSessionDocksCreation) {
@ -1228,12 +1230,12 @@ void DockCorona::copyDock(Plasma::Containment *containment)
emit containmentAdded(newContainment);
emit containmentCreated(newContainment);
if (setOnExplicitScreen && copyScrId>-1) {
qDebug()<< "Copy Dock in explicit screen ::: " << copyScrId;
if (setOnExplicitScreen && copyScrId > -1) {
qDebug() << "Copy Dock in explicit screen ::: " << copyScrId;
addDock(newContainment, copyScrId);
newContainment->reactToScreenChange();
} else {
qDebug()<< "Copy Dock in current screen...";
qDebug() << "Copy Dock in current screen...";
addDock(newContainment);
}
}

@ -58,13 +58,6 @@ DockView::DockView(Plasma::Corona *corona, QScreen *targetScreen, bool dockWindo
: PlasmaQuick::ContainmentView(corona),
m_contextMenu(nullptr)
{
//! S1.1: the only way I found in order to solve kwin shadows issue in combinations of S1.2
//! this way we avoid an issue of kwin creating shadows for
//! the secondary, third dock
if (!KWindowSystem::isPlatformWayland()) {
setVisible(false);
}
setTitle(corona->kPackage().metadata().name());
setIcon(qGuiApp->windowIcon());
setResizeMode(QuickViewSharedEngine::SizeRootObjectToView);
@ -84,10 +77,6 @@ DockView::DockView(Plasma::Corona *corona, QScreen *targetScreen, bool dockWindo
setFlags(flags | Qt::BypassWindowManagerHint);
}
//! S1.2: setup the wayland early enough and after the flags settings
//! this way we avoid an issue of kwin creating shadows for
//! the secondary, third dock
setupWaylandIntegration();
KWindowSystem::setOnAllDesktops(winId(), true);
if (targetScreen)
@ -221,8 +210,13 @@ void DockView::init()
}
setSource(corona()->kPackage().filePath("lattedockui"));
setVisible(true);
// setVisible(true);
syncGeometry();
if (!KWindowSystem::isPlatformWayland()) {
setVisible(true);
}
qDebug() << "SOURCE:" << source();
}

Loading…
Cancel
Save