summaryrefslogtreecommitdiff
path: root/qutebrowser/misc/nativeeventfilter.py
diff options
context:
space:
mode:
Diffstat (limited to 'qutebrowser/misc/nativeeventfilter.py')
-rw-r--r--qutebrowser/misc/nativeeventfilter.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/qutebrowser/misc/nativeeventfilter.py b/qutebrowser/misc/nativeeventfilter.py
index 4562ea82d..5fad3359c 100644
--- a/qutebrowser/misc/nativeeventfilter.py
+++ b/qutebrowser/misc/nativeeventfilter.py
@@ -20,7 +20,7 @@
This entire file is a giant WORKAROUND for https://bugreports.qt.io/browse/QTBUG-114334.
"""
-from typing import Tuple, Union, cast
+from typing import Tuple, Union, cast, Optional
import enum
import ctypes
import ctypes.util
@@ -150,11 +150,12 @@ class NativeEventFilter(QAbstractNativeEventFilter):
xcb.xcb_disconnect(conn)
def nativeEventFilter(
- self, evtype: Union[bytes, QByteArray], message: sip.voidptr
+ self, evtype: Union[bytes, QByteArray], message: Optional[sip.voidptr]
) -> Tuple[bool, _PointerRetType]:
"""Handle XCB events."""
# We're only installed when the platform plugin is xcb
assert evtype == b"xcb_generic_event_t", evtype
+ assert message is not None
# We cast to xcb_ge_generic_event_t, which overlaps with xcb_generic_event_t.
# .extension and .event_type will only make sense if this is an