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.

Focus doesn't switch on notification click

See original GitHub issue

The issue:

I am using focus_on_window_activation="focus" in my config file. Everything appears to work fine, although when I use kotatogram-desktop(fork of telegram-desktop) and click on notification, focus doesn’t switch. It’s not a telegram issue, because everything works fine when I use i3wm or another wm/de.

Steps to reproduce:

  1. Add focus_on_window_activation="focus" to your config file
  2. Install kotatogram-desktop using yay or another aur helper (yay -S kotatogram-desktop) # arch only
  3. Start kotatogram-desktop
  4. Register/login to telegram
  5. Switch to another workspace
  6. Ask someone to send you a message / write message to yourself from the second account
  7. Wait for popup notification to appear. Click on it notification It’s actually doesn’t matter, if you use kotatogram-desktop or telegram-desktop, so you can use either.

Expected behaviour:

  1. Focus switches to the telegram window and the current chat opens

Actual behaviour:

  1. Nothing happens on the notification click

Xprop output of the window:

_NET_WM_USER_TIME(CARDINAL) = 22504492
_NET_WM_STATE(ATOM) =
_NET_FRAME_EXTENTS(CARDINAL) = 2, 2, 2, 2
_NET_WM_DESKTOP(CARDINAL) = 1
WM_STATE(WM_STATE):
		window state: Normal
		icon window: 0x0
_KDE_NET_WM_DESKTOP_FILE(UTF8_STRING) = "appimagekit_d2192f48ebc43a9db26e1dfa2bc5097b-Kotatogram_Desktop"
_NET_WM_ICON_NAME(UTF8_STRING) =
XdndAware(ATOM) = BITMAP
WM_NAME(STRING) = "Kotatogram (118873)"
_NET_WM_NAME(UTF8_STRING) = "Kotatogram (118873)"
_MOTIF_WM_HINTS(_MOTIF_WM_HINTS) = 0x3, 0x3e, 0x7e, 0x0, 0x0
_NET_WM_WINDOW_TYPE(ATOM) = _NET_WM_WINDOW_TYPE_NORMAL
_XEMBED_INFO(_XEMBED_INFO) = 0x0, 0x1
WM_CLIENT_LEADER(WINDOW): window id # 0x2400008
WM_HINTS(WM_HINTS):
		Client accepts input or input focus: True
		window id # of group leader: 0x2400008
_NET_WM_PID(CARDINAL) = 510559
_NET_WM_SYNC_REQUEST_COUNTER(CARDINAL) = 37748743
WM_CLASS(STRING) = "kotatogram-desktop", "KotatogramDesktop"
WM_PROTOCOLS(ATOM): protocols  WM_DELETE_WINDOW, WM_TAKE_FOCUS, _NET_WM_PING, _NET_WM_SYNC_REQUEST
WM_NORMAL_HINTS(WM_SIZE_HINTS):
		user specified location: 0, 25
		user specified size: 1920 by 1055
		program specified minimum size: 465 by 375
		window gravity: Static

Xprop output of the notification:

_NET_WM_STATE(ATOM) = _NET_WM_STATE_ABOVE, _NET_WM_STATE_STAYS_ON_TOP
WM_TRANSIENT_FOR(WINDOW): window id # 0x2400008
_NET_WM_WINDOW_OPACITY(CARDINAL) = 4294967295
XdndAware(ATOM) = BITMAP
WM_NAME(STRING) =
_NET_WM_NAME(UTF8_STRING) = "KotatogramDesktop"
_MOTIF_WM_HINTS(_MOTIF_WM_HINTS) = 0x2, 0x1, 0x0, 0x0, 0x0
_NET_WM_WINDOW_TYPE(ATOM) = _NET_WM_WINDOW_TYPE_UTILITY, _KDE_NET_WM_WINDOW_TYPE_OVERRIDE, _NET_WM_WINDOW_TYPE_NORMAL
_XEMBED_INFO(_XEMBED_INFO) = 0x0, 0x1
WM_CLIENT_LEADER(WINDOW): window id # 0x2400008
WM_HINTS(WM_HINTS):
		Client accepts input or input focus: True
		window id # of group leader: 0x2400008
