From 00eefb392b2d32bf5bfaac689f20e226592387f5 Mon Sep 17 00:00:00 2001 From: Simon Lydell Date: Sat, 6 Aug 2016 16:26:57 +0200 Subject: [PATCH] Fix unmousable bottom-right corner of the page scrollbars VimFx's statuspanel (for notifications) had `pointer-events: auto;` instead of `pointer-events: none;`, which statuspanels have by default. The reason was to allow clicking the statuspanel to hide it. This made it impossible to interact with the bottom-right corner of the page scrollbars. The invisible statuspanel captured any clicks there. This commit hides notifications when clicking _anything_ instead, and removes `pointer-events: auto;`. Fixes #787. --- documentation/notifications.md | 2 +- extension/lib/events-frame.coffee | 2 ++ extension/lib/events.coffee | 2 ++ extension/lib/status-panel.coffee | 3 +-- extension/lib/vim.coffee | 1 - 5 files changed, 6 insertions(+), 4 deletions(-) diff --git a/documentation/notifications.md b/documentation/notifications.md index ed305d6..20cfe9b 100644 --- a/documentation/notifications.md +++ b/documentation/notifications.md @@ -16,7 +16,7 @@ pressed the correct keys or not. VimFx’s notifications are similar to the “URL popup,” shown when hovering or focusing links, but is placed on the opposite side. -Notifications are shown until you click them, press a key or switch tab. +Notifications are shown until you click something, press a key or switch tab. (See also the [`notifications_enabled`] pref.) diff --git a/extension/lib/events-frame.coffee b/extension/lib/events-frame.coffee index 7da2f2c..c8b084b 100644 --- a/extension/lib/events-frame.coffee +++ b/extension/lib/events-frame.coffee @@ -182,6 +182,8 @@ class FrameEventManager # Clicks are always counted as page interaction. Listen for 'mousedown' # instead of 'click' to mark the interaction as soon as possible. @vim.markPageInteraction() + + @vim.hideNotification() ) messageManager.listen('browserRefocus', => diff --git a/extension/lib/events.coffee b/extension/lib/events.coffee index 46b59ed..998bd3d 100644 --- a/extension/lib/events.coffee +++ b/extension/lib/events.coffee @@ -109,6 +109,8 @@ class UIEventManager target = event.originalTarget return unless vim = @vimfx.getCurrentVim(@window) + vim.hideNotification() + # In multi-process, clicks simulated by VimFx cannot be caught here. In # non-multi-process, they unfortunately can. This hack should be # sufficient for that case until non-multi-process is removed from diff --git a/extension/lib/status-panel.coffee b/extension/lib/status-panel.coffee index 7ce240e..f961de2 100644 --- a/extension/lib/status-panel.coffee +++ b/extension/lib/status-panel.coffee @@ -1,5 +1,5 @@ ### -# Copyright Simon Lydell 2015. +# Copyright Simon Lydell 2015, 2016. # # This file is part of VimFx. # @@ -31,7 +31,6 @@ injectStatusPanel = (browser) -> layer: 'true' mirror: 'true' }) - statusPanel.style.pointerEvents = 'auto' window.gBrowser.getBrowserContainer(browser).appendChild(statusPanel) module.onShutdown(-> statusPanel.remove()) diff --git a/extension/lib/vim.coffee b/extension/lib/vim.coffee index 53a0549..3c927ef 100644 --- a/extension/lib/vim.coffee +++ b/extension/lib/vim.coffee @@ -82,7 +82,6 @@ class Vim @_statusPanel?.remove() @_statusPanel = statusPanel.injectStatusPanel(@browser) - @_statusPanel.onclick = => @hideNotification() @_addListeners() if addListeners -- 2.39.3