loleaflet/src/control/Control.LokDialog.js |   29 +++++++++++++++++++++--------
 1 file changed, 21 insertions(+), 8 deletions(-)

New commits:
commit f8bb16d4716de4d14e4f859bd1dbb7da0947ee8b
Author:     Szymon Kłos <szymon.k...@collabora.com>
AuthorDate: Wed Jun 12 10:05:13 2019 +0200
Commit:     Tor Lillqvist <t...@collabora.com>
CommitDate: Tue Aug 20 10:52:36 2019 +0200

    Fix not working clicks in dialogs on mobile devices
    
    Sometimes input event was not sent and dialog was not working.
    Eg. spreadsheet -> menu -> Data -> Validation
    
    Change-Id: I8d864fdd73866080df5dc0b9b84e8e39054f65e3
    Reviewed-on: https://gerrit.libreoffice.org/75943
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com>
    Reviewed-by: Tor Lillqvist <t...@collabora.com>
    (cherry picked from commit 03ed7b6e6f109a1111ce1e566c15ff09cb4e5158)
    Reviewed-on: https://gerrit.libreoffice.org/77777
    Tested-by: Tor Lillqvist <t...@collabora.com>

diff --git a/loleaflet/src/control/Control.LokDialog.js 
b/loleaflet/src/control/Control.LokDialog.js
index 8f3c7091c..3c29f3437 100644
--- a/loleaflet/src/control/Control.LokDialog.js
+++ b/loleaflet/src/control/Control.LokDialog.js
@@ -464,9 +464,13 @@ L.Control.LokDialog = L.Control.extend({
                L.DomEvent.on(canvas, 'mousedown mouseup', function(e) {
                        L.DomEvent.stopPropagation(e);
                        var buttons = 0;
-                       buttons |= e.button === 
this._map['mouse'].JSButtons.left ? this._map['mouse'].LOButtons.left : 0;
-                       buttons |= e.button === 
this._map['mouse'].JSButtons.middle ? this._map['mouse'].LOButtons.middle : 0;
-                       buttons |= e.button === 
this._map['mouse'].JSButtons.right ? this._map['mouse'].LOButtons.right : 0;
+                       if (this._map['mouse']) {
+                               buttons |= e.button === 
this._map['mouse'].JSButtons.left ? this._map['mouse'].LOButtons.left : 0;
+                               buttons |= e.button === 
this._map['mouse'].JSButtons.middle ? this._map['mouse'].LOButtons.middle : 0;
+                               buttons |= e.button === 
this._map['mouse'].JSButtons.right ? this._map['mouse'].LOButtons.right : 0;
+                       } else {
+                               buttons = 1;
+                       }
                        // 'mousedown' -> 'buttondown'
                        var lokEventType = e.type.replace('mouse', 'button');
                        this._postWindowMouseEvent(lokEventType, id, e.offsetX, 
e.offsetY, 1, buttons, 0);
@@ -771,9 +775,13 @@ L.Control.LokDialog = L.Control.extend({
 
                L.DomEvent.on(canvas, 'mousedown mouseup', function(e) {
                        var buttons = 0;
-                       buttons |= e.button === 
this._map['mouse'].JSButtons.left ? this._map['mouse'].LOButtons.left : 0;
-                       buttons |= e.button === 
this._map['mouse'].JSButtons.middle ? this._map['mouse'].LOButtons.middle : 0;
-                       buttons |= e.button === 
this._map['mouse'].JSButtons.right ? this._map['mouse'].LOButtons.right : 0;
+                       if (this._map['mouse']) {
+                               buttons |= e.button === 
this._map['mouse'].JSButtons.left ? this._map['mouse'].LOButtons.left : 0;
+                               buttons |= e.button === 
this._map['mouse'].JSButtons.middle ? this._map['mouse'].LOButtons.middle : 0;
+                               buttons |= e.button === 
this._map['mouse'].JSButtons.right ? this._map['mouse'].LOButtons.right : 0;
+                       } else {
+                               buttons = 1;
+                       }
                        var lokEventType = e.type.replace('mouse', 'button');
                        this._postWindowMouseEvent(lokEventType, childId, 
e.offsetX, e.offsetY, 1, buttons, 0);
                }, this);
commit 8c19a0adbd2d7bbe55eb17f0fc04f738db70de04
Author:     Tor Lillqvist <t...@collabora.com>
AuthorDate: Fri Jul 19 14:44:50 2019 +0300
Commit:     Tor Lillqvist <t...@collabora.com>
CommitDate: Tue Aug 20 10:52:23 2019 +0200

    Guard against this._map['mouse'] being undefined
    
    This changes makes combo boxes in the iOS app work again. Unclear
    what the situation for normal Online on a touch device is.
    
    Change-Id: If84124d46ea015722e8079566fc04914ee2bc542
    Reviewed-on: https://gerrit.libreoffice.org/75953
    Reviewed-by: Tor Lillqvist <t...@collabora.com>
    Tested-by: Tor Lillqvist <t...@collabora.com>
    (cherry picked from commit 9e611b9398035ddb89a0dbc68f40388c2ec5cc4e)
    Reviewed-on: https://gerrit.libreoffice.org/77776

diff --git a/loleaflet/src/control/Control.LokDialog.js 
b/loleaflet/src/control/Control.LokDialog.js
index 35d7fe74c..8f3c7091c 100644
--- a/loleaflet/src/control/Control.LokDialog.js
+++ b/loleaflet/src/control/Control.LokDialog.js
@@ -750,8 +750,13 @@ L.Control.LokDialog = L.Control.extend({
                                this._postWindowGestureEvent(childId, 'panEnd', 
firstTouchPositionX, firstTouchPositionY, firstTouchPositionY - touchY);
                                if (previousTouchType === 'touchstart') {
                                        // Simulate mouse click
-                                       
this._postWindowMouseEvent('buttondown', childId, firstTouchPositionX, 
firstTouchPositionY, 1, this._map['mouse'].LOButtons.left, 0);
-                                       this._postWindowMouseEvent('buttonup', 
childId, firstTouchPositionX, firstTouchPositionY, 1, 
this._map['mouse'].LOButtons.left, 0);
+                                       if (this._map['mouse']) {
+                                               
this._postWindowMouseEvent('buttondown', childId, firstTouchPositionX, 
firstTouchPositionY, 1, this._map['mouse'].LOButtons.left, 0);
+                                               
this._postWindowMouseEvent('buttonup', childId, firstTouchPositionX, 
firstTouchPositionY, 1, this._map['mouse'].LOButtons.left, 0);
+                                       } else {
+                                               
this._postWindowMouseEvent('buttondown', childId, firstTouchPositionX, 
firstTouchPositionY, 1, 1, 0);
+                                               
this._postWindowMouseEvent('buttonup', childId, firstTouchPositionX, 
firstTouchPositionY, 1, 1, 0);
+                                       }
                                }
                                firstTouchPositionX = null;
                                firstTouchPositionY = null;
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to