Changeset View
Changeset View
Standalone View
Standalone View
src/plasmaquick/dialog.cpp
Show First 20 Lines • Show All 199 Lines • ▼ Show 20 Line(s) | 169 | { | |||
---|---|---|---|---|---|
200 | return avail; | 200 | return avail; | ||
201 | } | 201 | } | ||
202 | 202 | | |||
203 | void DialogPrivate::syncBorders(const QRect& geom) | 203 | void DialogPrivate::syncBorders(const QRect& geom) | ||
204 | { | 204 | { | ||
205 | QRect avail = availableScreenGeometryForPosition(geom.topLeft()); | 205 | QRect avail = availableScreenGeometryForPosition(geom.topLeft()); | ||
206 | int borders = Plasma::FrameSvg::AllBorders; | 206 | int borders = Plasma::FrameSvg::AllBorders; | ||
207 | 207 | | |||
208 | QWindow *parentWindow = q->transientParent(); | ||||
209 | bool inDock = parentWindow && !parentWindow->mask().isNull() && KWindowSystem::compositingActive(); | ||||
davidedmundson: How does parentWindow->mask relate to being a dock or not?
Also we need to be a bit careful… | |||||
The idea was first introduced at popupPlacement() in dialog.cpp. It is based on the assumption that by design plasma panels do not use mask() because their shadows are drawn external from the window and most of the docks (e.g. Plank,Latte) are using masking for almost all of their operations. Do you believe there is a better way to distinguish between docks and panels ? mvourlakos: The idea was first introduced at popupPlacement() in dialog.cpp.
In order to distinguish docks… | |||||
210 | | ||||
208 | //Tooltips always have all the borders | 211 | //Tooltips always have all the borders | ||
209 | // floating windows have all borders | 212 | // floating windows have all borders | ||
210 | if (!q->flags().testFlag(Qt::ToolTip) && location != Plasma::Types::Floating) { | 213 | // popup windows from docks have all borders | ||
214 | if (!q->flags().testFlag(Qt::ToolTip) && location != Plasma::Types::Floating && !inDock) { | ||||
211 | if (geom.x() <= avail.x() || location == Plasma::Types::LeftEdge) { | 215 | if (geom.x() <= avail.x() || location == Plasma::Types::LeftEdge) { | ||
212 | borders = borders & ~Plasma::FrameSvg::LeftBorder; | 216 | borders = borders & ~Plasma::FrameSvg::LeftBorder; | ||
213 | } | 217 | } | ||
214 | if (geom.y() <= avail.y() || location == Plasma::Types::TopEdge) { | 218 | if (geom.y() <= avail.y() || location == Plasma::Types::TopEdge) { | ||
215 | borders = borders & ~Plasma::FrameSvg::TopBorder; | 219 | borders = borders & ~Plasma::FrameSvg::TopBorder; | ||
216 | } | 220 | } | ||
217 | if (avail.right() <= geom.x() + geom.width() || location == Plasma::Types::RightEdge) { | 221 | if (avail.right() <= geom.x() + geom.width() || location == Plasma::Types::RightEdge) { | ||
218 | borders = borders & ~Plasma::FrameSvg::RightBorder; | 222 | borders = borders & ~Plasma::FrameSvg::RightBorder; | ||
▲ Show 20 Lines • Show All 1188 Lines • Show Last 20 Lines |
How does parentWindow->mask relate to being a dock or not?
Also we need to be a bit careful on names.
_NET_WM_WINDOW_TYPE_DOCK is all panels, including the standard plasma one.