@ -112,7 +112,8 @@ DockView::~DockView()
void DockView : : init ( )
{
connect ( this , & DockView : : screenChanged , this , & DockView : : adaptToScreen ) ;
//connect(this, &DockView::screenChanged, this, &DockView::syncGeometry);
connect ( qGuiApp , & QGuiApplication : : primaryScreenChanged , this , & DockView : : syncGeometry , Qt : : UniqueConnection ) ;
connect ( this , & DockView : : screenGeometryChanged , this , & DockView : : syncGeometry ) ;
connect ( this , & QQuickWindow : : widthChanged , this , & DockView : : widthChanged ) ;
connect ( this , & QQuickWindow : : heightChanged , this , & DockView : : heightChanged ) ;
@ -142,6 +143,8 @@ void DockView::adaptToScreen(QScreen *screen)
return ;
}
qDebug ( ) < < " adapting to screen... " ;
setScreen ( screen ) ;
//FIXME:: This code in a multi-screen environment that
@ -313,6 +316,7 @@ void DockView::updatePosition()
case Plasma : : Types : : BottomEdge :
screenGeometry = this - > screen ( ) - > geometry ( ) ;
qDebug ( ) < < " screen geometry: " < < screenGeometry ;
if ( m_drawShadows ) {
position = { screenGeometry . x ( ) + length ( screenGeometry . width ( ) ) ,
@ -361,6 +365,10 @@ inline void DockView::syncGeometry()
if ( ! ( this - > screen ( ) & & this - > containment ( ) ) )
return ;
if ( qGuiApp - > primaryScreen ( ) & & screen ( ) ! = qGuiApp - > primaryScreen ( ) ) {
setScreen ( qGuiApp - > primaryScreen ( ) ) ;
}
updateEnabledBorders ( ) ;
resizeWindow ( ) ;
updatePosition ( ) ;