Update status to NeedsAttention when there is a menu
ClosedPublic

Authored by mvourlakos on Feb 14 2018, 5:29 PM.

Details

Reviewers
martinkostolny
Summary

Following the discussion at: https://github.com/psifidotos/Latte-Dock/issues/862

when AWC shows menus in a Latte panel it is able to trigger the solid background and panel shadows for plasma theme consistency... Latte achieves this for all apllets that change their status to NeedsAttention... By addind this code AWC now provides nice solid background and shadows will Latte without noticing any other implications.

Test Plan

Apply the code and observe the AWC to not break its behavior

Diff Detail

Repository
R884 Active Window Control Applet for Plasma
Lint
Lint Skipped
Unit
Unit Tests Skipped
mvourlakos created this revision.Feb 14 2018, 5:29 PM
Restricted Application added a project: Plasma. · View Herald TranscriptFeb 14 2018, 5:29 PM
Restricted Application added a subscriber: plasma-devel. · View Herald Transcript
mvourlakos requested review of this revision.Feb 14 2018, 5:29 PM
mvourlakos edited the test plan for this revision. (Show Details)

Thanks for looking into this!

I could prefer a QML binding that also takes into account wheter there is a menu at all, something like

Plasmoid.status: {
    if (currentIndex > -1) {
        return PlasmaCore.Types.NeedsAttentionStatus;
    } else if (menuAvailable) {
        return PlasmaCore.Types.ActiveStatus;
    } else {
        return PlasmaCore.Types.PassiveStatus;
    }
}

also BUG: 390271

Thanks for looking into this!

I could prefer a QML binding that also takes into account wheter there is a menu at all, something like

Plasmoid.status: {
    if (currentIndex > -1) {
        return PlasmaCore.Types.NeedsAttentionStatus;
    } else if (menuAvailable) {
        return PlasmaCore.Types.ActiveStatus;
    } else {
        return PlasmaCore.Types.PassiveStatus;
    }
}

also BUG: 390271

@broulik no prob :) only problem is that this commit is for Active Window Control, not for the plasma menu applet. The AWC doesnt provide a menuavailable flag. Of course I can create a second commit for plasma and update this one with your proposal...

would that be ok?

martinkostolny accepted this revision.Feb 14 2018, 9:23 PM

Thanks for fixing my code! :)

I'm sure I can also provide a flag for menu availability (the code for appmenu is copied for now anyway). But I think in AWC it does not make sense to set status to active when menu is available because it has other use then showing menu. I can be wrong of course.

Anyway I definitely agree with your proposed patch.

This revision is now accepted and ready to land.Feb 14 2018, 9:23 PM
mvourlakos updated this revision to Diff 27186.Feb 14 2018, 9:28 PM

followed @broulik suggestions and added also an improvement to not update menu index all the time when changing from menu to menu

Thanks for fixing my code! :)

can you please confirm also the update that follows @broulik suggestion? I confirmed with Latte that everything works flawlessly now.

@broulik I created the diff without arcanist but I can merge the code with git, but this issue wont be closed automatically I think, is there any other way, e.g to referece in the commit text somehow the phabricator review?

Oh, sorry, I assumed from the name of the files it was plasma-workspace :) lgtm!

Oh, sorry, I assumed from the name of the files it was plasma-workspace :) lgtm!

:) if this is accepted, then I will try to send a fix for plasma menu also afterwards...

mvourlakos added a comment.EditedFeb 15 2018, 3:12 PM

thanks!

fatal: remote error: service not enabled: /plasma-active-window-control

unfortunately I can commit, I get:

fatal: remote error: service not enabled: /plasma-active-window-control

@martinkostolny feel free to commit it...

mvourlakos closed this revision.Feb 15 2018, 3:21 PM

normal in Latte

needsattention in Latte