[Libreoffice-commits] online.git: loolwsd/ChildProcessSession.cpp

Ashod Nakashian ashod.nakashian at collabora.co.uk
Sun Jan 10 20:11:00 PST 2016


 loolwsd/ChildProcessSession.cpp |    6 ++++++
 1 file changed, 6 insertions(+)

New commits:
commit 7e023160342c41425ebedb80ef984b45c386c3d3
Author: Ashod Nakashian <ashod.nakashian at collabora.co.uk>
Date:   Sun Jan 10 22:04:55 2016 -0500

    loolwsd: prevent the user from killing our window with ctrl+w
    
    Change-Id: I77f004bc131ce5b469e76089efddd9e2e99ea526
    Reviewed-on: https://gerrit.libreoffice.org/21331
    Reviewed-by: Ashod Nakashian <ashnakash at gmail.com>
    Tested-by: Ashod Nakashian <ashnakash at gmail.com>

diff --git a/loolwsd/ChildProcessSession.cpp b/loolwsd/ChildProcessSession.cpp
index 883c648..1fb17ca 100644
--- a/loolwsd/ChildProcessSession.cpp
+++ b/loolwsd/ChildProcessSession.cpp
@@ -576,6 +576,12 @@ bool ChildProcessSession::keyEvent(const char* /*buffer*/, int /*length*/, Strin
         return false;
     }
 
+    // Don't close LO window!
+    constexpr auto KEY_CTRL = 0x2000;
+    constexpr auto KEY_W    = 0x0216;
+    if (keycode == (KEY_CTRL | KEY_W))
+        return true;
+
     Poco::Mutex::ScopedLock lock(_mutex);
 
     if (_multiView)


More information about the Libreoffice-commits mailing list