on xenial help sign in
Use the max value of an int for max window ID

The QML documentation says "The possible int values range from around -2000000000 to around 2000000000", the range of a 32-bit signed integer. This makes our old comment lie, we can use the max int value for the platform.

commitefd3bd14c91f018286c679a06aedad9a9affae63 authorDalton Durst <dalton@ubports.com> dateSun 29 Dec 2019, 18:06 (7 years ago) parent54de862
2 files changed+1−5
plugins/WindowManager/TopLevelWindowModel.cpp+1−1 plugins/WindowManager/TopLevelWindowModel.h−4
plugins/WindowManager/TopLevelWindowModel.cpp+1−1
@@ -40,7 +40,7 @@ namespace unityapi = unity::shell::application;
4040
4141TopLevelWindowModel::TopLevelWindowModel()
4242 : m_nullWindow(createNullWindow()),
43− m_maxWindowId(1000000),
43+ m_maxWindowId(std::numeric_limits<int>::max()),
4444 m_surfaceManagerBusy(false)
4545{
4646 connect(m_nullWindow, &Window::focusedChanged, this, [this] {
plugins/WindowManager/TopLevelWindowModel.h−4
@@ -297,10 +297,6 @@ private:
297297 bool m_pendingActivation;
298298
299299 QAtomicInteger<int> m_nextId{1};
300−
301− // Just something big enough that we don't risk running out of unused id numbers.
302− // Not sure if QML int type supports something close to std::numeric_limits<int>::max() and
303− // there's no reason to try out its limits.
304300 int m_maxWindowId;
305301
306302 unity::shell::application::ApplicationManagerInterface* m_applicationManager{nullptr};