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
4 changes: 3 additions & 1 deletion panels/notification/osd/displaymode/package/main.qml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@ AppletItem {
Applet.doAction()
}
} else if (osdType === "SwitchMonitors") {
Applet.next()
if (Panel.lastOsdType() === osdType) {
Applet.next()
}
}

return true
Expand Down
4 changes: 3 additions & 1 deletion panels/notification/osd/kblayout/package/main.qml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@ AppletItem {
{
if (match(osdType)) {
Applet.sync()
Applet.next()
if (Panel.lastOsdType() === osdType) {
Applet.next()
}
return true
}
return false
Expand Down
14 changes: 14 additions & 0 deletions panels/notification/osd/osdpanel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ void OsdPanel::hideOsd()
{
m_osdTimer->stop();
setVisible(false);
updateLastOsdType({});
}

void OsdPanel::showOsd()
Expand All @@ -86,6 +87,7 @@ void OsdPanel::showOsd()

m_osdTimer->start();
setVisible(true);
updateLastOsdType(m_osdType);
}

void OsdPanel::setVisible(const bool visible)
Expand All @@ -102,6 +104,18 @@ void OsdPanel::setOsdType(const QString &osdType)
emit osdTypeChanged(m_osdType);
}

void OsdPanel::updateLastOsdType(const QString &osdType)
{
if (m_lastOsdType != osdType) {
m_lastOsdType = osdType;
}
}

QString OsdPanel::lastOsdType() const
{
return m_lastOsdType;
}

D_APPLET_CLASS(OsdPanel)

}
Expand Down
4 changes: 4 additions & 0 deletions panels/notification/osd/osdpanel.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,9 @@
bool visible() const;
QString osdType() const;

Q_INVOKABLE QString lastOsdType() const;

public Q_SLOTS:

Check warning on line 29 in panels/notification/osd/osdpanel.h

View workflow job for this annotation

GitHub Actions / cppcheck

There is an unknown macro here somewhere. Configuration is required. If Q_SLOTS is a macro then please configure it.
void ShowOSD(const QString &text);

Q_SIGNALS:
Expand All @@ -37,11 +39,13 @@
void showOsd();
void setVisible(const bool visible);
void setOsdType(const QString &osdType);
void updateLastOsdType(const QString &osdType);

private:
bool m_visible = false;
QTimer *m_osdTimer = nullptr;
QString m_osdType;
QString m_lastOsdType;
int m_interval {2000};
};

Expand Down
8 changes: 5 additions & 3 deletions panels/notification/osd/windoweffect/package/main.qml
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,11 @@ AppletItem {
function update(osdType)
{
if (match(osdType)) {
Qt.callLater(function() {
control.selectIndex = (control.selectIndex + 1) % effectModel.count
})
if (Panel.lastOsdType() === osdType) {
Qt.callLater(function() {
control.selectIndex = (control.selectIndex + 1) % effectModel.count
})
}
return true
}
return false
Expand Down