question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[wayland] focus is taken from layer shell application (i think)

See original GitHub issue

The issue:

Qtile version : 0.21.1.dev47+gbfa55e75

Issue : when i have rofi open and another application opens the focus will change to the newly opened window, hence rofi will be on top of it and clicking it is required to regain focus.

I’m using rofi with wayland support.

This issue does not occur on sway nor on Qitle with X11 backend.

Qtile with X11 backend : rofi will have focus but hidden under the application.

Logs with DEBUG flag since nothing show up without it: What’s inside the logs :

  • Switching to desktop 2.
  • Launching rofi and running firefox.
  • Open rofi again.
  • Wait for firefox to open.
  • Now firefox has focus while rofi is on top.
  • Firefox has keyboard rofi don’t.
  • Click on rofi and close with ESC.
  • Switch to desktop 1.
2022-05-29 19:03:42,971 DEBUG libqtile hook.py:fire():L396 Internal event: client_name_updated((Window(name='noen@none: tail -f .local/share/qtile/qtile.log', wid=2),), {})
2022-05-29 19:03:45,156 DEBUG libqtile interface.py:call():L310 Command: toscreen((), {'toggle': True})
2022-05-29 19:03:45,157 DEBUG libqtile window.py:_on_unmap():L702 Signal: xdgwindow unmap
2022-05-29 19:03:45,158 DEBUG libqtile hook.py:fire():L396 Internal event: setgroup((), {})
2022-05-29 19:03:45,160 DEBUG libqtile hook.py:fire():L396 Internal event: focus_change((), {})
2022-05-29 19:03:45,160 DEBUG libqtile hook.py:fire():L396 Internal event: layout_change((<libqtile.layout.columns.Columns object at 0x7f60befe37f0>, <group.Group ('二')>), {})
2022-05-29 19:03:45,651 DEBUG libqtile interface.py:call():L310 Command: spawn(('rofi -show drun',), {})
2022-05-29 19:03:45,698 DEBUG libqtile core.py:_on_new_layer_surface():L488 Signal: layer_shell new_surface_event
2022-05-29 19:03:45,699 DEBUG libqtile output.py:organise_layers():L250 Output: organising layers
2022-05-29 19:03:45,699 INFO libqtile core.py:_on_new_layer_surface():L493 Managing new layer_shell window with window ID: 3
2022-05-29 19:03:45,699 DEBUG libqtile hook.py:fire():L396 Internal event: client_new((Static(name='<no name>', wid=3),), {})
2022-05-29 19:03:45,699 DEBUG libqtile hook.py:fire():L396 Internal event: client_managed((Static(name='<no name>', wid=3),), {})
2022-05-29 19:03:45,750 DEBUG libqtile window.py:_on_map():L1481 Signal: layerstatic map
2022-05-29 19:03:45,751 DEBUG libqtile output.py:organise_layers():L250 Output: organising layers
2022-05-29 19:03:45,751 DEBUG libqtile core.py:focus_window():L802 Focussing new window
2022-05-29 19:03:45,751 DEBUG libqtile hook.py:fire():L396 Internal event: client_focus((Static(name='<no name>', wid=3),), {})
2022-05-29 19:03:45,819 DEBUG libqtile output.py:organise_layers():L250 Output: organising layers
2022-05-29 19:03:46,238 DEBUG libqtile window.py:_on_unmap():L1487 Signal: layerstatic unmap
2022-05-29 19:03:46,239 DEBUG libqtile output.py:organise_layers():L250 Output: organising layers
2022-05-29 19:03:46,239 DEBUG libqtile output.py:organise_layers():L250 Output: organising layers
2022-05-29 19:03:46,239 DEBUG libqtile window.py:_on_destroy():L1221 Signal: static destroy
2022-05-29 19:03:46,239 DEBUG libqtile hook.py:fire():L396 Internal event: client_killed((Static(name='<no name>', wid=3),), {})
2022-05-29 19:03:47,299 DEBUG libqtile interface.py:call():L310 Command: spawn(('rofi -show drun',), {})
2022-05-29 19:03:47,336 DEBUG libqtile core.py:_on_new_layer_surface():L488 Signal: layer_shell new_surface_event
2022-05-29 19:03:47,337 DEBUG libqtile output.py:organise_layers():L250 Output: organising layers
2022-05-29 19:03:47,337 INFO libqtile core.py:_on_new_layer_surface():L493 Managing new layer_shell window with window ID: 3
2022-05-29 19:03:47,337 DEBUG libqtile hook.py:fire():L396 Internal event: client_new((Static(name='<no name>', wid=3),), {})
2022-05-29 19:03:47,337 DEBUG libqtile hook.py:fire():L396 Internal event: client_managed((Static(name='<no name>', wid=3),), {})
2022-05-29 19:03:47,390 DEBUG libqtile window.py:_on_map():L1481 Signal: layerstatic map
2022-05-29 19:03:47,390 DEBUG libqtile output.py:organise_layers():L250 Output: organising layers
2022-05-29 19:03:47,391 DEBUG libqtile core.py:focus_window():L802 Focussing new window
2022-05-29 19:03:47,391 DEBUG libqtile hook.py:fire():L396 Internal event: client_focus((Static(name='<no name>', wid=3),), {})
2022-05-29 19:03:47,453 DEBUG libqtile output.py:organise_layers():L250 Output: organising layers
2022-05-29 19:03:47,546 DEBUG libqtile core.py:_on_new_xdg_surface():L349 Signal: xdg_shell new_surface_event
2022-05-29 19:03:47,554 DEBUG libqtile window.py:_on_map():L652 Signal: xdgwindow map
2022-05-29 19:03:47,555 DEBUG libqtile window.py:_on_map():L657 Managing new top-level window with window ID: 4
2022-05-29 19:03:47,555 DEBUG libqtile hook.py:fire():L396 Internal event: client_new((Window(name='Mozilla Firefox', wid=4),), {})
2022-05-29 19:03:47,555 DEBUG libqtile hook.py:fire():L396 Internal event: group_window_add((<group.Group ('二')>, Window(name='Mozilla Firefox', wid=4)), {})
2022-05-29 19:03:47,556 DEBUG libqtile hook.py:fire():L396 Internal event: focus_change((), {})
2022-05-29 19:03:47,556 DEBUG libqtile window.py:_on_map():L652 Signal: xdgwindow map
2022-05-29 19:03:47,556 DEBUG libqtile core.py:focus_window():L802 Focussing new window
2022-05-29 19:03:47,557 DEBUG libqtile hook.py:fire():L396 Internal event: client_focus((Window(name='Mozilla Firefox', wid=4),), {})
2022-05-29 19:03:47,557 DEBUG libqtile hook.py:fire():L396 Internal event: client_managed((Window(name='Mozilla Firefox', wid=4),), {})
2022-05-29 19:03:50,570 DEBUG libqtile core.py:focus_window():L802 Focussing new window
2022-05-29 19:03:50,571 DEBUG libqtile hook.py:fire():L396 Internal event: client_focus((Static(name='<no name>', wid=3),), {})
2022-05-29 19:03:51,013 DEBUG libqtile window.py:_on_unmap():L1487 Signal: layerstatic unmap
2022-05-29 19:03:51,014 DEBUG libqtile output.py:organise_layers():L250 Output: organising layers
2022-05-29 19:03:51,015 DEBUG libqtile hook.py:fire():L396 Internal event: focus_change((), {})
2022-05-29 19:03:51,016 DEBUG libqtile core.py:focus_window():L802 Focussing new window
2022-05-29 19:03:51,017 DEBUG libqtile hook.py:fire():L396 Internal event: client_focus((Window(name='Mozilla Firefox', wid=4),), {})
2022-05-29 19:03:51,018 DEBUG libqtile output.py:organise_layers():L250 Output: organising layers
2022-05-29 19:03:51,018 DEBUG libqtile window.py:_on_destroy():L1221 Signal: static destroy
2022-05-29 19:03:51,019 DEBUG libqtile hook.py:fire():L396 Internal event: client_killed((Static(name='<no name>', wid=3),), {})
2022-05-29 19:03:51,603 DEBUG libqtile interface.py:call():L310 Command: toscreen((), {'toggle': True})
2022-05-29 19:03:51,603 DEBUG libqtile window.py:_on_map():L652 Signal: xdgwindow map
2022-05-29 19:03:51,603 DEBUG libqtile core.py:focus_window():L802 Focussing new window
2022-05-29 19:03:51,604 DEBUG libqtile hook.py:fire():L396 Internal event: client_focus((Window(name='noen@none: tail -f .local/share/qtile/qtile.log', wid=2),), {})
2022-05-29 19:03:51,604 DEBUG libqtile window.py:_on_unmap():L702 Signal: xdgwindow unmap
2022-05-29 19:03:51,604 DEBUG libqtile hook.py:fire():L396 Internal event: setgroup((), {})
2022-05-29 19:03:51,604 DEBUG libqtile hook.py:fire():L396 Internal event: focus_change((), {})
2022-05-29 19:03:51,605 DEBUG libqtile hook.py:fire():L396 Internal event: layout_change((<libqtile.layout.columns.Columns object at 0x7f60befe36d0>, <group.Group ('一')>), {})
2022-05-29 19:03:59,932 DEBUG libqtile core.py:_on_request_cursor():L345 Signal: seat request_set_cursor_event
2022-05-29 19:04:12,090 DEBUG libqtile hook.py:fire():L396 Internal event: focus_change((), {})
2022-05-29 19:04:12,091 DEBUG libqtile hook.py:fire():L396 Internal event: client_focus((Window(name='noen@none: tail -f .local/share/qtile/qtile.log', wid=2),), {})
2022-05-29 19:04:12,292 DEBUG libqtile hook.py:fire():L396 Internal event: focus_change((), {})
2022-05-29 19:04:12,293 DEBUG libqtile hook.py:fire():L396 Internal event: client_focus((Window(name='noen@none: tail -f .local/share/qtile/qtile.log', wid=2),), {})
2022-05-29 19:04:12,305 DEBUG libqtile core.py:_on_request_set_primary_selection():L259 Signal: seat request_set_primary_selection
2022-05-29 19:04:12,738 DEBUG libqtile core.py:_on_request_set_primary_selection():L259 Signal: seat request_set_primary_selection
2022-05-29 19:04:12,840 DEBUG libqtile hook.py:fire():L396 Internal event: focus_change((), {})
2022-05-29 19:04:12,841 DEBUG libqtile hook.py:fire():L396 Internal event: client_focus((Window(name='noen@none: tail -f .local/share/qtile/qtile.log', wid=2),), {})
2022-05-29 19:04:13,012 DEBUG libqtile hook.py:fire():L396 Internal event: focus_change((), {})
2022-05-29 19:04:13,014 DEBUG libqtile hook.py:fire():L396 Internal event: client_focus((Window(name='noen@none: tail -f .local/share/qtile/qtile.log', wid=2),), {})
2022-05-29 19:04:13,020 DEBUG libqtile core.py:_on_request_set_primary_selection():L259 Signal: seat request_set_primary_selection
2022-05-29 19:04:13,106 DEBUG libqtile core.py:_on_request_set_primary_selection():L259 Signal: seat request_set_primary_selection
2022-05-29 19:04:13,160 DEBUG libqtile hook.py:fire():L396 Internal event: focus_change((), {})
2022-05-29 19:04:13,161 DEBUG libqtile hook.py:fire():L396 Internal event: client_focus((Window(name='noen@none: tail -f .local/share/qtile/qtile.log', wid=2),), {})

