diff options
author | Ashod Nakashian <ashod.nakashian@collabora.co.uk> | 2019-05-05 20:26:42 -0400 |
---|---|---|
committer | Jan Holesovsky <kendy@collabora.com> | 2019-05-14 11:39:45 +0200 |
commit | d0fe740e10346cdca5519a03ed0c05247e1227ae (patch) | |
tree | 88eae68357f7cfd1eb18e6184b9288446d11317f /desktop | |
parent | e5f7b22c4dd39871f3f6715b7ccff5348fbe2589 (diff) |
LOK: Window creation supersedes any events on same window
This happens when we get multiple created events on
same window, interspersed with invalidations.
Change-Id: I2dbaa0f84306d770f1de047a23996209c28304fe
Diffstat (limited to 'desktop')
-rw-r--r-- | desktop/source/lib/init.cxx | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx index 0c4b3f7237de..de22b316b6f7 100644 --- a/desktop/source/lib/init.cxx +++ b/desktop/source/lib/init.cxx @@ -1390,6 +1390,19 @@ void CallbackFlushHandler::queue(const int type, const char* data) assert(aCallbackData.validate() && "Validation after setJson failed!"); } } + else if (aTree.get<std::string>("action", "") == "created") + { + // Remove all previous actions on same dialog, if we are creating it anew. + removeAll([&nLOKWindowId](const queue_type::value_type& elem) { + if (elem.Type == LOK_CALLBACK_WINDOW) + { + const boost::property_tree::ptree& aOldTree = elem.getJson(); + if (nLOKWindowId == aOldTree.get<unsigned>("id", 0)) + return true; + } + return false; + }); + } } break; } |