You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
calculate-overlay/profiles/templates/3.6/6_ac_install_patch/lxqt-base/lxqt-panel/lxqt-panel-fix_urgent.patch

43 lines
1.7 KiB

# Calculate format=diff
diff --git a/plugin-desktopswitch/desktopswitch.cpp b/plugin-desktopswitch/desktopswitch.cpp
index bba5f7a..ad9cceb 100644
--- a/plugin-desktopswitch/desktopswitch.cpp
+++ b/plugin-desktopswitch/desktopswitch.cpp
@@ -111,6 +111,7 @@ void DesktopSwitch::shortcutRegistered()
void DesktopSwitch::onWindowChanged(WId id, NET::Properties properties, NET::Properties2 properties2)
{
+ DesktopSwitchButton *button = NULL;
if (properties.testFlag(NET::WMState) && isWindowHighlightable(id))
{
KWindowInfo info = KWindowInfo(id, NET::WMDesktop | NET::WMState);
@@ -119,9 +120,25 @@ void DesktopSwitch::onWindowChanged(WId id, NET::Properties properties, NET::Pro
return;
else
{
- DesktopSwitchButton *button = static_cast<DesktopSwitchButton *>(m_buttons->button(desktop - 1));
- if(button)
- button->setUrgencyHint(id, info.hasState(NET::DemandsAttention));
+ if(info.hasState(NET::DemandsAttention))
+ {
+ button = static_cast<DesktopSwitchButton *>(m_buttons->button(desktop - 1));
+ if(button)
+ button->setUrgencyHint(id, true);
+ }
+ else
+ {
+ int i = 0;
+ const int current_cnt = m_buttons->buttons().count();
+ const int border = qMin(current_cnt, m_desktopCount);
+ // drop urgency for window from all desktops
+ for ( ; i < border; ++i)
+ {
+ button = static_cast<DesktopSwitchButton *>(m_buttons->button(i));
+ if(button)
+ button->setUrgencyHint(id, false);
+ }
+ }
}
}
}