Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions panels/dock/dockpanel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -382,6 +382,14 @@ void DockPanel::setDockScreen(QScreen *screen)
m_dockScreen = screen;
window()->setScreen(m_dockScreen);
Q_EMIT dockScreenChanged(m_dockScreen);
Q_EMIT screenNameChanged();
}

QString DockPanel::screenName() const
{
if (!m_dockScreen)
return {};
return m_dockScreen->name();
}
}

Expand Down
3 changes: 3 additions & 0 deletions panels/dock/dockpanel.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ class DockPanel : public DS_NAMESPACE::DPanel, public QDBusContext
Q_PROPERTY(ItemAlignment itemAlignment READ itemAlignment WRITE setItemAlignment NOTIFY itemAlignmentChanged FINAL)
Q_PROPERTY(IndicatorStyle indicatorStyle READ indicatorStyle WRITE setIndicatorStyle NOTIFY indicatorStyleChanged FINAL)
Q_PROPERTY(bool showInPrimary READ showInPrimary WRITE setShowInPrimary NOTIFY showInPrimaryChanged FINAL)
Q_PROPERTY(QString screenName READ screenName NOTIFY screenNameChanged FINAL)

Q_PROPERTY(bool debugMode READ debugMode FINAL CONSTANT)

Expand Down Expand Up @@ -79,6 +80,7 @@ class DockPanel : public DS_NAMESPACE::DPanel, public QDBusContext
void setHideState(HideState newHideState);
QScreen* dockScreen();
void setDockScreen(QScreen *screen);
QString screenName() const;

private Q_SLOTS:
void onWindowGeometryChanged();
Expand All @@ -99,6 +101,7 @@ private Q_SLOTS:
void indicatorStyleChanged(IndicatorStyle style);
void showInPrimaryChanged(bool showInPrimary);
void dockScreenChanged(QScreen *screen);
void screenNameChanged();
void requestClosePopup();

private:
Expand Down
18 changes: 5 additions & 13 deletions panels/notification/bubble/package/main.qml
Original file line number Diff line number Diff line change
Expand Up @@ -18,26 +18,18 @@ Window {
if (!dockApplet)
return 0

let dockRect = dockApplet.frontendWindowRect
let rect = Qt.rect(root.screen.virtualX, root.screen.virtualY, root.screen.width, root.screen.height)
if (!containsPos(rect, Qt.point(dockRect.x, dockRect.y)))
let dockScreen = dockApplet.screenName
let screen = root.screen.name
let dockHideState = dockApplet.hideState
let dockIsHide = dockHideState === 2
if (dockScreen !== screen || dockIsHide)
return 0

let dockSize = dockApplet.dockSize
let dockPosition = dockApplet.position
return dockPosition === position ? dockSize : 0
}

function containsPos(rect1, pos) {
if (rect1.x <= pos.x &&
rect1.y <= pos.y &&
(rect1.x + rect1.width > pos.x) &&
(rect1.y + rect1.height > pos.y)) {
return true
}
return false
}

visible: Applet.visible
width: 380
height: Math.max(10, bubbleView.height + bubbleView.anchors.topMargin + bubbleView.anchors.bottomMargin)
Expand Down
18 changes: 5 additions & 13 deletions panels/notification/center/package/main.qml
Original file line number Diff line number Diff line change
Expand Up @@ -17,26 +17,18 @@ Window {
if (!dockApplet)
return 0

let dockRect = dockApplet.frontendWindowRect
let rect = Qt.rect(root.screen.virtualX, root.screen.virtualY, root.screen.width, root.screen.height)
if (!containsPos(rect, Qt.point(dockRect.x, dockRect.y)))
let dockScreen = dockApplet.screenName
let screen = root.screen.name
let dockHideState = dockApplet.hideState
let dockIsHide = dockHideState === 2
if (dockScreen !== screen || dockIsHide)
return 0

let dockSize = dockApplet.dockSize
let dockPosition = dockApplet.position
return dockPosition === position ? dockSize : 0
}

function containsPos(rect1, pos) {
if (rect1.x <= pos.x &&
rect1.y <= pos.y &&
(rect1.x + rect1.width > pos.x) &&
(rect1.y + rect1.height > pos.y)) {
return true
}
return false
}

// visible: true
visible: Panel.visible
flags: Qt.Tool
Expand Down
Loading