desktop/source/lib/init.cxx |   18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

New commits:
commit 01b1e44f03bd3f9c2e56712d8a75719c2b7b906d
Author:     Ashod Nakashian <ashod.nakash...@collabora.co.uk>
AuthorDate: Wed May 8 11:20:09 2019 -0400
Commit:     Noel Grandin <noel.gran...@collabora.co.uk>
CommitDate: Thu Jul 25 19:20:07 2019 +0200

    LOK: Remove window invalidations prior to size_changed
    
    A window size change is a full invalidation anyway,
    so remove any prior invalidations as they are redundant.
    
    Change-Id: I439a1bc38989df17b671e064beb26eb88c402be3
    (cherry picked from commit 1a5af070d876b1ec4b69fe3be732426dba59b9af)
    Reviewed-on: https://gerrit.libreoffice.org/76319
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk>

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 9667f5eac821..56d685bc5d4b 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -1407,6 +1407,24 @@ void CallbackFlushHandler::queue(const int type, const 
char* data)
                         return false;
                     });
                 }
+                else if (aTree.get<std::string>("action", "") == 
"size_changed")
+                {
+                    // A size change is practically re-creation of the window.
+                    // But at a minimum it's a full invalidation.
+                    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))
+                            {
+                                const std::string aOldAction = 
aOldTree.get<std::string>("action", "");
+                                if (aOldAction == "invalidate")
+                                    return true;
+                            }
+                        }
+                        return false;
+                    });
+                }
             }
             break;
         }
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to