loleaflet/src/layer/tile/TileLayer.js |   10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

New commits:
commit ee345a5ad2a2853dd0ea4669fb1a9356b0cc319e
Author:     Ashod Nakashian <ashod.nakash...@collabora.co.uk>
AuthorDate: Mon Feb 17 22:39:47 2020 -0500
Commit:     Ashod Nakashian <ashnak...@gmail.com>
CommitDate: Tue Feb 18 15:04:02 2020 +0100

    leaflet: no keyboard with text selection
    
    This prevents font change from showing the
    keyboard. The downside is that the user can't
    change the selection manually and retain
    the keyboard (say, to delete the selection).
    
    Change-Id: I97666fd7df6afb8277c627802c8402a6c45259ee
    Reviewed-on: https://gerrit.libreoffice.org/c/online/+/88907
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com>
    Reviewed-by: Ashod Nakashian <ashnak...@gmail.com>

diff --git a/loleaflet/src/layer/tile/TileLayer.js 
b/loleaflet/src/layer/tile/TileLayer.js
index 298ce5a41..0939570e3 100644
--- a/loleaflet/src/layer/tile/TileLayer.js
+++ b/loleaflet/src/layer/tile/TileLayer.js
@@ -2104,7 +2104,9 @@ L.TileLayer = L.GridLayer.extend({
                        var oldLatLng = this._cursorMarker.getLatLng();
                        this._cursorMarker.setLatLng(cursorPos, 
pixBounds.getSize().multiplyBy(this._map.getZoomScale(this._map.getZoom())));
                        var newLatLng = this._cursorMarker.getLatLng();
-                       updated = !newLatLng.equals(oldLatLng);
+                       // Assume the user didn't update the cursor if there is 
a selection.
+                       // The update can happen when the font has changed, for 
example.
+                       updated = !newLatLng.equals(oldLatLng) && 
!this.hasTextSelection();
                }
 
                this._map._textInput.showCursor();
@@ -3072,6 +3074,12 @@ L.TileLayer = L.GridLayer.extend({
                        !this._isEmptyRectangle(this._graphicSelection));
        },
 
+       // Returns true iff there is a text selection.
+       hasTextSelection: function() {
+               return (!this._isEmptyRectangle(this._textSelectionStart) &&
+                       !this._isEmptyRectangle(this._textSelectionEnd));
+       },
+
        _onDragOver: function (e) {
                e = e.originalEvent;
                e.preventDefault();
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to