_NET_WM_PID(CARDINAL) = 510559
_NET_WM_SYNC_REQUEST_COUNTER(CARDINAL) = 37748878
WM_CLASS(STRING) = "kotatogram-desktop", "KotatogramDesktop"
WM_PROTOCOLS(ATOM): protocols  WM_DELETE_WINDOW, WM_TAKE_FOCUS, _NET_WM_PING, _NET_WM_SYNC_REQUEST
WM_NORMAL_HINTS(WM_SIZE_HINTS):
		user specified location: 1513, 971
		user specified size: 400 by 100
		program specified minimum size: 400 by 100
		program specified maximum size: 400 by 100
		window gravity: Static

Qtile logs: nothing Qtile version: 0.21.0 Server: X11

Required:

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

Issue Analytics

  • State:open
  • Created a year ago
  • Comments:12 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
Fom123commented, May 28, 2022

Before click (when the notification appears):

2022-05-28 19:59:28,383 libqtile core.py:_xpoll():L301  X11 event: PropertyNotify (targets: [<bound method Window.handle_PropertyNotify of Window(name='Kotatogram (382801)', wid=12582918)>, <bound method Core.handle_PropertyNotify of <libqtile.backend.x11.core.Core object at 0x7fdf766a2230>>])
2022-05-28 19:59:28,384 libqtile hook.py:fire():L396  Internal event: client_name_updated((Window(name='Kotatogram (382802)', wid=12582918),), {})
2022-05-28 19:59:28,385 libqtile core.py:_xpoll():L301  X11 event: PropertyNotify (targets: [<bound method Window.handle_PropertyNotify of Window(name='Kotatogram (382802)', wid=12582918)>, <bound method Core.handle_PropertyNotify of <libqtile.backend.x11.core.Core object at 0x7fdf766a2230>>])
2022-05-28 19:59:28,386 libqtile hook.py:fire():L396  Internal event: client_name_updated((Window(name='Kotatogram (382802)', wid=12582918),), {})
2022-05-28 19:59:28,386 libqtile core.py:_xpoll():L301  X11 event: PropertyNotify (targets: [<bound method Window.handle_PropertyNotify of Window(name='Kotatogram (382802)', wid=12582918)>, <bound method Core.handle_PropertyNotify of <libqtile.backend.x11.core.Core object at 0x7fdf766a2230>>])
2022-05-28 19:59:28,521 libqtile hook.py:fire():L396  Internal event: net_wm_icon_change((Window(name='Kotatogram (382802)', wid=12582918),), {})
2022-05-28 19:59:28,524 libqtile core.py:_xpoll():L301  X11 event: ClientMessage (targets: [<bound method Core.handle_ClientMessage of <libqtile.backend.x11.core.Core object at 0x7fdf766a2230>>])
2022-05-28 19:59:28,524 libqtile core.py:_xpoll():L301  X11 event: ClientMessage (targets: [<bound method Core.handle_ClientMessage of <libqtile.backend.x11.core.Core object at 0x7fdf766a2230>>])
2022-05-28 19:59:28,524 libqtile core.py:_xpoll():L301  X11 event: ConfigureNotify (targets: [])
2022-05-28 19:59:28,530 libqtile core.py:_xpoll():L301  X11 event: ConfigureNotify (targets: [])
2022-05-28 19:59:28,557 libqtile core.py:_xpoll():L301  X11 event: ConfigureNotify (targets: [])
2022-05-28 19:59:28,573 libqtile core.py:_xpoll():L301  X11 event: ConfigureNotify (targets: [])
2022-05-28 19:59:28,599 libqtile core.py:_xpoll():L301  X11 event: ConfigureNotify (targets: [])
2022-05-28 19:59:28,617 libqtile core.py:_xpoll():L301  X11 event: ConfigureNotify (targets: [])
2022-05-28 19:59:28,642 libqtile core.py:_xpoll():L301  X11 event: ConfigureNotify (targets: [])

After click:

