Browse Source

Comparing ScreenSet:s should be done without considering order

Avoids that a viewer connected to Xvnc sometimes disconnects with
"Desktop configured a different screen layout than requested" when
screens are changing.
tags/v1.8.90
Peter Åstrand (astrand) 6 years ago
parent
commit
a9d7069f9c
1 changed files with 15 additions and 3 deletions
  1. 15
    3
      common/rfb/ScreenSet.h

+ 15
- 3
common/rfb/ScreenSet.h View File

@@ -126,11 +126,23 @@ namespace rfb {
}
};

// FIXME: List order shouldn't matter
inline bool operator==(const ScreenSet& r) const { return screens == r.screens; }
inline bool operator!=(const ScreenSet& r) const { return screens != r.screens; }
inline bool operator==(const ScreenSet& r) const {
std::list<Screen> a = screens;
a.sort(compare_screen);
std::list<Screen> b = r.screens;
b.sort(compare_screen);
return a == b;
};
inline bool operator!=(const ScreenSet& r) const { return !operator==(r); }

std::list<Screen> screens;

private:
static inline bool compare_screen(const Screen& first, const Screen& second)
{
return first.id < second.id;
}

};

};

Loading…
Cancel
Save