luebking added a comment.
There's no technical advantage in a local static, only a design one. You prevent it from future mis-use beyond its limited purpose, because m_activeWindow isn't actually a "property" of RootInfo. If you however at some point need several instances, that's no longer an option (resp. you'd need a local hash which is but even uglier than the "false" member) Likewise this is not about protecting* the active window, but if a client does shit, RootInfo::activeWindow() still reflects a common idea, while m_activeWindow does not (which sets up the case for the above arguement to protect m_activeWindow against unqualified reads to query the active window - which i think is at least part of Davids concern) *questionale itfp, it's rather race-prone and there's just a bug in the other client that needs to be fixed. REPOSITORY R108 KWin REVISION DETAIL https://phabricator.kde.org/D7096 To: graesslin, #kwin, #plasma, davidedmundson Cc: luebking, davidedmundson, plasma-devel, kwin, ZrenBot, progwolff, lesliezhai, ali-mohamed, hardening, jensreuterberg, abetts, sebas, apol, mart, lukas