mirror of
git://github.com/kovidgoyal/calibre.git
synced 2026-01-03 20:16:06 +01:00
Remove workaround for QTBUG-42281
This commit is contained in:
parent
dea21e5f97
commit
fbefbc57cc
3 changed files with 3 additions and 28 deletions
|
|
@ -1,3 +0,0 @@
|
|||
Undo the workaround for WindowBlocked/Unblocked in Qt >= 5.6
|
||||
https://bugreports.qt-project.org/browse/QTBUG-42281
|
||||
|
||||
|
|
@ -31,6 +31,7 @@ def __init__(self, mb):
|
|||
def menu(self):
|
||||
return self.parent()
|
||||
|
||||
|
||||
menu_counter = 0
|
||||
|
||||
|
||||
|
|
@ -58,10 +59,6 @@ def __init__(self, parent, menu_registrar, bus):
|
|||
self.dbus_menu.publish_new_menu(self)
|
||||
self.register()
|
||||
parent.installEventFilter(self)
|
||||
# See https://bugreports.qt-project.org/browse/QTBUG-42281
|
||||
if hasattr(parent, 'window_blocked'):
|
||||
parent.window_blocked.connect(self._block)
|
||||
parent.window_unblocked.connect(self._unblock)
|
||||
|
||||
def register(self, menu_registrar=None):
|
||||
self.menu_registrar = menu_registrar or self.menu_registrar
|
||||
|
|
@ -103,13 +100,6 @@ def _unblock(self):
|
|||
|
||||
def eventFilter(self, obj, ev):
|
||||
etype = ev.type()
|
||||
# WindowBlocked and WindowUnblocked aren't delivered to event filters,
|
||||
# so we have to rely on co-operation from the mainwindow class
|
||||
# See https://bugreports.qt-project.org/browse/QTBUG-42281
|
||||
# if etype == QEvent.WindowBlocked:
|
||||
# self._block()
|
||||
# elif etype == QEvent.WindowUnblocked:
|
||||
# self._unblock()
|
||||
if etype == QEvent.Show:
|
||||
# Hiding a window causes the registrar to auto-unregister it, so we
|
||||
# have to re-register it on show events.
|
||||
|
|
@ -254,6 +244,7 @@ def bus_disconnected(self):
|
|||
self.bus
|
||||
# TODO: have the created widgets also handle bus disconnection
|
||||
|
||||
|
||||
_factory = None
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@
|
|||
import StringIO, traceback, sys, gc, weakref
|
||||
|
||||
from PyQt5.Qt import (QMainWindow, QTimer, QAction, QMenu, QMenuBar, QIcon,
|
||||
pyqtSignal, QObject)
|
||||
QObject)
|
||||
from calibre.utils.config import OptionParser
|
||||
from calibre.gui2 import error_dialog
|
||||
from calibre import prints
|
||||
|
|
@ -90,10 +90,6 @@ class MainWindow(QMainWindow):
|
|||
___menu = None
|
||||
__actions = []
|
||||
|
||||
# See https://bugreports.qt-project.org/browse/QTBUG-42281
|
||||
window_blocked = pyqtSignal()
|
||||
window_unblocked = pyqtSignal()
|
||||
|
||||
@classmethod
|
||||
def create_application_menubar(cls):
|
||||
if not cls.__actions:
|
||||
|
|
@ -156,15 +152,6 @@ def unhandled_exception(self, type, value, tb):
|
|||
except:
|
||||
pass
|
||||
|
||||
def event(self, ev):
|
||||
# See https://bugreports.qt-project.org/browse/QTBUG-42281
|
||||
etype = ev.type()
|
||||
if etype == ev.WindowBlocked:
|
||||
self.window_blocked.emit()
|
||||
elif etype == ev.WindowUnblocked:
|
||||
self.window_unblocked.emit()
|
||||
return QMainWindow.event(self, ev)
|
||||
|
||||
|
||||
def clone_menu(menu):
|
||||
# This is needed to workaround a bug in Qt 5.5+ and Unity. When the same
|
||||
|
|
|
|||
Loading…
Reference in a new issue