summaryrefslogtreecommitdiffstats
path: root/common/rfb/ScreenSet.h
diff options
context:
space:
mode:
Diffstat (limited to 'common/rfb/ScreenSet.h')
-rw-r--r--common/rfb/ScreenSet.h18
1 files changed, 15 insertions, 3 deletions
diff --git a/common/rfb/ScreenSet.h b/common/rfb/ScreenSet.h
index ad340c2b..9680b6e7 100644
--- a/common/rfb/ScreenSet.h
+++ b/common/rfb/ScreenSet.h
@@ -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;
+ }
+
};
};