remove gtk_frame_extents from window geometries

--under x11 environment remove the gtk_frame_extents that
are used for shadows under plasma environment

BUG:417856
pull/11/head
Michail Vourlakos 5 years ago
parent ef3a59e836
commit d3b5e2c4eb

@ -332,6 +332,23 @@ void XWindowInterface::setActiveEdge(QWindow *view, bool active) const
xcb_change_property(c, XCB_PROP_MODE_REPLACE, window->winId(), atom->atom, XCB_ATOM_CARDINAL, 32, 1, &value);
}
#if KF5_VERSION_MINOR >= 65
QRect XWindowInterface::visibleGeometry(const WindowId &wid, const QRect &frameGeometry) const
{
NETWinInfo ni(QX11Info::connection(), wid.toUInt(), QX11Info::appRootWindow(), 0, NET::WM2GTKFrameExtents);
NETStrut struts = ni.gtkFrameExtents();
QMargins margins(struts.left, struts.top, struts.right, struts.bottom);
QRect visibleGeometry = frameGeometry;
if (!margins.isNull()) {
visibleGeometry -= margins;
}
return visibleGeometry;
}
#endif
WindowInfoWrap XWindowInterface::requestInfoActive() const
{
return requestInfo(KWindowSystem::activeWindow());
@ -367,7 +384,11 @@ WindowInfoWrap XWindowInterface::requestInfo(WindowId wid) const
winfoWrap.setIsShaded(winfo.hasState(NET::Shaded));
winfoWrap.setIsOnAllDesktops(winfo.onAllDesktops());
winfoWrap.setIsOnAllActivities(winfo.activities().empty());
#if KF5_VERSION_MINOR >= 65
winfoWrap.setGeometry(visibleGeometry(wid, winfo.frameGeometry()));
#else
winfoWrap.setGeometry(winfo.frameGeometry());
#endif
winfoWrap.setIsKeepAbove(winfo.hasState(NET::KeepAbove));
winfoWrap.setIsKeepBelow(winfo.hasState(NET::KeepBelow));
winfoWrap.setHasSkipTaskbar(winfo.hasState(NET::SkipTaskbar));

@ -22,6 +22,7 @@
#define XWINDOWINTERFACE_H
// local
#include <config-latte.h>
#include "abstractwindowinterface.h"
#include "windowinfowrap.h"
@ -86,6 +87,10 @@ private:
bool isValidWindow(const KWindowInfo &winfo) const;
bool isFullScreenWindow(WindowId wid) const;
#if KF5_VERSION_MINOR >= 65
QRect visibleGeometry(const WindowId &wid, const QRect &frameGeometry) const;
#endif
bool isAcceptableWindow(WId wid);
void windowAddedProxy(WId wid);
void windowChangedProxy(WId wid, NET::Properties prop1, NET::Properties2 prop2);

Loading…
Cancel
Save