improve some functionality used

pull/11/head
Michail Vourlakos 5 years ago
parent 72777d18c1
commit 3554c4a006

@ -166,6 +166,11 @@ int Positioner::currentScreenId() const
return -1; return -1;
} }
Latte::WindowSystem::WindowId Positioner::trackedWindowId()
{
return m_trackedWindowId;
}
QString Positioner::currentScreenName() const QString Positioner::currentScreenName() const
{ {
return m_screenToFollowId; return m_screenToFollowId;
@ -450,7 +455,7 @@ QRect Positioner::maximumNormalGeometry()
&& m_view->visibility()->mode() != Latte::Types::WindowsAlwaysCover) { && m_view->visibility()->mode() != Latte::Types::WindowsAlwaysCover) {
KWindowSystem::setState(m_view->winId(), NET::KeepAbove); KWindowSystem::setState(m_view->winId(), NET::KeepAbove);
} else { } else {
KWindowSystem::clearState(m_view->winId(), NET::KeepAbove); // KWindowSystem::clearState(m_view->winId(), NET::KeepAbove);
} }
return maxGeometry; return maxGeometry;

@ -63,6 +63,8 @@ public:
void reconsiderScreen(); void reconsiderScreen();
Latte::WindowSystem::WindowId trackedWindowId();
public slots: public slots:
Q_INVOKABLE void hideDockDuringLocationChange(int goToLocation); Q_INVOKABLE void hideDockDuringLocationChange(int goToLocation);
Q_INVOKABLE void hideDockDuringMovingToLayout(QString layoutName); Q_INVOKABLE void hideDockDuringMovingToLayout(QString layoutName);

@ -142,11 +142,6 @@ void VisibilityManager::setMode(Latte::Types::Visibility mode)
m_mode = mode; m_mode = mode;
if (mode != Types::AlwaysVisible && mode != Types::WindowsGoBelow) { if (mode != Types::AlwaysVisible && mode != Types::WindowsGoBelow) {
//set wayland visibility mode
if (m_latteView->surface()) {
m_latteView->surface()->setPanelBehavior(KWayland::Client::PlasmaShellSurface::PanelBehavior::WindowsGoBelow);
}
m_connections[0] = connect(m_wm, &WindowSystem::AbstractWindowInterface::currentDesktopChanged, this, [&] { m_connections[0] = connect(m_wm, &WindowSystem::AbstractWindowInterface::currentDesktopChanged, this, [&] {
if (m_raiseOnDesktopChange) { if (m_raiseOnDesktopChange) {
raiseViewTemporarily(); raiseViewTemporarily();
@ -161,11 +156,6 @@ void VisibilityManager::setMode(Latte::Types::Visibility mode)
}); });
base = 2; base = 2;
} else {
//set wayland visibility mode
if (m_latteView->surface()) {
m_latteView->surface()->setPanelBehavior(KWayland::Client::PlasmaShellSurface::PanelBehavior::AutoHide);
}
} }
switch (m_mode) { switch (m_mode) {
@ -237,6 +227,9 @@ void VisibilityManager::setMode(Latte::Types::Visibility mode)
case Types::WindowsGoBelow: case Types::WindowsGoBelow:
break; break;
case Types::WindowsAlwaysCover:
break;
default: default:
break; break;
} }

@ -342,13 +342,11 @@ WindowInfoWrap XWindowInterface::requestInfo(WindowId wid) const
| NET::WM2TransientFor}; | NET::WM2TransientFor};
//! update desktop id //! update desktop id
bool isDesktop{false}; bool isDesktop{false};
if (winfo.windowClassName() == "plasmashell" && isPlasmaDesktop(winfo.geometry())) { if (winfo.windowClassName() == "plasmashell" && isPlasmaDesktop(winfo.geometry())) {
isDesktop = true; isDesktop = true;
windowsTracker()->setPlasmaDesktop(wid); windowsTracker()->setPlasmaDesktop(wid);
} }
WindowInfoWrap winfoWrap; WindowInfoWrap winfoWrap;
if (!winfo.valid()) { if (!winfo.valid()) {
@ -556,43 +554,27 @@ void XWindowInterface::requestToggleKeepAbove(WindowId wid) const
void XWindowInterface::setKeepAbove(WindowId wid, bool active) const void XWindowInterface::setKeepAbove(WindowId wid, bool active) const
{ {
WindowInfoWrap wInfo = requestInfo(wid); if (wid.toUInt() <= 0) {
if (!wInfo.isValid() || wInfo.isPlasmaDesktop()) {
return; return;
} }
NETWinInfo ni(QX11Info::connection(), wid.toUInt(), QX11Info::appRootWindow(), NET::WMState, NET::Properties2()); if (active) {
KWindowSystem::setState(wid.toUInt(), NET::KeepAbove);
if ((wInfo.isKeepAbove() && active) || (!wInfo.isKeepAbove() && !active)) {
return;
}
if (wInfo.isKeepAbove()) {
ni.setState(NET::States(), NET::StaysOnTop);
} else { } else {
ni.setState(NET::StaysOnTop, NET::StaysOnTop); KWindowSystem::clearState(wid.toUInt(), NET::KeepAbove);
} }
} }
void XWindowInterface::setKeepBelow(WindowId wid, bool active) const void XWindowInterface::setKeepBelow(WindowId wid, bool active) const
{ {
WindowInfoWrap wInfo = requestInfo(wid); if (wid.toUInt() <= 0) {
if (!wInfo.isValid() || wInfo.isPlasmaDesktop()) {
return;
}
NETWinInfo ni(QX11Info::connection(), wid.toUInt(), QX11Info::appRootWindow(), NET::WMState, NET::Properties2());
if ((wInfo.isKeepBelow() && active) || (!wInfo.isKeepBelow() && !active)) {
return; return;
} }
if (wInfo.isKeepBelow()) { if (active) {
ni.setState(NET::States(), NET::KeepBelow); KWindowSystem::setState(wid.toUInt(), NET::KeepBelow);
} else { } else {
ni.setState(NET::KeepBelow, NET::KeepBelow); KWindowSystem::clearState(wid.toUInt(), NET::KeepBelow);
} }
} }

Loading…
Cancel
Save