Fixes issue #146 on GitHub:
https://github.com/kotelnik/plasma-applet-active-window-control/issues/146
This is the same method the global menu widget uses:
https://github.com/KDE/plasma-workspace/blob/master/applets/appmenu/package/contents/ui/main.qml#L131