@@ -617,8 +617,10 @@ void LXQtTaskGroup::wheelEvent(QWheelEvent* event)
617
617
/* ***********************************************
618
618
619
619
************************************************/
620
- bool LXQtTaskGroup::onWindowChanged (WId window, NET::Properties prop, NET::Properties2 prop2)
621
- { // returns true if the class is preserved
620
+ bool LXQtTaskGroup::onWindowChanged (WId window, LXQtTaskBarWindowProperty prop)
621
+ {
622
+ // Returns true if the class is preserved
623
+
622
624
bool needsRefreshVisibility{false };
623
625
QVector<LXQtTaskButton *> buttons;
624
626
if (mButtonHash .contains (window))
@@ -631,17 +633,16 @@ bool LXQtTaskGroup::onWindowChanged(WId window, NET::Properties prop, NET::Prope
631
633
if (!buttons.isEmpty ())
632
634
{
633
635
// if class is changed the window won't belong to our group any more
634
- if (parentTaskBar ()->isGroupingEnabled () && prop2. testFlag (NET::WM2WindowClass) )
636
+ if (parentTaskBar ()->isGroupingEnabled () && prop == LXQtTaskBarWindowProperty::WindowClass )
635
637
{
636
- KWindowInfo info (window, NET::Properties (), NET::WM2WindowClass);
637
- if (QString::fromUtf8 (info.windowClassClass ()) != mGroupName )
638
+ if (mBackend ->getWindowClass (windowId ()) != mGroupName )
638
639
{
639
640
onWindowRemoved (window);
640
641
return false ;
641
642
}
642
643
}
643
644
// window changed virtual desktop
644
- if (prop. testFlag (NET::WMDesktop) || prop. testFlag (NET::WMGeometry) )
645
+ if (prop == LXQtTaskBarWindowProperty::Workspace )
645
646
{
646
647
if (parentTaskBar ()->isShowOnlyOneDesktopTasks ()
647
648
|| parentTaskBar ()->isShowOnlyCurrentScreenTasks ())
@@ -650,31 +651,28 @@ bool LXQtTaskGroup::onWindowChanged(WId window, NET::Properties prop, NET::Prope
650
651
}
651
652
}
652
653
653
- if (prop. testFlag (NET::WMVisibleName) || prop. testFlag (NET::WMName) )
654
+ if (prop == LXQtTaskBarWindowProperty::Title )
654
655
std::for_each (buttons.begin (), buttons.end (), std::mem_fn (&LXQtTaskButton::updateText));
655
656
656
657
// XXX: we are setting window icon geometry -> don't need to handle NET::WMIconGeometry
657
658
// Icon of the button can be based on windowClass
658
- if (prop. testFlag (NET::WMIcon) || prop2. testFlag (NET::WM2WindowClass) )
659
+ if (prop == LXQtTaskBarWindowProperty::Icon )
659
660
std::for_each (buttons.begin (), buttons.end (), std::mem_fn (&LXQtTaskButton::updateIcon));
660
661
661
662
bool set_urgency = false ;
662
663
bool urgency = false ;
663
- if (prop2. testFlag (NET::WM2Urgency) )
664
+ if (prop == LXQtTaskBarWindowProperty::Urgency )
664
665
{
665
666
set_urgency = true ;
666
667
// FIXME: original code here did not consider "demand attention", was it intentional?
667
668
urgency = mBackend ->applicationDemandsAttention (window);
668
669
}
669
- if (prop. testFlag (NET::WMState) )
670
+ if (prop == LXQtTaskBarWindowProperty::State )
670
671
{
671
- KWindowInfo info{window, NET::WMState};
672
672
if (!set_urgency)
673
673
urgency = mBackend ->applicationDemandsAttention (window);
674
674
std::for_each (buttons.begin (), buttons.end (), std::bind (&LXQtTaskButton::setUrgencyHint, std::placeholders::_1, urgency));
675
675
set_urgency = false ;
676
- if (info.hasState (NET::SkipTaskbar))
677
- onWindowRemoved (window);
678
676
679
677
if (parentTaskBar ()->isShowOnlyMinimizedTasks ())
680
678
{
0 commit comments