D23582: [platforms/x11] Make X11WindowedOutput::init() private
Vlad Zagorodniy
noreply at phabricator.kde.org
Fri Aug 30 15:47:36 BST 2019
zzag added a comment.
> It just swaps one bad thing for one equally bad.
Yeah, what we have now and what friend keyword is are not far from each other. However, it's better to judge this revision by the end result. Public interface of X11WindowedOutput is leaner with less clutter.
> Anyway, in this case the args and everything can just go in the constructor. You solve the case of being called multiple times and from which class all in one go.
Totally agreed, we should embrace RAII rather than fight it, but sometimes it's better to go a bit off road in order to not go insane, for example would you be happy to work with QOpenGLTexture if it had a huge constructor with all possible parameters and no create() method, or if you had to fill in a struct with all parameters (hello, Vulkan!) and pass it to a constructor? :)
As for this patch, I think we can stick with private init() method for now and gradually switch to RAII wherever it's a reasonable thing to do.
REPOSITORY
R108 KWin
REVISION DETAIL
https://phabricator.kde.org/D23582
To: zzag, #kwin
Cc: davidedmundson, kwin, LeGast00n, The-Feren-OS-Dev, sbergeron, jraleigh, fbampaloukas, GB_2, mkulinski, ragreen, jackyalcine, Pitel, iodelay, crozbo, bwowk, ZrenBot, ngraham, alexeymin, himcesjf, lesliezhai, ali-mohamed, hardening, romangg, jensreuterberg, abetts, sebas, apol, mart
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kwin/attachments/20190830/c863d05c/attachment.html>
More information about the kwin
mailing list