Bug 2008937 - Issues with using Qutebrowser in F35, Gnome, Wayland: keypresses going to wrong window
Summary: Issues with using Qutebrowser in F35, Gnome, Wayland: keypresses going to wro...
Keywords:
Status: CLOSED WORKSFORME
Alias: None
Product: Fedora
Classification: Fedora
Component: qutebrowser
Version: 35
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Timothée Floure
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2021-09-29 14:18 UTC by Ankur Sinha (FranciscoD)
Modified: 2022-08-31 21:11 UTC (History)
2 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2022-08-31 21:11:07 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github qutebrowser qutebrowser issues 6691 0 None open Key presses going to wrong window 2021-09-29 14:18:58 UTC

Description Ankur Sinha (FranciscoD) 2021-09-29 14:18:58 UTC
Copying over from my report upstream here: https://github.com/qutebrowser/qutebrowser/issues/6691

Version info:

qutebrowser v2.3.1
Backend: QtWebEngine 5.15.6, based on Chromium 87.0.4280.144
Qt: 5.15.2

CPython: 3.10.0rc2
PyQt: 5.15.0

sip: 6.1.0.dev2104271705
colorama: no
jinja2: 3.0.1
pygments: 2.9.0
yaml: 5.4.1
adblock: no
PyQt5.QtWebEngineWidgets: yes
PyQt5.QtWebEngine: 5.15.2
PyQt5.QtWebKitWidgets: yes
pdf.js: 2.3.200 (/home/asinha/.local/share/qutebrowser/pdfjs/build/pdf.js)
sqlite: 3.36.0
QtNetwork SSL: OpenSSL 1.1.1l FIPS 24 Aug 2021

Style: Adwaita::Style
Platform plugin: wayland
OpenGL: Intel Open Source Technology Center, 3.0 Mesa 21.2.1
Platform: Linux-5.14.3-300.fc35.x86_64-x86_64-with-glibc2.34, 64bit
Linux distribution: Fedora Linux 35 (CompNeuro Prerelease) (fedora)
Frozen: False
Imported from /usr/lib/python3.10/site-packages/qutebrowser
Using Python from /usr/bin/python3
Qt library executable path: /usr/lib64/qt5/libexec, data path: /usr/share/qt5

Paths:
cache: /home/asinha/.cache/qutebrowser
config: /home/asinha/.config/qutebrowser
data: /home/asinha/.local/share/qutebrowser
runtime: /run/user/1000/qutebrowser

Autoconfig loaded: yes
Config.py: no config.py was loaded
Uptime: 0:03:39

Does the bug happen if you start with --temp-basedir?:

Not able to test it there, unfortunately.

Description

I'm seeing issues with window focus here after upgrading to Fedora 35 (still in beta, with py3.10 etc.).
I have multiple qutebrowser windows open, generally about 5 in different workspaces here on Gnome Shell (one each for a project/context). When using other tools like weechat, neomutt, byobu(tmux), I use scripts like urlopen.py or urlview to open links in qutebrowser from weechat. Similarly, on the terminal, I also tend to use gio open a lot to open URLs in qute.

