diff options
author | Siyeon Seo <siyeon.seo@lge.com> | 2021-01-18 19:56:16 +0900 |
---|---|---|
committer | Elvis Lee <kwangwoong.lee@lge.com> | 2021-01-22 22:00:35 +0900 |
commit | ea3ea45fb2eb08e9db383ea47865974f496e8c39 (patch) | |
tree | ca7718531edaa22c20175e9ab74604564fed8830 | |
parent | da0b35c6ca60789a631cabd16eebc106e49f76b7 (diff) | |
download | qtwayland-ea3ea45fb2eb08e9db383ea47865974f496e8c39.tar.gz |
Ignore duplicated mode in addMode
Check if a mode exists in the vector before adding it.
Change-Id: If8e75fbf9dfa01405b2bdad2d3c978cf2bd37e68
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
-rw-r--r-- | src/compositor/compositor_api/qwaylandoutput.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/compositor/compositor_api/qwaylandoutput.cpp b/src/compositor/compositor_api/qwaylandoutput.cpp index 3bdb0082..d850f3eb 100644 --- a/src/compositor/compositor_api/qwaylandoutput.cpp +++ b/src/compositor/compositor_api/qwaylandoutput.cpp @@ -531,7 +531,8 @@ void QWaylandOutput::addMode(const QWaylandOutputMode &mode, bool preferred) return; } - d->modes.append(mode); + if (d->modes.indexOf(mode) < 0) + d->modes.append(mode); if (preferred) d->preferredMode = d->modes.indexOf(mode); |