D23102: Reduce duplicate code calculating popup position

Vlad Zagorodniy <[email protected]>
Newsgroups gmane.comp.kde.devel.kwin
Message-ID <[email protected]>
zzag added inline comments.

INLINE COMMENTS

> gladhorn wrote in useractions.cpp:154-162
> I'm a bit unsure what you mean - the entire popup position trickery? I was wondering how much it's needed, but didn't want to break existing things. For now I assume the code is there for a reason - it seems to me that it want to move the popup high enough to not be positioned at the bottom in a way that it would be cut off. I'm not sure what Qt actually does... in theory I think it should move it up.

I don't see why we have to ensure that QMenu doesn't fall off screen. QMenu already does that for us. Besides that our code is incomplete(only one out of three cases is handled) and incorrect(`y + popupHeight >= area.height()` is wrong).

Remove `if (y != pos.top())` and everything that goes inside.

REPOSITORY
  R108 KWin

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

To: gladhorn, #kwin, romangg, zzag
Cc: zzag, romangg, kwin, LeGast00n, sbergeron, jraleigh, fbampaloukas, GB_2, mkulinski, ragreen, jackyalcine, Pitel, iodelay, crozbo, bwowk, ZrenBot, ngraham, alexeymin, himcesjf, lesliezhai, ali-mohamed, hardening, jensreuterberg, abetts, sebas, apol, mart
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.