fixes for config windows

work/m_layershell
Michail Vourlakos 3 years ago
parent 1573c2ce78
commit 780e203bce

@ -179,12 +179,7 @@ void CanvasConfigView::focusOutEvent(QFocusEvent *ev)
void CanvasConfigView::hideConfigWindow()
{
if (KWindowSystem::isPlatformWayland()) {
//!NOTE: Avoid crash in wayland environment with qt5.9
close();
} else {
hide();
}
hide();
}
//!BEGIN borders

@ -109,7 +109,7 @@ void PrimaryConfigView::init()
auto source = QUrl::fromLocalFile(m_latteView->containment()->corona()->kPackage().filePath(tempFilePath));
setSource(source);
//syncGeometry();
syncGeometry();
}
Config::IndicatorUiManager *PrimaryConfigView::indicatorUiManager()
@ -164,13 +164,7 @@ void PrimaryConfigView::showConfigWindow()
void PrimaryConfigView::hideConfigWindow()
{
if (KWindowSystem::isPlatformWayland()) {
//!NOTE: Avoid crash in wayland environment with qt5.9
close();
} else {
hide();
}
hide();
hideCanvasWindow();
hideSecondaryWindow();
}
@ -402,13 +396,13 @@ void PrimaryConfigView::syncGeometry()
m_geometryWhenVisible = geometry;
qDebug() << "org.kde.layer ::: SETTING PRIMARY CONFIG WINDOW :::: " << m_geometryWhenVisible << " avail geometry :: " << m_availableScreenGeometry;
m_corona->wm()->setWindowPosition(this, m_latteView->location(), m_geometryWhenVisible);
setMaximumSize(geometry.size());
setMinimumSize(geometry.size());
resize(geometry.size());
qDebug() << "org.kde.layer ::: SETTING PRIMARY CONFIG WINDOW :::: " << m_geometryWhenVisible << " avail geometry :: " << m_availableScreenGeometry;
m_corona->wm()->setWindowPosition(this, m_latteView->location(), m_geometryWhenVisible);
emit m_latteView->configWindowGeometryChanged();
}

@ -203,12 +203,7 @@ void SecondaryConfigView::focusOutEvent(QFocusEvent *ev)
void SecondaryConfigView::hideConfigWindow()
{
if (KWindowSystem::isPlatformWayland()) {
//!NOTE: Avoid crash in wayland environment with qt5.9
close();
} else {
hide();
}
hide();
}
void SecondaryConfigView::updateEffects()

@ -75,7 +75,7 @@ SubConfigView::SubConfigView(Latte::View *view, const QString &title, const bool
connections << connect(&m_showTimer, &QTimer::timeout, this, [this]() {
syncSlideEffect();
// show();
show();
});
}

@ -503,7 +503,12 @@ void WaylandInterface::setWindowPosition(QWindow *window, const Plasma::Types::L
QMargins margins;
LayerShellQt::Window::Anchors anchors = 0;
if (location == Plasma::Types::TopEdge || location == Plasma::Types::LeftEdge) {
anchors = LayerShellQt::Window::AnchorTop;
anchors = anchors | LayerShellQt::Window::AnchorLeft;
margins.setTop(geometry.top() - window->screen()->geometry().top());
margins.setLeft(geometry.left() - window->screen()->geometry().left());
/*if (location == Plasma::Types::TopEdge || location == Plasma::Types::LeftEdge) {
anchors = LayerShellQt::Window::AnchorTop;
anchors = anchors | LayerShellQt::Window::AnchorLeft;
margins.setTop(geometry.top() - window->screen()->geometry().top());
@ -519,7 +524,9 @@ void WaylandInterface::setWindowPosition(QWindow *window, const Plasma::Types::L
anchors = anchors | LayerShellQt::Window::AnchorLeft;
margins.setBottom(window->screen()->geometry().bottom() - geometry.bottom());
margins.setLeft(geometry.left() - window->screen()->geometry().left());
}
//! when window changes height the kwin wm is not taking into account the anchoring.
//! Such an example is when PrimaryConfigView changes from normal to advanced mode and back
}*/
layerWindow->setAnchors(anchors);
layerWindow->setMargins(margins);

Loading…
Cancel
Save