2022-05-28 20:01:25,592 libqtile hook.py:fire():L396  Internal event: net_wm_icon_change((Window(name='Kotatogram (382835)', wid=12582918),), {})
2022-05-28 20:01:25,594 libqtile core.py:_xpoll():L301  X11 event: ConfigureRequest (targets: [<bound method Window.handle_ConfigureRequest of Window(name='Kotatogram (382835)', wid=12582918)>, <bound method Core.handle_ConfigureRequest of <libqtile.backend.x11.core.Core object at 0x7fdf766a2230>>])
2022-05-28 20:01:25,648 libqtile core.py:_xpoll():L301  X11 event: ConfigureRequest (targets: [<bound method Window.handle_ConfigureRequest of Window(name='Kotatogram (382835)', wid=12582918)>, <bound method Core.handle_ConfigureRequest of <libqtile.backend.x11.core.Core object at 0x7fdf766a2230>>])
2022-05-28 20:01:25,670 libqtile core.py:_xpoll():L301  X11 event: UnmapNotify (targets: [<bound method Core.handle_UnmapNotify of <libqtile.backend.x11.core.Core object at 0x7fdf766a2230>>])
2022-05-28 20:01:25,671 libqtile core.py:_xpoll():L301  X11 event: EnterNotify (targets: [])
2022-05-28 20:01:25,671 libqtile core.py:_xpoll():L301  X11 event: UnmapNotify (targets: [<bound method Core.handle_UnmapNotify of <libqtile.backend.x11.core.Core object at 0x7fdf766a2230>>])
2022-05-28 20:01:26,621 libqtile core.py:_xpoll():L301  X11 event: DestroyNotify (targets: [<bound method Core.handle_DestroyNotify of <libqtile.backend.x11.core.Core object at 0x7fdf766a2230>>])
2022-05-28 20:01:28,989 libqtile core.py:_xpoll():L301  X11 event: PropertyNotify (targets: [<bound method Window.handle_PropertyNotify of Window(name='Kotatogram (382835)', wid=12582918)>, <bound method Core.handle_PropertyNotify of <libqtile.backend.x11.core.Core object at 0x7fdf766a2230>>])
2022-05-28 20:01:28,992 libqtile hook.py:fire():L396  Internal event: client_name_updated((Window(name='Kotatogram (382836)', wid=12582918),), {})
2022-05-28 20:01:28,992 libqtile core.py:_xpoll():L301  X11 event: PropertyNotify (targets: [<bound method Window.handle_PropertyNotify of Window(name='Kotatogram (382836)', wid=12582918)>, <bound method Core.handle_PropertyNotify of <libqtile.backend.x11.core.Core object at 0x7fdf766a2230>>])
2022-05-28 20:01:28,993 libqtile hook.py:fire():L396  Internal event: client_name_updated((Window(name='Kotatogram (382836)', wid=12582918),), {})
2022-05-28 20:01:28,993 libqtile core.py:_xpoll():L301  X11 event: PropertyNotify (targets: [<bound method Window.handle_PropertyNotify of Window(name='Kotatogram (382836)', wid=12582918)>, <bound method Core.handle_PropertyNotify of <libqtile.backend.x11.core.Core object at 0x7fdf766a2230>>])

0reactions
github-actions[bot]commented, Nov 24, 2022

This issue is stale because it has been open 90 days with no activity. Remove stale label or comment or this will be closed in 30 days.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Focus Mode Not Working? Try These 8 Troubleshooting Tips
Why Am I Getting Notifications from Some Apps? · Open Settings and select Focus. Tap Focus · Select the Focus mode you want...
Read more >
Focus Not Working on your iPhone? 10 Ways to Fix the Issue
Tap on Apps under “Allowed Notifications” at the top of the screen. Turn off the Time-Sensitive toggle under “Also Allow”.
Read more >
How to get focus to the tab when a desktop notification is ...
In Firefox focusing window from JS is disabled due to security reasons. You have to switch flag dom.disable_window_flip to false in about:config.
Read more >
Share Focus Status Not Showing Up In Messages???
Check if Focus is enabled in Settings > Messages. If this is off, this may be why it is not appearing. Have a...
Read more >
Clicking notification on Windows doesn't focus the app even ...
Unlike on OS X, clicking a web notification triggered on Windows 10 doesn't focus the app, even with a window.focus() in the click...
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