Remove ui -> hide-mouse-cursor setting

This was currently almost completely broken, yet nobody complained. The
new behavior (in the previous commit) makes this always hide the mouse
cursor, even when an input field has focus.

Since the only two easy options to implement are "never hide" and
"always hide", combined with the fact that both are sort of useless to
an end-user, just remove the option until somebody wants it back.
This commit is contained in:
Niklas Haas 2016-08-09 22:40:30 +02:00
parent 16c2268d09
commit 2223a285ef
5 changed files with 12 additions and 28 deletions

View File

@ -63,6 +63,8 @@ Removed
and thus removed. and thus removed.
- The `:completion-item-prev` and `:completion-item-next` commands got merged - The `:completion-item-prev` and `:completion-item-next` commands got merged
into a new `:completion-focus {prev,next}` command and thus removed. into a new `:completion-focus {prev,next}` command and thus removed.
- The `ui -> hide-mouse-cursor` setting since it was completely broken and
nobody seemed to care.
v0.8.3 (unreleased) v0.8.3 (unreleased)
------------------- -------------------

View File

@ -33,9 +33,9 @@ import tokenize
from PyQt5.QtWidgets import QApplication, QWidget from PyQt5.QtWidgets import QApplication, QWidget
from PyQt5.QtWebKit import QWebSettings from PyQt5.QtWebKit import QWebSettings
from PyQt5.QtGui import QDesktopServices, QPixmap, QIcon, QCursor, QWindow from PyQt5.QtGui import QDesktopServices, QPixmap, QIcon, QWindow
from PyQt5.QtCore import (pyqtSlot, qInstallMessageHandler, QTimer, QUrl, from PyQt5.QtCore import (pyqtSlot, qInstallMessageHandler, QTimer, QUrl,
QObject, Qt, QEvent, pyqtSignal) QObject, QEvent, pyqtSignal)
try: try:
import hunter import hunter
except ImportError: except ImportError:
@ -339,16 +339,17 @@ def _save_version():
def on_focus_changed(_old, new): def on_focus_changed(_old, new):
"""Register currently focused main window in the object registry.""" """Register currently focused main window in the object registry."""
if not isinstance(new, QWidget) and new is not None: if new is None:
return
if not isinstance(new, QWidget):
log.misc.debug("on_focus_changed called with non-QWidget {!r}".format( log.misc.debug("on_focus_changed called with non-QWidget {!r}".format(
new)) new))
return return
if new is not None: window = new.window()
_maybe_hide_mouse_cursor() if isinstance(window, mainwindow.MainWindow):
objreg.register('last-focused-main-window', new.window(), update=True) objreg.register('last-focused-main-window', window, update=True)
else:
qApp.restoreOverrideCursor()
def open_desktopservices_url(url): def open_desktopservices_url(url):
@ -359,17 +360,6 @@ def open_desktopservices_url(url):
tabbed_browser.tabopen(url) tabbed_browser.tabopen(url)
@config.change_filter('ui', 'hide-mouse-cursor', function=True)
def _maybe_hide_mouse_cursor():
"""Hide the mouse cursor if it isn't yet and it's configured."""
if config.get('ui', 'hide-mouse-cursor'):
if qApp.overrideCursor() is not None:
return
qApp.setOverrideCursor(QCursor(Qt.BlankCursor))
else:
qApp.restoreOverrideCursor()
def _init_modules(args, crash_handler): def _init_modules(args, crash_handler):
"""Initialize all 'modules' which need to be initialized. """Initialize all 'modules' which need to be initialized.
@ -431,8 +421,6 @@ def _init_modules(args, crash_handler):
os.environ['QT_WAYLAND_DISABLE_WINDOWDECORATION'] = '1' os.environ['QT_WAYLAND_DISABLE_WINDOWDECORATION'] = '1'
else: else:
os.environ.pop('QT_WAYLAND_DISABLE_WINDOWDECORATION', None) os.environ.pop('QT_WAYLAND_DISABLE_WINDOWDECORATION', None)
_maybe_hide_mouse_cursor()
objreg.get('config').changed.connect(_maybe_hide_mouse_cursor)
temp_downloads = downloads.TempDownloadManager(qApp) temp_downloads = downloads.TempDownloadManager(qApp)
objreg.register('temporary-downloads', temp_downloads) objreg.register('temporary-downloads', temp_downloads)

View File

@ -350,6 +350,7 @@ class ConfigManager(QObject):
('tabs', 'auto-hide'), ('tabs', 'auto-hide'),
('tabs', 'hide-always'), ('tabs', 'hide-always'),
('ui', 'display-statusbar-messages'), ('ui', 'display-statusbar-messages'),
('ui', 'hide-mouse-cursor'),
('general', 'wrap-search'), ('general', 'wrap-search'),
] ]
CHANGED_OPTIONS = { CHANGED_OPTIONS = {

View File

@ -346,10 +346,6 @@ def data(readonly=False):
"* `{scroll_pos}`: The page scroll position.\n" "* `{scroll_pos}`: The page scroll position.\n"
"* `{host}`: The host of the current web page."), "* `{host}`: The host of the current web page."),
('hide-mouse-cursor',
SettingValue(typ.Bool(), 'false'),
"Whether to hide the mouse cursor."),
('modal-js-dialog', ('modal-js-dialog',
SettingValue(typ.Bool(), 'false'), SettingValue(typ.Bool(), 'false'),
"Use standard JavaScript modal dialog for alert() and confirm()"), "Use standard JavaScript modal dialog for alert() and confirm()"),

View File

@ -175,9 +175,6 @@ class MainWindow(QWidget):
QTimer.singleShot(0, self._connect_resize_keyhint) QTimer.singleShot(0, self._connect_resize_keyhint)
objreg.get('config').changed.connect(self.on_config_changed) objreg.get('config').changed.connect(self.on_config_changed)
if config.get('ui', 'hide-mouse-cursor'):
self.setCursor(Qt.BlankCursor)
objreg.get("app").new_window.emit(self) objreg.get("app").new_window.emit(self)
def _init_downloadmanager(self): def _init_downloadmanager(self):