Required:

  • I have searched past issues to see if this bug has already been reported.

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
Sydiepuscommented, Jun 4, 2022

Thanks again, I’ll try to contribute with code instead of reporting issues, Not sure how that will workout.

0reactions
m-colcommented, Oct 28, 2022

Support for the input inhibitor protocol was implemented in https://github.com/qtile/qtile/commit/c8d3aad10ecdc9ce3837011f8efdb38787604695 which means that clients that want exclusive input (e.g. screen lockers) will get it. There is a similar X11 protocol which vanilla rofi and similar tools use so they can get exclusive input. From what I can tell the wayland fork of rofi doesn’t yet implement support for this, but doing so would fix this issue. I believe this to be the resolution (please do correct me if you disagree), so I’m closing this as resolved (on the qtile side).

Read more comments on GitHub >

github_iconTop Results From Across the Web

[Feature request] always on top window wayland #5779 - GitHub
While you could sure use layer-shell to make your surface appear on top of everything else, it would cease being an actual application...
Read more >
Writing a Wayland compositor with wlroots: shells
Above application windows, the top-most layer always has keyboard focus if it requests it.
Read more >
Draft: ext-layer-shell: new protocol (!28) · Merge requests
The ext-layer-shell protocol can be used to allow clients to create portable desktop ... To my knowledge, all compositors focus the layer surface...
Read more >
wlr layer shell protocol - Wayland Explorer
This requests the compositor to allow this surface to be focused and unfocused by the user in an implementation-defined manner. The user should...
Read more >
Hotkey to open/retract yakuake doesn't work in Wayland if flag ...
STEPS TO REPRODUCE 1. Log into plasma-wayland 2. Enable option "Use Open/Retract action to focus window" in Yakuake settings 3. Try to use ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found