graesslin added inline comments.

INLINE COMMENTS

> xwindowtasksmodel.cpp:432
> +
> +        data.pid = NETWinInfo(QX11Info::connection(), window, 
> QX11Info::appRootWindow(), NET::WMPid, 0).pid();
>  

I would prefer if we expose it through KWindowInfo. Creating an additional 
NETWinInfo causes an additional x-server roundtrip here.

Also a word of warning: just because you have a pid, does not mean that the pid 
is from the local system. Also remote X clients might have the pid exposed. 
This means you also need to verify that the window is from the local system. 
And now the really bad news: that's not trivial. If you want to see a working 
implementation check kwin/client_machine.cpp. This is the result of about 15 
years of KWin experience and trying to figure out correctly whether the window 
is from the local system without blocking. Yes, over the years we had multiple 
approaches which could crash, freeze and detect it incorrectly.

REPOSITORY
  rPLASMAWORKSPACE Plasma Workspace

REVISION DETAIL
  https://phabricator.kde.org/D3301

EMAIL PREFERENCES
  https://phabricator.kde.org/settings/panel/emailpreferences/

To: broulik, #plasma
Cc: graesslin, plasma-devel, lesliezhai, ali-mohamed, jensreuterberg, abetts, 
sebas

Reply via email to