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

> useractions.cpp:154-162
> +    if (y != pos.top()) {
> +        QRect area = Workspace::self()->clientArea(ScreenArea, QPoint(x, y),
> +                                                   VirtualDesktopManager::self()->current());
>          menuAboutToShow(); // needed for sizeHint() to be correct :-/
>          int popupHeight = m_menu->sizeHint().height();
> -        if (y + popupHeight < area.height()) {
> -            if (needsPopup) {
> -                m_menu->popup(QPoint(x, y));
> -            } else {
> -                m_menu->exec(QPoint(x, y));
> -            }
> -        } else {
> -            if (needsPopup) {
> -                m_menu->popup(QPoint(x, pos.top() - popupHeight));
> -            } else {
> -                m_menu->exec(QPoint(x, pos.top() - popupHeight));
> -            }
> +        if (y + popupHeight >= area.height()) {
> +            y = pos.top() - popupHeight;

Remove this code as well.

REPOSITORY
  R108 KWin

BRANCH
  arcpatch-D23102

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

To: gladhorn, #kwin, romangg
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.