From 94a235db93a221cbf27a4a9a0475be9d211014df Mon Sep 17 00:00:00 2001 From: Jonas Jenwald Date: Fri, 3 Feb 2023 18:13:07 +0100 Subject: [PATCH] [GeckoView] Don't initalize the cursor-tools, since they're unused The reasons for making this change are: - There's no UI available to toggle the cursor-tools in the GeckoView-specific viewer. - The `HandTool`-implementation basically *simulates* touch scrolling, and is thus unlikely to be helpful/useful anyway. - PR 15831 already changed the relevant call-sites to handle `PDFViewerApplication.pdfCursorTools` being undefined. --- web/app.js | 14 +++++++++----- web/viewer-geckoview.css | 21 --------------------- 2 files changed, 9 insertions(+), 26 deletions(-) diff --git a/web/app.js b/web/app.js index 682ae115e..9b87d86ae 100644 --- a/web/app.js +++ b/web/app.js @@ -576,11 +576,15 @@ const PDFViewerApplication = { ); } - this.pdfCursorTools = new PDFCursorTools({ - container, - eventBus, - cursorToolOnLoad: AppOptions.get("cursorToolOnLoad"), - }); + // NOTE: The cursor-tools are unlikely to be helpful/useful in GeckoView, + // in particular the `HandTool` which basically simulates touch scrolling. + if (appConfig.secondaryToolbar?.cursorHandToolButton) { + this.pdfCursorTools = new PDFCursorTools({ + container, + eventBus, + cursorToolOnLoad: AppOptions.get("cursorToolOnLoad"), + }); + } if (appConfig.toolbar) { this.toolbar = new Toolbar(appConfig.toolbar, eventBus, this.l10n); diff --git a/web/viewer-geckoview.css b/web/viewer-geckoview.css index 9385c5cf1..768c8201b 100644 --- a/web/viewer-geckoview.css +++ b/web/viewer-geckoview.css @@ -221,27 +221,6 @@ dialog :link { width: 200px; } -.grab-to-pan-grab { - cursor: grab !important; -} -.grab-to-pan-grab - *:not(input):not(textarea):not(button):not(select):not(:link) { - cursor: inherit !important; -} -.grab-to-pan-grab:active, -.grab-to-pan-grabbing { - cursor: grabbing !important; - position: fixed; - background: rgba(0, 0, 0, 0); - display: block; - top: 0; - left: 0; - right: 0; - bottom: 0; - overflow: hidden; - z-index: 50000; /* should be higher than anything else in PDF.js! */ -} - @page { margin: 0; }