In the past, if I used one of these, the new URL would be opened in the last active Qutebrowser window. This is now no longer the case---it gets sent to another window (I'm not sure how this is being picked). Oddly enough, that's not the worst part. Sometimes, when I go to this window to then work in the tab, pressing keyboard keys does not do anything here. Initially I thought that the keys were not being recognised, but then I realised that the keys seem to be sent to the last active window (where this tab should've opened in the first place).

(I just closed and restarted qutebrowser (with all my windows), and even now, I'm looking at a window but my key presses are going to another. So it may not be related to opening urls from a terminal.)

I see this in the debug logs:


11:36:02 DEBUG    ipc        ipc:on_ready_read:392 Read from socket 0x7fb2981436d0: b'{"args": ["https://github.com/NeuroML/Documentation/issues/94#issuecomment-920721598"], "target_arg": null, "version": "2.3.1", "protocol_version": 1, "cwd": "/home/asinha"}\n'
11:36:02 DEBUG    ipc        ipc:_handle_data:320 Processing: {"args": ["https://github.com/NeuroML/Documentation/issues/94#issuecomment-920721598"], "target_arg": null, "version": "2.3.1", "protocol_version": 1, "cwd": "/home/asinha"}

11:36:02 DEBUG    url        urlutils:get_path_if_valid:366 Checking if 'https://github.com/NeuroML/Documentation/issues/94#issuecomment-920721598' is a path
11:36:02 DEBUG    url        urlutils:is_url:271 Checking if 'https://github.com/NeuroML/Documentation/issues/94#issuecomment-920721598' is a URL (autosearch=naive).
11:36:02 DEBUG    url        urlutils:is_url:294 Contains explicit scheme
11:36:02 DEBUG    url        urlutils:is_url:318 url = True
11:36:02 DEBUG    url        urlutils:fuzzy_url:225 URL is a fuzzy address
11:36:02 DEBUG    url        urlutils:fuzzy_url:227 Converting fuzzy term 'https://github.com/NeuroML/Documentation/issues/94#issuecomment-920721598' to URL -> https://github.com/NeuroML/Documentation/issues/94#issuecomment-920721598
11:36:02 DEBUG    ipc        ipc:on_error:249 Socket 0x7fb2981436d0: error 1: QLocalSocket: Remote closed
11:36:02 DEBUG    ipc        ipc:on_disconnected:292 Client disconnected from socket 0x7fb2981436d0.
11:36:02 DEBUG    ipc        ipc:handle_connection:267 No new connection to handle.
11:36:02 WARNING  qt-qt.qpa.wayland Unknown module:none:0 Wayland does not support QWindow::requestActivate()
  File "/usr/bin/qutebrowser", line 33, in <module>
    sys.exit(load_entry_point('qutebrowser==2.3.1', 'gui_scripts', 'qutebrowser')())
  File "/usr/lib/python3.10/site-packages/qutebrowser/qutebrowser.py", line 220, in main
    return app.run(args)
  File "/usr/lib/python3.10/site-packages/qutebrowser/app.py", line 129, in run
    ret = qt_mainloop()
  File "/usr/lib/python3.10/site-packages/qutebrowser/app.py", line 139, in qt_mainloop
    return objects.qapp.exec()
  File "/usr/lib/python3.10/site-packages/qutebrowser/misc/ipc.py", line 394, in on_ready_read
    self._handle_data(data)
  File "/usr/lib/python3.10/site-packages/qutebrowser/misc/ipc.py", line 357, in _handle_data
    self.got_args.emit(args, target_arg, cwd)
  File "/usr/lib/python3.10/site-packages/qutebrowser/app.py", line 127, in <lambda>
    process_pos_args(args, cwd=cwd, via_ipc=True, target_arg=target_arg))
  File "/usr/lib/python3.10/site-packages/qutebrowser/app.py", line 293, in process_pos_args
    win_id = open_url(url, target=open_target, via_ipc=via_ipc)
  File "/usr/lib/python3.10/site-packages/qutebrowser/app.py", line 310, in open_url
    win_id = mainwindow.get_window(via_ipc=via_ipc, target=target,
  File "/usr/lib/python3.10/site-packages/qutebrowser/mainwindow/mainwindow.py", line 84, in get_window
    raise_window(window)
  File "/usr/lib/python3.10/site-packages/qutebrowser/mainwindow/mainwindow.py", line 100, in raise_window
    window.activateWindow()
  File "/usr/lib/python3.10/site-packages/qutebrowser/utils/log.py", line 512, in qt_message_handler
    stack: Optional[str] = ''.join(traceback.format_stack())

11:36:02 DEBUG    init       app:open_url:314 About to open URL: https://github.com/NeuroML/Documentation/issues/94#issuecomment-920721598
11:36:02 DEBUG    webview    tabbedbrowser:tabopen:593 Creating new tab with URL PyQt5.QtCore.QUrl('https://github.com/NeuroML/Documentation/issues/94#issuecomment-920721598'), background False, related False, idx None
11:36:02 DEBUG    webview    tabbedbrowser:_get_new_tab_idx:680 tabs.new_position last -> opening new tab at -1, next left: 9 / right: 10
11:36:02 DEBUG    webview    browsertab:_on_before_load_started:1041 Going to start loading: https://github.com/NeuroML/Documentation/issues/94#issuecomment-920721598
11:36:02 DEBUG    webview    tabbedbrowser:_on_title_changed:757 Changing title for idx 10 to 'https://github.com/NeuroML/Documentation/issues/94#issuecomment-920721598'
11:36:02 DEBUG    misc       eventfilter:eventFilter:53 <qutebrowser.browser.webengine.webview.WebEngineView object at 0x7fb2987685e0> got new child <PyQt5.QtWidgets.QWidget object at 0x7fb2687d9120>, installing filter
11:36:02 DEBUG    misc       app:on_focus_object_changed:582 Focus object changed: None
11:36:02 DEBUG    misc       app:on_focus_object_changed:582 Focus object changed: <PyQt5.QtWidgets.QWidget object at 0x7fb298769000>
11:36:02 DEBUG    misc       app:on_focus_object_changed:582 Focus object changed: <PyQt5.QtCore.QObject object at 0x7fb298769000>
11:36:02 DEBUG    modes      tabbedbrowser:_on_current_changed:832 Current tab changed, focusing <qutebrowser.browser.webengine.webenginetab.WebEngineTab tab_id=83 url=''>
11:36:02 DEBUG    modes      tabbedbrowser:_on_current_changed:839 Mode before tab change: normal (mode_on_change = normal)
11:36:02 DEBUG    modes      modeman:leave:424 Ignoring leave request for KeyMode.hint (reason tab changed) as we're in mode KeyMode.normal
11:36:02 DEBUG    modes      modeman:leave:424 Ignoring leave request for KeyMode.caret (reason tab changed) as we're in mode KeyMode.normal
11:36:02 DEBUG    modes      modeman:leave:424 Ignoring leave request for KeyMode.insert (reason tab changed) as we're in mode KeyMode.normal
11:36:02 DEBUG    modes      modeman:leave:424 Ignoring leave request for KeyMode.passthrough (reason tab changed) as we're in mode KeyMode.normal
11:36:02 DEBUG    modes      tabbedbrowser:_on_current_changed:850 Mode after tab change: normal (mode_on_change = normal)
11:36:02 DEBUG    ipc        ipc:_get_socket:372 In _get_socket with None socket!
11:36:02 DEBUG    webview    browsertab:_on_navigation_request:1065 navigation request: url https://github.com/NeuroML/Documentation/issues/94#issuecomment-920721598, type Type.typed, is_main_frame True
11:36:02 DEBUG    webview    webenginetab:_store_match_data:151 Active search match: 0/0
11:36:02 DEBUG    webview    browsertab:_set_load_status:1007 load status for <qutebrowser.browser.webengine.webenginetab.WebEngineTab tab_id=83 url=''>: LoadStatus.loading
11:36:02 DEBUG    signals    signalfilter:_filter_signals:87 emitting: cur_load_status_changed(<LoadStatus.loading: 6>) (tab 10)
11:36:02 DEBUG    signals    signalfilter:_filter_signals:87 emitting: cur_load_started() (tab 10)
11:36:03 DEBUG    misc       app:on_focus_object_changed:582 Focus object changed: <PyQt5.QtWidgets.QWidget object at 0x7fb2b0799240>
11:36:03 DEBUG    misc       app:on_focus_object_changed:582 Focus object changed: <PyQt5.QtCore.QObject object at 0x7fb2b0799240>
11:36:03 DEBUG    misc       app:on_focus_object_changed:582 Focus object changed: <PyQt5.QtWidgets.QWidget object at 0x7fb2b0799240>
11:36:03 DEBUG    signals    signalfilter:_filter_signals:87 emitting: cur_url_changed(PyQt5.QtCore.QUrl('https://github.com/NeuroML/Documentation/issues/94#issuecomment-920721598')) (tab 10)
11:36:03 DEBUG    webview    tabbedbrowser:_on_title_changed:757 Changing title for idx 10 to 'https://github.com/NeuroML/Documentation/issues/94#issuecomment-920721598'
11:36:03 DEBUG    webview    tabbedbrowser:_on_title_changed:757 Changing title for idx 10 to 'Issue on page /Userdocs/SingleNeuronExample.html · Issue #94 · NeuroML/Documentation'
11:36:04 DEBUG    js         shared:javascript_log_message:156 [https://github.com/NeuroML/Documentation/issues/94#issuecomment-920721598:0] Autofocus processing was blocked because a document's URL has a fragment '#issuecomment-920721598'.
11:36:04 DEBUG    webview    browsertab:_set_load_status:1007 load status for <qutebrowser.browser.webengine.webenginetab.WebEngineTab tab_id=83 url='https://github.com/NeuroML/Documentation/issues/94#issuecomment-920721598'>: LoadStatus.success_https
11:36:04 DEBUG    signals    signalfilter:_filter_signals:87 emitting: cur_load_status_changed(<LoadStatus.success_https: 3>) (tab 10)
11:36:04 DEBUG    network    hostblock:filter_request:145 Request to collector.githubapp.com blocked by host blocker.
11:36:04 DEBUG    network    hostblock:filter_request:145 Request to collector.githubapp.com blocked by host blocker.
11:36:04 DEBUG    sql        sql:run:278 INSERT INTO History (url, title, atime, redirect) values(:url, :title, :atime, :redirect)
11:36:04 DEBUG    sql        sql:run:282     {':atime': 1631788564, ':redirect': False, ':title': 'Issue on page /Userdocs/SingleNeuronExample.html · Issue #94 · NeuroML/Documentation', ':url': 'https://github.com/NeuroML/Documentation/issues/94#issuecomment-920721598'}
11:36:04 DEBUG    sql        sql:run:278 REPLACE INTO CompletionHistory (url, title, last_atime) values(:url, :title, :last_atime)
11:36:04 DEBUG    sql        sql:run:282     {':last_atime': 1631788564, ':title': 'Issue on page /Userdocs/SingleNeuronExample.html · Issue #94 · NeuroML/Documentation', ':url': 'https://github.com/NeuroML/Documentation/issues/94#issuecomment-920721598'}
11:36:04 DEBUG    signals    signalfilter:_filter_signals:87 emitting: cur_load_finished(True) (tab 10)
11:36:04 DEBUG    modes      modeman:leave:424 Ignoring leave request for KeyMode.insert (reason load started) as we're in mode KeyMode.normal
11:36:04 DEBUG    modes      tabbedbrowser:_leave_modes_on_load:737 Ignoring leave_on_load request due to setting.
11:36:08 DEBUG    misc       app:on_focus_object_changed:582 Focus object changed: <PyQt5.QtWidgets.QWidget object at 0x7fb2b07f6320>
11:36:08 DEBUG    misc       app:on_focus_object_changed:582 Focus object changed: <PyQt5.QtCore.QObject object at 0x7fb2b07f6320>
11:36:08 DEBUG    misc       app:on_focus_object_changed:582 Focus object changed: <PyQt5.QtWidgets.QWidget object at 0x7fb2b07f6320>
11:36:15 DEBUG    modes      modeman:_handle_keypress:287 got keypress in mode KeyMode.normal - delegating to <qutebrowser.keyinput.modeparsers.NormalKeyParser>
11:36:15 DEBUG    keyboard   basekeyparser:_debug_log:216 NormalKeyParser for mode normal: Got key: 0x1000020 / modifiers: 0x2000000 / text: '<Shift>' / dry_run True
11:36:15 DEBUG    keyboard   basekeyparser:_debug_log:216 NormalKeyParser for mode normal: Ignoring, only modifier
11:36:15 DEBUG    modes      modeman:_handle_keypress:312 match: 0, forward_unbound_keys: auto, passthrough: False, is_non_alnum: True, dry_run: True --> filter: False (focused: <PyQt5.QtWidgets.QWidget object at 0x7fb2687d9090>)
11:36:15 DEBUG    modes      modeman:_handle_keypress:287 got keypress in mode KeyMode.normal - delegating to <qutebrowser.keyinput.modeparsers.NormalKeyParser>
11:36:15 DEBUG    keyboard   basekeyparser:_debug_log:216 NormalKeyParser for mode normal: Got key: 0x1000020 / modifiers: 0x2000000 / text: '<Shift>' / dry_run True
11:36:15 DEBUG    keyboard   basekeyparser:_debug_log:216 NormalKeyParser for mode normal: Ignoring, only modifier
11:36:15 DEBUG    modes      modeman:_handle_keypress:312 match: 0, forward_unbound_keys: auto, passthrough: False, is_non_alnum: True, dry_run: True --> filter: False (focused: <PyQt5.QtWidgets.QWidget object at 0x7fb2687d9090>)
11:36:15 DEBUG    modes      modeman:_handle_keypress:287 got keypress in mode KeyMode.normal - delegating to <qutebrowser.keyinput.modeparsers.NormalKeyParser>
11:36:15 DEBUG    keyboard   basekeyparser:_debug_log:216 NormalKeyParser for mode normal: Got key: 0x1000020 / modifiers: 0x2000000 / text: '<Shift>' / dry_run False
11:36:15 DEBUG    keyboard   basekeyparser:_debug_log:216 NormalKeyParser for mode normal: Ignoring, only modifier
11:36:15 DEBUG    modes      modeman:_handle_keypress:312 match: 0, forward_unbound_keys: auto, passthrough: False, is_non_alnum: True, dry_run: False --> filter: False (focused: <PyQt5.QtWidgets.QWidget object at 0x7fb298741ab0>)
11:36:15 DEBUG    modes      modeman:_handle_keypress:287 got keypress in mode KeyMode.normal - delegating to <qutebrowser.keyinput.modeparsers.NormalKeyParser>
11:36:15 DEBUG    keyboard   basekeyparser:_debug_log:216 NormalKeyParser for mode normal: Got key: 0x3a / modifiers: 0x2000000 / text: ':' / dry_run True
11:36:15 DEBUG    modes      modeman:_handle_keypress:312 match: 2, forward_unbound_keys: auto, passthrough: False, is_non_alnum: False, dry_run: True --> filter: True (focused: <PyQt5.QtWidgets.QWidget object at 0x7fb298741ab0>)
11:36:15 DEBUG    modes      modeman:_handle_keypress:287 got keypress in mode KeyMode.normal - delegating to <qutebrowser.keyinput.modeparsers.NormalKeyParser>
11:36:15 DEBUG    keyboard   basekeyparser:_debug_log:216 NormalKeyParser for mode normal: Got key: 0x3a / modifiers: 0x2000000 / text: ':' / dry_run False
11:36:15 DEBUG    keyboard   basekeyparser:_debug_log:216 NormalKeyParser for mode normal: Definitive match for ':'.
11:36:15 DEBUG    keyboard   basekeyparser:_debug_log:216 NormalKeyParser for mode normal: Clearing keystring (was: :).
11:36:15 DEBUG    commands   command:run:537 command called: set-cmd-text [':']
11:36:15 DEBUG    commands   command:run:551 Calling qutebrowser.mainwindow.statusbar.command.Command.set_cmd_text_command(<qutebrowser.mainwindow.statusbar.command.Command>, ':', None, False, False, False)
11:36:15 DEBUG    completion completer:schedule_completion_update:224 Scheduling completion update.
11:36:15 DEBUG    completion completer:schedule_completion_update:221 Ignoring update because there were no changes.
11:36:15 DEBUG    modes      command:set_cmd_text:111 Setting command text, focusing <qutebrowser.mainwindow.statusbar.command.Command>
11:36:15 DEBUG    modes      modeman:enter:363 Entering mode KeyMode.command (reason: cmd focus)
11:36:15 DEBUG    statusbar  bar:set_mode_active:327 Setting command flag to True
11:36:15 DEBUG    misc       app:on_focus_object_changed:582 Focus object changed: <qutebrowser.mainwindow.statusbar.command.Command>
11:36:15 DEBUG    modes      modeman:_handle_keypress:312 match: 2, forward_unbound_keys: auto, passthrough: False, is_non_alnum: False, dry_run: False --> filter: True (focused: <qutebrowser.mainwindow.statusbar.command.Command>)
11:36:15 DEBUG    completion completer:_update_completion:246 Updating completion: []  []
11:36:15 DEBUG    completion completer:_get_new_completion:95 Before removing flags: []
11:36:15 DEBUG    completion completer:_get_new_completion:98 Starting command completion
11:36:15 DEBUG    completion debug:__exit__:306 Starting command completion took 0.044988 seconds.
11:36:15 DEBUG    misc       mainwindow:_update_overlay_geometry:350 new geometry for <qutebrowser.completion.completionwidget.CompletionView>: PyQt5.QtCore.QRect(0, 480, 1921, 506)
11:36:15 DEBUG    completion debug:__exit__:306 Set completion model took 0.006028 seconds.
11:36:15 DEBUG    completion completionmodel:set_pattern:181 Setting completion pattern ''
11:36:15 DEBUG    completion debug:__exit__:306 Set pattern  took 0.002817 seconds.
11:36:15 DEBUG    modes      modeman:_handle_keyrelease:337 filter: True
11:36:15 DEBUG    modes      modeman:_handle_keyrelease:337 filter: False
11:36:16 DEBUG    modes      modeman:_handle_keypress:287 got keypress in mode KeyMode.command - delegating to <qutebrowser.keyinput.modeparsers.CommandKeyParser do_log=False mode=<KeyMode.command: 3> passthrough=True supports_count=False win_id=3>
11:36:16 DEBUG    modes      modeman:_handle_keypress:312 match: 0, forward_unbound_keys: auto, passthrough: True, is_non_alnum: False, dry_run: True --> filter: False (focused: <qutebrowser.mainwindow.statusbar.command.Command>)
11:36:16 DEBUG    modes      modeman:_handle_keypress:287 got keypress in mode KeyMode.command - delegating to <qutebrowser.keyinput.modeparsers.CommandKeyParser do_log=False mode=<KeyMode.command: 3> passthrough=True supports_count=False win_id=3>
11:36:16 DEBUG    modes      modeman:_handle_keypress:312 match: 0, forward_unbound_keys: auto, passthrough: True, is_non_alnum: False, dry_run: False --> filter: False (focused: <qutebrowser.mainwindow.statusbar.command.Command>)
11:36:16 DEBUG    completion completer:schedule_completion_update:224 Scheduling completion update.
11:36:16 DEBUG    completion completer:schedule_completion_update:221 Ignoring update because there were no changes.
11:36:16 DEBUG    completion completer:_partition:153 partitioning ['a'] around position 1
11:36:16 DEBUG    completion completer:_partition:164 partitioned: [] 'a' []
11:36:16 DEBUG    completion completer:_update_completion:246 Updating completion: [] a []
11:36:16 DEBUG    completion completer:_get_new_completion:95 Before removing flags: []
11:36:16 DEBUG    completion completer:_get_new_completion:98 Starting command completion
11:36:16 DEBUG    completion completionmodel:set_pattern:181 Setting completion pattern 'a'
11:36:16 DEBUG    completion debug:__exit__:306 Set pattern a took 0.012537 seconds.
11:36:16 DEBUG    modes      modeman:_handle_keyrelease:337 filter: False
11:36:17 DEBUG    modes      modeman:_handle_keypress:287 got keypress in mode KeyMode.command - delegating to <qutebrowser.keyinput.modeparsers.CommandKeyParser do_log=False mode=<KeyMode.command: 3> passthrough=True supports_count=False win_id=3>
11:36:17 DEBUG    modes      modeman:_handle_keypress:312 match: 0, forward_unbound_keys: auto, passthrough: True, is_non_alnum: False, dry_run: True --> filter: False (focused: <qutebrowser.mainwindow.statusbar.command.Command>)
11:36:17 DEBUG    modes      modeman:_handle_keypress:287 got keypress in mode KeyMode.command - delegating to <qutebrowser.keyinput.modeparsers.CommandKeyParser do_log=False mode=<KeyMode.command: 3> passthrough=True supports_count=False win_id=3>
11:36:17 DEBUG    modes      modeman:_handle_keypress:312 match: 0, forward_unbound_keys: auto, passthrough: True, is_non_alnum: False, dry_run: False --> filter: False (focused: <qutebrowser.mainwindow.statusbar.command.Command>)
11:36:17 DEBUG    completion completer:schedule_completion_update:224 Scheduling completion update.
11:36:17 DEBUG    completion completer:schedule_completion_update:221 Ignoring update because there were no changes.
11:36:17 DEBUG    completion completer:_partition:153 partitioning ['as'] around position 2
11:36:17 DEBUG    completion completer:_partition:164 partitioned: [] 'as' []
11:36:17 DEBUG    completion completer:_update_completion:246 Updating completion: [] as []
11:36:17 DEBUG    completion completer:_get_new_completion:95 Before removing flags: []
11:36:17 DEBUG    completion completer:_get_new_completion:98 Starting command completion
11:36:17 DEBUG    completion completionmodel:set_pattern:181 Setting completion pattern 'as'
11:36:17 DEBUG    completion debug:__exit__:306 Set pattern as took 0.004609 seconds.
11:36:17 DEBUG    modes      modeman:_handle_keypress:287 got keypress in mode KeyMode.command - delegating to <qutebrowser.keyinput.modeparsers.CommandKeyParser do_log=False mode=<KeyMode.command: 3> passthrough=True supports_count=False win_id=3>
11:36:17 DEBUG    modes      modeman:_handle_keypress:312 match: 0, forward_unbound_keys: auto, passthrough: True, is_non_alnum: False, dry_run: True --> filter: False (focused: <qutebrowser.mainwindow.statusbar.command.Command>)
11:36:17 DEBUG    modes      modeman:_handle_keypress:287 got keypress in mode KeyMode.command - delegating to <qutebrowser.keyinput.modeparsers.CommandKeyParser do_log=False mode=<KeyMode.command: 3> passthrough=True supports_count=False win_id=3>
11:36:17 DEBUG    modes      modeman:_handle_keypress:312 match: 0, forward_unbound_keys: auto, passthrough: True, is_non_alnum: False, dry_run: False --> filter: False (focused: <qutebrowser.mainwindow.statusbar.command.Command>)
11:36:17 DEBUG    completion completer:schedule_completion_update:224 Scheduling completion update.
11:36:17 DEBUG    completion completer:schedule_completion_update:221 Ignoring update because there were no changes.
11:36:17 DEBUG    completion completer:_partition:153 partitioning ['asd'] around position 3
11:36:17 DEBUG    completion completer:_partition:164 partitioned: [] 'asd' []
11:36:17 DEBUG    completion completer:_update_completion:246 Updating completion: [] asd []
11:36:17 DEBUG    completion completer:_get_new_completion:95 Before removing flags: []
11:36:17 DEBUG    completion completer:_get_new_completion:98 Starting command completion
11:36:17 DEBUG    completion completionmodel:set_pattern:181 Setting completion pattern 'asd'
11:36:17 DEBUG    completion debug:__exit__:306 Set pattern asd took 0.003052 seconds.
11:36:17 DEBUG    modes      modeman:_handle_keyrelease:337 filter: False
11:36:17 DEBUG    modes      modeman:_handle_keypress:287 got keypress in mode KeyMode.command - delegating to <qutebrowser.keyinput.modeparsers.CommandKeyParser do_log=False mode=<KeyMode.command: 3> passthrough=True supports_count=False win_id=3>
11:36:17 DEBUG    modes      modeman:_handle_keypress:312 match: 0, forward_unbound_keys: auto, passthrough: True, is_non_alnum: False, dry_run: True --> filter: False (focused: <qutebrowser.mainwindow.statusbar.command.Command>)
11:36:17 DEBUG    modes      modeman:_handle_keypress:287 got keypress in mode KeyMode.command - delegating to <qutebrowser.keyinput.modeparsers.CommandKeyParser do_log=False mode=<KeyMode.command: 3> passthrough=True supports_count=False win_id=3>
11:36:17 DEBUG    modes      modeman:_handle_keypress:312 match: 0, forward_unbound_keys: auto, passthrough: True, is_non_alnum: False, dry_run: False --> filter: False (focused: <qutebrowser.mainwindow.statusbar.command.Command>)
11:36:17 DEBUG    completion completer:schedule_completion_update:224 Scheduling completion update.
11:36:17 DEBUG    completion completer:schedule_completion_update:221 Ignoring update because there were no changes.
11:36:17 DEBUG    completion completer:_partition:153 partitioning ['asdf'] around position 4
11:36:17 DEBUG    completion completer:_partition:164 partitioned: [] 'asdf' []
11:36:17 DEBUG    completion completer:_update_completion:246 Updating completion: [] asdf []
11:36:17 DEBUG    completion completer:_get_new_completion:95 Before removing flags: []
11:36:17 DEBUG    completion completer:_get_new_completion:98 Starting command completion
11:36:17 DEBUG    completion completionmodel:set_pattern:181 Setting completion pattern 'asdf'
11:36:17 DEBUG    completion debug:__exit__:306 Set pattern asdf took 0.000832 seconds.
11:36:17 DEBUG    modes      modeman:_handle_keyrelease:337 filter: False
11:36:17 DEBUG    modes      modeman:_handle_keyrelease:337 filter: False
11:36:17 DEBUG    modes      modeman:_handle_keypress:287 got keypress in mode KeyMode.command - delegating to <qutebrowser.keyinput.modeparsers.CommandKeyParser do_log=False mode=<KeyMode.command: 3> passthrough=True supports_count=False win_id=3>
11:36:17 DEBUG    modes      modeman:_handle_keypress:312 match: 2, forward_unbound_keys: auto, passthrough: True, is_non_alnum: False, dry_run: True --> filter: True (focused: <qutebrowser.mainwindow.statusbar.command.Command>)
11:36:17 DEBUG    modes      modeman:_handle_keypress:287 got keypress in mode KeyMode.command - delegating to <qutebrowser.keyinput.modeparsers.CommandKeyParser do_log=False mode=<KeyMode.command: 3> passthrough=True supports_count=False win_id=3>
11:36:17 DEBUG    commands   command:run:537 command called: mode-leave
11:36:17 DEBUG    commands   command:run:551 Calling qutebrowser.keyinput.modeman.ModeManager.mode_leave(<qutebrowser.keyinput.modeman.ModeManager mode=<KeyMode.command: 3>>)
11:36:17 DEBUG    modes      modeman:leave:431 Leaving mode KeyMode.command (reason: leave current)
11:36:17 DEBUG    statusbar  bar:set_mode_active:327 Setting command flag to False
11:36:17 DEBUG    completion completer:schedule_completion_update:224 Scheduling completion update.
11:36:17 DEBUG    completion completer:schedule_completion_update:221 Ignoring update because there were no changes.
11:36:17 DEBUG    statusbar  bar:_hide_cmd_widget:361 Hiding cmd widget
11:36:17 DEBUG    misc       app:on_focus_object_changed:582 Focus object changed: <qutebrowser.mainwindow.mainwindow.MainWindow>
11:36:17 DEBUG    misc       app:on_focus_object_changed:582 Focus object changed: <qutebrowser.mainwindow.statusbar.textbase.TextBase text=''>
11:36:17 DEBUG    modes      tabbedbrowser:on_mode_left:812 Left status-input mode, focusing <qutebrowser.browser.webengine.webenginetab.WebEngineTab tab_id=83 url='https://github.com/NeuroML/Documentation/issues/94#issuecomment-920721598'>
11:36:17 DEBUG    misc       app:on_focus_object_changed:582 Focus object changed: <PyQt5.QtWidgets.QWidget object at 0x7fb2981881f0>
11:36:17 DEBUG    misc       app:on_focus_object_changed:582 Focus object changed: <PyQt5.QtCore.QObject object at 0x7fb2981881f0>
11:36:17 DEBUG    modes      modeman:_handle_keypress:312 match: 2, forward_unbound_keys: auto, passthrough: True, is_non_alnum: False, dry_run: False --> filter: True (focused: <PyQt5.QtWidgets.QWidget object at 0x7fb2981881f0>)
11:36:17 DEBUG    modes      modeman:_handle_keyrelease:337 filter: True
11:36:18 DEBUG    modes      modeman:_handle_keypress:287 got keypress in mode KeyMode.normal - delegating to <qutebrowser.keyinput.modeparsers.NormalKeyParser>
11:36:18 DEBUG    keyboard   basekeyparser:_debug_log:216 NormalKeyParser for mode normal: Got key: 0x1000020 / modifiers: 0x2000000 / text: '<Shift>' / dry_run True
11:36:18 DEBUG    keyboard   basekeyparser:_debug_log:216 NormalKeyParser for mode normal: Ignoring, only modifier
11:36:18 DEBUG    modes      modeman:_handle_keypress:312 match: 0, forward_unbound_keys: auto, passthrough: False, is_non_alnum: True, dry_run: True --> filter: False (focused: <PyQt5.QtWidgets.QWidget object at 0x7fb298740550>)
11:36:18 DEBUG    modes      modeman:_handle_keypress:287 got keypress in mode KeyMode.normal - delegating to <qutebrowser.keyinput.modeparsers.NormalKeyParser>
11:36:18 DEBUG    keyboard   basekeyparser:_debug_log:216 NormalKeyParser for mode normal: Got key: 0x1000020 / modifiers: 0x2000000 / text: '<Shift>' / dry_run True
11:36:18 DEBUG    keyboard   basekeyparser:_debug_log:216 NormalKeyParser for mode normal: Ignoring, only modifier
11:36:18 DEBUG    modes      modeman:_handle_keypress:312 match: 0, forward_unbound_keys: auto, passthrough: False, is_non_alnum: True, dry_run: True --> filter: False (focused: <PyQt5.QtWidgets.QWidget object at 0x7fb298740550>)
11:36:18 DEBUG    modes      modeman:_handle_keypress:287 got keypress in mode KeyMode.normal - delegating to <qutebrowser.keyinput.modeparsers.NormalKeyParser>
11:36:18 DEBUG    keyboard   basekeyparser:_debug_log:216 NormalKeyParser for mode normal: Got key: 0x1000020 / modifiers: 0x2000000 / text: '<Shift>' / dry_run False
11:36:18 DEBUG    keyboard   basekeyparser:_debug_log:216 NormalKeyParser for mode normal: Ignoring, only modifier
11:36:18 DEBUG    modes      modeman:_handle_keypress:312 match: 0, forward_unbound_keys: auto, passthrough: False, is_non_alnum: True, dry_run: False --> filter: False (focused: <PyQt5.QtWidgets.QWidget object at 0x7fb298740550>)
11:36:18 DEBUG    modes      modeman:_handle_keypress:287 got keypress in mode KeyMode.normal - delegating to <qutebrowser.keyinput.modeparsers.NormalKeyParser>
11:36:18 DEBUG    keyboard   basekeyparser:_debug_log:216 NormalKeyParser for mode normal: Got key: 0x47 / modifiers: 0x2000000 / text: 'G' / dry_run True
11:36:18 DEBUG    modes      modeman:_handle_keypress:312 match: 2, forward_unbound_keys: auto, passthrough: False, is_non_alnum: False, dry_run: True --> filter: True (focused: <PyQt5.QtWidgets.QWidget object at 0x7fb298740550>)
11:36:18 DEBUG    modes      modeman:_handle_keypress:287 got keypress in mode KeyMode.normal - delegating to <qutebrowser.keyinput.modeparsers.NormalKeyParser>
11:36:18 DEBUG    keyboard   basekeyparser:_debug_log:216 NormalKeyParser for mode normal: Got key: 0x47 / modifiers: 0x2000000 / text: 'G' / dry_run False
11:36:18 DEBUG    keyboard   basekeyparser:_debug_log:216 NormalKeyParser for mode normal: Definitive match for 'G'.
11:36:18 DEBUG    keyboard   basekeyparser:_debug_log:216 NormalKeyParser for mode normal: Clearing keystring (was: G).
11:36:18 DEBUG    commands   command:run:537 command called: scroll-to-perc
11:36:18 DEBUG    commands   argparser:multitype_conv:158 Trying to parse None as <class 'float'>
11:36:18 DEBUG    commands   command:run:551 Calling qutebrowser.components.scrollcommands.scroll_to_perc(<qutebrowser.browser.webengine.webenginetab.WebEngineTab tab_id=83 url='https://github.com/NeuroML/Documentation/issues/94#issuecomment-920721598'>, None, None, False)
11:36:18 DEBUG    modes      modeman:_handle_keypress:312 match: 2, forward_unbound_keys: auto, passthrough: False, is_non_alnum: False, dry_run: False --> filter: True (focused: <PyQt5.QtWidgets.QWidget object at 0x7fb2b079a5f0>)
11:36:18 DEBUG    modes      modeman:_handle_keyrelease:337 filter: True
11:36:18 DEBUG    modes      modeman:_handle_keyrelease:337 filter: False
11:36:19 DEBUG    modes      modeman:_handle_keypress:287 got keypress in mode KeyMode.normal - delegating to <qutebrowser.keyinput.modeparsers.NormalKeyParser>
11:36:19 DEBUG    keyboard   basekeyparser:_debug_log:216 NormalKeyParser for mode normal: Got key: 0x44 / modifiers: 0x0 / text: 'd' / dry_run True
11:36:19 DEBUG    modes      modeman:_handle_keypress:312 match: 2, forward_unbound_keys: auto, passthrough: False, is_non_alnum: False, dry_run: True --> filter: True (focused: <PyQt5.QtWidgets.QWidget object at 0x7fb298742560>)
11:36:19 DEBUG    modes      modeman:_handle_keypress:287 got keypress in mode KeyMode.normal - delegating to <qutebrowser.keyinput.modeparsers.NormalKeyParser>
11:36:19 DEBUG    keyboard   basekeyparser:_debug_log:216 NormalKeyParser for mode normal: Got key: 0x44 / modifiers: 0x0 / text: 'd' / dry_run False
11:36:19 DEBUG    keyboard   basekeyparser:_debug_log:216 NormalKeyParser for mode normal: Definitive match for 'd'.
11:36:19 DEBUG    keyboard   basekeyparser:_debug_log:216 NormalKeyParser for mode normal: Clearing keystring (was: d).
11:36:19 DEBUG    commands   command:run:537 command called: tab-close
11:36:19 DEBUG    commands   command:run:551 Calling qutebrowser.browser.commands.CommandDispatcher.tab_close(<qutebrowser.browser.commands.CommandDispatcher>, False, False, False, False, None)
11:36:19 DEBUG    modes      tabbedbrowser:_on_current_changed:832 Current tab changed, focusing <qutebrowser.browser.webengine.webenginetab.WebEngineTab tab_id=82 url='https://github.com/phw/peek/issues/new?body=%3C%21--%0APlease read the FAQs %28https%3A%2F%2Fgithub…'>
11:36:19 DEBUG    misc       app:on_focus_object_changed:582 Focus object changed: <PyQt5.QtWidgets.QWidget object at 0x7fb298740550>
11:36:19 DEBUG    misc       app:on_focus_object_changed:582 Focus object changed: <PyQt5.QtCore.QObject object at 0x7fb298740550>
11:36:19 DEBUG    modes      tabbedbrowser:_on_current_changed:839 Mode before tab change: normal (mode_on_change = normal)
11:36:19 DEBUG    modes      modeman:leave:424 Ignoring leave request for KeyMode.hint (reason tab changed) as we're in mode KeyMode.normal
11:36:19 DEBUG    modes      modeman:leave:424 Ignoring leave request for KeyMode.caret (reason tab changed) as we're in mode KeyMode.normal
11:36:19 DEBUG    modes      modeman:leave:424 Ignoring leave request for KeyMode.insert (reason tab changed) as we're in mode KeyMode.normal
11:36:19 DEBUG    modes      modeman:leave:424 Ignoring leave request for KeyMode.passthrough (reason tab changed) as we're in mode KeyMode.normal
11:36:19 DEBUG    modes      tabbedbrowser:_on_current_changed:850 Mode after tab change: normal (mode_on_change = normal)
11:36:19 DEBUG    modes      modeman:_handle_keypress:312 match: 2, forward_unbound_keys: auto, passthrough: False, is_non_alnum: False, dry_run: False --> filter: True (focused: <PyQt5.QtWidgets.QWidget object at 0x7fb26887be20>)
11:36:19 DEBUG    destroy    objreg:on_destroyed:126 schedule removal: 83
11:36:19 DEBUG    destroy    objreg:on_destroyed:126 schedule removal: tab
11:36:19 DEBUG    misc       eventfilter:eventFilter:63 <PyQt5.QtWidgets.QWidget object at 0x7fb2981e8670>: removed child <PyQt5.QtCore.QObject object at 0x7fb26887be20>
11:36:19 DEBUG    misc       eventfilter:eventFilter:63 <PyQt5.QtWidgets.QWidget object at 0x7fb2981e8670>: removed child <PyQt5.QtWidgets.QWidget object at 0x7fb26887be20>
11:36:19 DEBUG    destroy    objreg:_on_destroyed:131 removed: 83
11:36:19 DEBUG    destroy    objreg:_on_destroyed:131 removed: tab
11:36:19 DEBUG    modes      modeman:_handle_keyrelease:337 filter: True
1
The stacktrace from above is:

11:36:02 WARNING  qt-qt.qpa.wayland Unknown module:none:0 Wayland does not support QWindow::requestActivate()
  File "/usr/bin/qutebrowser", line 33, in <module>
    sys.exit(load_entry_point('qutebrowser==2.3.1', 'gui_scripts', 'qutebrowser')())
  File "/usr/lib/python3.10/site-packages/qutebrowser/qutebrowser.py", line 220, in main
    return app.run(args)
  File "/usr/lib/python3.10/site-packages/qutebrowser/app.py", line 129, in run
    ret = qt_mainloop()
  File "/usr/lib/python3.10/site-packages/qutebrowser/app.py", line 139, in qt_mainloop
    return objects.qapp.exec()
  File "/usr/lib/python3.10/site-packages/qutebrowser/misc/ipc.py", line 394, in on_ready_read
    self._handle_data(data)
  File "/usr/lib/python3.10/site-packages/qutebrowser/misc/ipc.py", line 357, in _handle_data
    self.got_args.emit(args, target_arg, cwd)
  File "/usr/lib/python3.10/site-packages/qutebrowser/app.py", line 127, in <lambda>
    process_pos_args(args, cwd=cwd, via_ipc=True, target_arg=target_arg))
  File "/usr/lib/python3.10/site-packages/qutebrowser/app.py", line 293, in process_pos_args
    win_id = open_url(url, target=open_target, via_ipc=via_ipc)
  File "/usr/lib/python3.10/site-packages/qutebrowser/app.py", line 310, in open_url
    win_id = mainwindow.get_window(via_ipc=via_ipc, target=target,
  File "/usr/lib/python3.10/site-packages/qutebrowser/mainwindow/mainwindow.py", line 84, in get_window
    raise_window(window)
  File "/usr/lib/python3.10/site-packages/qutebrowser/mainwindow/mainwindow.py", line 100, in raise_window
    window.activateWindow()
  File "/usr/lib/python3.10/site-packages/qutebrowser/utils/log.py", line 512, in qt_message_handler
    stack: Optional[str] = ''.join(traceback.format_stack())
How to reproduce

It's hard to reproduce unfortunately. I see it most often when:

- multiple windows are open over multiple workspaces
- opening a URL from somewhere other than within qutebrowser does not open in the last recently accessed window (as it used to)
- the tab opens in another window but keypresses are sent to the most recently opened window
Here's a video that shows it (sorry, couldn't make a screen cast since I wanted to show my key-presses). You'll see that at the end, I hit d twice to close two tabs, but they're closed in the other window, not the one that I'm currently using.

https://www.dropbox.com/s/kaw6vgxro0hyl4n/VID_20210916_114124297.mp4?dl=0

I also noticed a few other traces, just pasting them here:

11:35:39 WARNING  qt-qt.qpa.wayland Unknown module:none:0 Window titles longer than 1265 characters are not supported. Truncating window title (from 4115 chars)
  File "/usr/bin/qutebrowser", line 33, in <module>
    sys.exit(load_entry_point('qutebrowser==2.3.1', 'gui_scripts', 'qutebrowser')())
  File "/usr/lib/python3.10/site-packages/qutebrowser/qutebrowser.py", line 220, in main
    return app.run(args)
  File "/usr/lib/python3.10/site-packages/qutebrowser/app.py", line 129, in run
    ret = qt_mainloop()
  File "/usr/lib/python3.10/site-packages/qutebrowser/app.py", line 139, in qt_mainloop
    return objects.qapp.exec()
  File "/usr/lib/python3.10/site-packages/qutebrowser/mainwindow/tabbedbrowser.py", line 761, in _on_title_changed
    self._update_window_title()
  File "/usr/lib/python3.10/site-packages/qutebrowser/mainwindow/tabbedbrowser.py", line 317, in _update_window_title
    self.widget.window().setWindowTitle(title)
  File "/usr/lib/python3.10/site-packages/qutebrowser/utils/log.py", line 512, in qt_message_handler
    stack: Optional[str] = ''.join(traceback.format_stack())

11:35:39 WARNING  qt-qt.qpa.wayland Unknown module:none:0 Window titles longer than 1265 characters are not supported. Truncating window title (from 4116 chars)
  File "/usr/bin/qutebrowser", line 33, in <module>
    sys.exit(load_entry_point('qutebrowser==2.3.1', 'gui_scripts', 'qutebrowser')())
  File "/usr/lib/python3.10/site-packages/qutebrowser/qutebrowser.py", line 220, in main
    return app.run(args)
  File "/usr/lib/python3.10/site-packages/qutebrowser/app.py", line 129, in run
    ret = qt_mainloop()
  File "/usr/lib/python3.10/site-packages/qutebrowser/app.py", line 139, in qt_mainloop
    return objects.qapp.exec()
  File "/usr/lib/python3.10/site-packages/qutebrowser/browser/webengine/webenginetab.py", line 1523, in _on_load_progress
    super()._on_load_progress(perc)
  File "/usr/lib/python3.10/site-packages/qutebrowser/browser/browsertab.py", line 1131, in _on_load_progress
    self.load_progress.emit(perc)
  File "/usr/lib/python3.10/site-packages/qutebrowser/mainwindow/tabbedbrowser.py", line 877, in _on_load_progress
    self._update_window_title()
  File "/usr/lib/python3.10/site-packages/qutebrowser/mainwindow/tabbedbrowser.py", line 317, in _update_window_title
    self.widget.window().setWindowTitle(title)
  File "/usr/lib/python3.10/site-packages/qutebrowser/utils/log.py", line 512, in qt_message_handler
    stack: Optional[str] = ''.join(traceback.format_stack())


The current workaround is to start Qutebrowser in a terminal with the `QT_QPA_PLATFORM=xcb`

Comment 1 Ankur Sinha (FranciscoD) 2021-09-29 14:21:09 UTC
We're not yet sure if this is a Qutebrowser issue or a Qt one, or a Wayland one. Not sure how to go about narrowing that down yet.

Comment 2 Ankur Sinha (FranciscoD) 2021-09-29 20:05:58 UTC
qt5-qtwayland-5.15.2-11.fc35.x86_64


Note You need to log in before you can comment on or make changes to this bug.