D16704: [wayland] add enter/leave virtual desktop API

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

INLINE COMMENTS

> abstract_client.cpp:575
> +void AbstractClient::enterDesktop(VirtualDesktop *virtualDesktop)
>  {
> +    if (m_desktops.contains(virtualDesktop)) {

Noob question: What would happen if the client is already on all desktops and you call enterDesktop for the first desktop?

> abstract_client.cpp:588
> +void AbstractClient::leaveDesktop(VirtualDesktop *virtualDesktop)
> +{
> +    if (!m_desktops.contains(virtualDesktop)) {

Noob question: Same here, what would happen if the client is already on all desktops?

> effects.cpp:921
> +{
> +    AbstractClient* cl = dynamic_cast< AbstractClient* >(static_cast<EffectWindowImpl*>(w)->window());
> +    VirtualDesktop *d = VirtualDesktopManager::self()->desktopForX11Id(desktop);

If we pass Deleted, then we don't have to do anything. Also, why not qobject_cast?

Coding style nitpick:

  auto client = qobject_cast<AbstractClient *>(static_cast<EffectWindowImpl *>(w)->window());
  if (!client) {
      return;
  }
  
  VirtualDesktop *desktop = VirtualDesktopManager::self()->desktopForX11Id(desktop);
  if (!desktop) {
      return;
  }
  
  client->enterDesktop(desktop);

> kwineffects.h:946
>      Q_SCRIPTABLE virtual void moveWindow(KWin::EffectWindow* w, const QPoint& pos, bool snap = false, double snapAdjust = 1.0) = 0;
>      Q_SCRIPTABLE virtual void windowToDesktop(KWin::EffectWindow* w, int desktop) = 0;
> +

What's the difference between windowToDesktop and addWindowToDesktop? Deprecate it?

REPOSITORY
  R108 KWin

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

To: davidedmundson, #kwin
Cc: zzag, anthonyfieroni, kwin, mkulinski, ragreen, jackyalcine, Pitel, iodelay, bwowk, ZrenBot, ngraham, 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.