Changeset View
Changeset View
Standalone View
Standalone View
src/plasmaquick/dialog.cpp
Show First 20 Lines • Show All 132 Lines • ▼ Show 20 Line(s) | 68 | public: | |||
---|---|---|---|---|---|
133 | void slotWindowPositionChanged(); | 133 | void slotWindowPositionChanged(); | ||
134 | 134 | | |||
135 | void syncToMainItemSize(); | 135 | void syncToMainItemSize(); | ||
136 | 136 | | |||
137 | bool mainItemContainsPosition(const QPointF &point) const; | 137 | bool mainItemContainsPosition(const QPointF &point) const; | ||
138 | QPointF positionAdjustedForMainItem(const QPointF &point) const; | 138 | QPointF positionAdjustedForMainItem(const QPointF &point) const; | ||
139 | 139 | | |||
140 | void setupWaylandIntegration(); | 140 | void setupWaylandIntegration(); | ||
141 | void syncWaylandWindowFlags(); | ||||
141 | 142 | | |||
142 | 143 | | |||
143 | Dialog *q; | 144 | Dialog *q; | ||
144 | Plasma::Types::Location location; | 145 | Plasma::Types::Location location; | ||
145 | Plasma::FrameSvgItem *frameSvgItem; | 146 | Plasma::FrameSvgItem *frameSvgItem; | ||
146 | QPointer<QQuickItem> mainItem; | 147 | QPointer<QQuickItem> mainItem; | ||
147 | QPointer<QQuickItem> visualParent; | 148 | QPointer<QQuickItem> visualParent; | ||
148 | QTimer hintsCommitTimer; | 149 | QTimer hintsCommitTimer; | ||
▲ Show 20 Lines • Show All 686 Lines • ▼ Show 20 Line(s) | 777 | { | |||
835 | } | 836 | } | ||
836 | } | 837 | } | ||
837 | 838 | | |||
838 | void DialogPrivate::slotMainItemSizeChanged() | 839 | void DialogPrivate::slotMainItemSizeChanged() | ||
839 | { | 840 | { | ||
840 | syncToMainItemSize(); | 841 | syncToMainItemSize(); | ||
841 | } | 842 | } | ||
842 | 843 | | |||
844 | void DialogPrivate::syncWaylandWindowFlags() | ||||
845 | { | ||||
846 | #if HAVE_KWAYLAND | ||||
847 | if (!shellSurface) { | ||||
848 | return; | ||||
849 | } | ||||
850 | if (q->flags() & Qt::WindowStaysOnTopHint) { | ||||
851 | shellSurface->setPopupBehavior(KWayland::Client::PlasmaShellSurface::PopupBehavior::AlwaysOnTop); | ||||
852 | } else { | ||||
853 | shellSurface->setPopupBehavior(0); | ||||
854 | } | ||||
855 | #endif | ||||
856 | } | ||||
857 | | ||||
843 | QQuickItem *Dialog::visualParent() const | 858 | QQuickItem *Dialog::visualParent() const | ||
844 | { | 859 | { | ||
845 | return d->visualParent; | 860 | return d->visualParent; | ||
846 | } | 861 | } | ||
847 | 862 | | |||
848 | void Dialog::setVisualParent(QQuickItem *visualParent) | 863 | void Dialog::setVisualParent(QQuickItem *visualParent) | ||
849 | { | 864 | { | ||
850 | if (d->visualParent == visualParent) { | 865 | if (d->visualParent == visualParent) { | ||
▲ Show 20 Lines • Show All 165 Lines • ▼ Show 20 Line(s) | |||||
1016 | QObject *Dialog::margins() const | 1031 | QObject *Dialog::margins() const | ||
1017 | { | 1032 | { | ||
1018 | return d->frameSvgItem->fixedMargins(); | 1033 | return d->frameSvgItem->fixedMargins(); | ||
1019 | } | 1034 | } | ||
1020 | 1035 | | |||
1021 | void Dialog::setFramelessFlags(Qt::WindowFlags flags) | 1036 | void Dialog::setFramelessFlags(Qt::WindowFlags flags) | ||
1022 | { | 1037 | { | ||
1023 | setFlags(Qt::FramelessWindowHint | flags); | 1038 | setFlags(Qt::FramelessWindowHint | flags); | ||
1039 | d->syncWaylandWindowFlags(); | ||||
1024 | emit flagsChanged(); | 1040 | emit flagsChanged(); | ||
1025 | } | 1041 | } | ||
1026 | 1042 | | |||
1027 | void Dialog::adjustGeometry(const QRect &geom) | 1043 | void Dialog::adjustGeometry(const QRect &geom) | ||
1028 | { | 1044 | { | ||
1029 | setGeometry(geom); | 1045 | setGeometry(geom); | ||
1030 | } | 1046 | } | ||
1031 | 1047 | | |||
▲ Show 20 Lines • Show All 140 Lines • ▼ Show 20 Line(s) | 1174 | if (event->type() == QEvent::Expose) { | |||
1172 | * see https://phabricator.kde.org/T6064 | 1188 | * see https://phabricator.kde.org/T6064 | ||
1173 | */ | 1189 | */ | ||
1174 | #if HAVE_KWAYLAND | 1190 | #if HAVE_KWAYLAND | ||
1175 | //sometimes non null regions arrive even for non visible windows | 1191 | //sometimes non null regions arrive even for non visible windows | ||
1176 | //for which surface creation would fail | 1192 | //for which surface creation would fail | ||
1177 | if (!d->shellSurface && isVisible()) { | 1193 | if (!d->shellSurface && isVisible()) { | ||
1178 | KWindowSystem::setState(winId(), NET::SkipTaskbar | NET::SkipPager); | 1194 | KWindowSystem::setState(winId(), NET::SkipTaskbar | NET::SkipPager); | ||
1179 | d->setupWaylandIntegration(); | 1195 | d->setupWaylandIntegration(); | ||
1196 | d->syncWaylandWindowFlags(); | ||||
1180 | d->updateVisibility(true); | 1197 | d->updateVisibility(true); | ||
1181 | d->updateTheme(); | 1198 | d->updateTheme(); | ||
1182 | } | 1199 | } | ||
1183 | #endif | 1200 | #endif | ||
1184 | } else if (event->type() == QEvent::PlatformSurface) { | 1201 | } else if (event->type() == QEvent::PlatformSurface) { | ||
1185 | const QPlatformSurfaceEvent *pSEvent = static_cast<QPlatformSurfaceEvent *>(event); | 1202 | const QPlatformSurfaceEvent *pSEvent = static_cast<QPlatformSurfaceEvent *>(event); | ||
1186 | 1203 | | |||
1187 | if (pSEvent->surfaceEventType() == QPlatformSurfaceEvent::SurfaceCreated) { | 1204 | if (pSEvent->surfaceEventType() == QPlatformSurfaceEvent::SurfaceCreated) { | ||
▲ Show 20 Lines • Show All 207 Lines • Show Last 20 Lines |