romangg added inline comments.

INLINE COMMENTS

> fvogt wrote in test_display.cpp:223
> That won't work reliably either though - if wayland-0 is free, but wayland-1 
> is used, it would pick wayland-0 and wayland-2. Maybe it should just check 
> that starting both displays at the same time succeeds and that their socket 
> names are not equal.

That's why I said "do it one more time from there until you find the second 
wayland-y".
For example (semi-pseudo):

  QString name1, name2;
  
  int cnt = -1;
  while(true) {
      cnt++;
      const QString name = "wayland-" + str(cnt);
      if (!runtimeDir.exists(name)) {
          name1 = name;
          break;
      }
  }
  while(true) {
      cnt++;
      const QString name = "wayland-" + str(cnt);
      if (!runtimeDir.exists(name)) {
          name2 = name;
          break;
      }
  }

David's solution is nicer though.

REPOSITORY
  R127 KWayland

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

To: fvogt, #kwin, #plasma, romangg
Cc: davidedmundson, zzag, romangg, kde-frameworks-devel, michaelh, ngraham, 
bruns

Reply via email to