D23102: Reduce duplicate code calculating popup position

Roman Gilg <[email protected]>
Newsgroups gmane.comp.kde.devel.kwin
Message-ID <[email protected]>
romangg added a comment.


  Did you test the menu position in particular in edge cases?

INLINE COMMENTS

> useractions.cpp:155
> +    if (y != pos.top()) {
> +        Workspace *ws = Workspace::self();
>          QRect area = ws->clientArea(ScreenArea, QPoint(x, y), VirtualDesktopManager::self()->current());

Remove local var and just call

  Workspace::self()->clientArea(ScreenArea, QPoint(x, y),
                                VirtualDesktopManager::self()->current());

> useractions.cpp:163
>      }
> +    const bool needsPopup = kwinApp()->shouldUseWaylandForCompositing();
> +    if (needsPopup) {

Thanks to your big duplicate reduction you can now remove the local var.

REPOSITORY
  R108 KWin

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

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