New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

i3 reload sucks up tray icons #3589

Open
bebehei opened this Issue Jan 16, 2019 · 9 comments

Comments

Projects
None yet
7 participants
@bebehei
Copy link
Contributor

bebehei commented Jan 16, 2019

I'm submitting a…

[x] Bug

Current Behavior

After reload of i3, the tray bar sucks up some tray icons albeit the processes of the sucked up tray icons are still running. The only workaround is to kill and restart the processes.

These tray icons are opened from left to right:

  • nm-applet (gtk)
  • syncthing-gtk (gtk)
  • telegram (qt)
  • keepassxc (qt)
  • redshift-gtk (gtk)

image

$> i3-msg reload

image

Only syncthing, nm and redshift are still there. But the qt apps are "gone", albeit their processes are still running:

[bebe:~] % pgrep telegram
15778
[bebe:~] % pgrep keepass 
15802

It started to happen in last December. We figured it out during 35c3, that it's actually QT vs. GTK. Since then I'm looking in my pacman log, where possible changes happened. But I can't link a single update to the problem.

Reproduction Instructions

Launch some QT applications with tray icons and reload.

Expected Behavior

Obviously, all icons should be displayed.

Environment

Output of i3 --moreversion 2>&-:

Binary i3 version:  4.16 (2018-11-04) © 2009 Michael Stapelberg and contributors
Running i3 version: 4.16 (2018-11-04) (pid 8564)o abort…)
Loaded i3 config: /home/bebe/.config/i3/config (Last modified: Di 09 Okt 2018 09:43:16 CEST, 8576985 seconds ago)

The i3 binary you just called: /usr/bin/i3
The i3 binary you are running: i3
- Linux Distribution & Version: ArchLinux
- Are you using a compositor (e.g., xcompmgr or compton): compton
@i3bot

This comment has been minimized.

Copy link

i3bot commented Jan 16, 2019

I don’t see a link to logs.i3wm.org. Did you follow https://i3wm.org/docs/debugging.html? (In case you actually provided a link to a logfile, please ignore me.)

@i3bot i3bot added the 4.16 label Jan 16, 2019

@bebehei bebehei changed the title i3 reload i3 reload sucks up tray icons Jan 16, 2019

@chron-isch

This comment has been minimized.

Copy link

chron-isch commented Jan 17, 2019

Hi, I've experienced this problems on Archlinux as well.
i3-wm 4.16
Qt 5.12

It started with the Qt 5.12 update in the middle of December, downgrading to Qt 5.11.2 solved the problem for me, having to recompile every package build against Qt 5.12 is less than ideal though.

It only happens to Qt tray icons, firewall-aplett (from firewalld) and keepassxc for example.

I'm currently at work, will post logs as soon as I'm home.

@Airblader

This comment has been minimized.

Copy link
Member

Airblader commented Jan 17, 2019

Possible duplicate of #3335

@chron-isch

This comment has been minimized.

Copy link

chron-isch commented Jan 17, 2019

OK,

the only icon in tray was keepassxc, and it disappeared after i3-msg reload. This also happens during output display changes, which I need to do way more offen than i3-msg reload/restart.

I tried to keep the i3 log as short as possible: https://logs.i3wm.org/logs/5682017521893376.bz2

and the interesting part of i3bar.log (with the statusline dumps removed for readability):

[../i3-4.16/../i3-4.16/i3bar/src/xcb.c:706] _NET_SYSTEM_TRAY_OPCODE received
[../i3-4.16/../i3-4.16/i3bar/src/xcb.c:751] xembed format = 32, len = 2
[../i3-4.16/../i3-4.16/i3bar/src/xcb.c:753] xembed version = 0
[../i3-4.16/../i3-4.16/i3bar/src/xcb.c:754] xembed flags = 1
[../i3-4.16/../i3-4.16/i3bar/src/xcb.c:764] X window 00a00006 requested docking
[../i3-4.16/../i3-4.16/i3bar/src/xcb.c:824] Mapping dock client
[../i3-4.16/../i3-4.16/i3bar/src/xcb.c:1874] Drawing bars...
[../i3-4.16/../i3-4.16/i3bar/src/xcb.c:1884] Output xroot-0 inactive, skipping...
[../i3-4.16/../i3-4.16/i3bar/src/xcb.c:1901] Drawing button for WS log at x = 0, len = 21
[../i3-4.16/../i3-4.16/i3bar/src/xcb.c:1977] Printing statusline!
[../i3-4.16/../i3-4.16/i3bar/src/xcb.c:935] PropertyNotify
[../i3-4.16/../i3-4.16/i3bar/src/xcb.c:935] PropertyNotify
[../i3-4.16/../i3-4.16/i3bar/src/xcb.c:935] PropertyNotify
[../i3-4.16/../i3-4.16/i3bar/src/xcb.c:935] PropertyNotify
[../i3-4.16/../i3-4.16/i3bar/src/xcb.c:935] PropertyNotify
[../i3-4.16/../i3-4.16/i3bar/src/xcb.c:878] MapNotify for window = 00a00006, event = 00a00006
[../i3-4.16/../i3-4.16/i3bar/src/xcb.c:884] checking output eDP1
[../i3-4.16/../i3-4.16/i3bar/src/xcb.c:890] Tray client mapped (window ID 00a00006). Adjusting tray.
[../i3-4.16/../i3-4.16/i3bar/src/xcb.c:677] Configuring tray window 00a00006 to x=1347
[../i3-4.16/../i3-4.16/i3bar/src/xcb.c:1874] Drawing bars...
[../i3-4.16/../i3-4.16/i3bar/src/xcb.c:1884] Output xroot-0 inactive, skipping...
[../i3-4.16/../i3-4.16/i3bar/src/xcb.c:1901] Drawing button for WS log at x = 0, len = 21
[../i3-4.16/../i3-4.16/i3bar/src/xcb.c:1977] Printing statusline!
[../i3-4.16/../i3-4.16/i3bar/src/child.c:304] copying statusline_buffer to statusline_head
[../i3-4.16/../i3-4.16/i3bar/src/xcb.c:1874] Drawing bars...
[../i3-4.16/../i3-4.16/i3bar/src/xcb.c:1884] Output xroot-0 inactive, skipping...
[../i3-4.16/../i3-4.16/i3bar/src/xcb.c:1901] Drawing button for WS log at x = 0, len = 21
[../i3-4.16/../i3-4.16/i3bar/src/xcb.c:1977] Printing statusline!
[../i3-4.16/../i3-4.16/i3bar/src/child.c:304] copying statusline_buffer to statusline_head
[../i3-4.16/../i3-4.16/i3bar/src/xcb.c:1874] Drawing bars...
[../i3-4.16/../i3-4.16/i3bar/src/xcb.c:1884] Output xroot-0 inactive, skipping...
[../i3-4.16/../i3-4.16/i3bar/src/xcb.c:1901] Drawing button for WS log at x = 0, len = 21
[../i3-4.16/../i3-4.16/i3bar/src/xcb.c:1977] Printing statusline!
[../i3-4.16/../i3-4.16/i3bar/src/child.c:304] copying statusline_buffer to statusline_head
[../i3-4.16/../i3-4.16/i3bar/src/xcb.c:1874] Drawing bars...
[../i3-4.16/../i3-4.16/i3bar/src/xcb.c:1884] Output xroot-0 inactive, skipping...
[../i3-4.16/../i3-4.16/i3bar/src/xcb.c:1901] Drawing button for WS log at x = 0, len = 21
[../i3-4.16/../i3-4.16/i3bar/src/xcb.c:1977] Printing statusline!
[../i3-4.16/../i3-4.16/i3bar/src/child.c:304] copying statusline_buffer to statusline_head
[../i3-4.16/../i3-4.16/i3bar/src/xcb.c:1874] Drawing bars...
[../i3-4.16/../i3-4.16/i3bar/src/xcb.c:1884] Output xroot-0 inactive, skipping...
[../i3-4.16/../i3-4.16/i3bar/src/xcb.c:1901] Drawing button for WS log at x = 0, len = 21
[../i3-4.16/../i3-4.16/i3bar/src/xcb.c:1977] Printing statusline!
[../i3-4.16/../i3-4.16/i3bar/src/ipc.c:217] Got data!
[../i3-4.16/../i3-4.16/i3bar/src/ipc.c:157] Got mode event!
[../i3-4.16/../i3-4.16/i3bar/src/mode.c:53] Setting pango_markup to 0.
[../i3-4.16/../i3-4.16/i3bar/src/mode.c:86] Got mode change: default
[../i3-4.16/../i3-4.16/i3bar/src/xcb.c:1874] Drawing bars...
[../i3-4.16/../i3-4.16/i3bar/src/xcb.c:1884] Output xroot-0 inactive, skipping...
[../i3-4.16/../i3-4.16/i3bar/src/xcb.c:1901] Drawing button for WS log at x = 0, len = 21
[../i3-4.16/../i3-4.16/i3bar/src/xcb.c:1977] Printing statusline!
[../i3-4.16/../i3-4.16/i3bar/src/ipc.c:217] Got data!
[../i3-4.16/../i3-4.16/i3bar/src/ipc.c:136] Got workspace event!
[../i3-4.16/../i3-4.16/i3bar/src/ipc.c:217] Got data!
[../i3-4.16/../i3-4.16/i3bar/src/ipc.c:181] Received bar config update "{"id":"bar-0","tray_outputs":["primary"],"tray_padding":2,"mode":"dock","hidden_state":"hide","modifier":64,"position":"bottom","status_command":"i3blocks","font":"pango:DejaVu Sans Mono 12px","workspace_buttons":true,"strip_workspace_numbers":false,"strip_workspace_name":false,"binding_mode_indicator":true,"verbose":true,"colors":{"background":"#000000","statusline":"#ffffff","focused_workspace_bg":"#285577","focused_workspace_text":"#ffffff","active_workspace_bg":"#333333","active_workspace_text":"#ffffff","inactive_workspace_bg":"#222222","inactive_workspace_text":"#888888","urgent_workspace_bg":"#900000","urgent_workspace_text":"#ffffff"}}"
[../i3-4.16/../i3-4.16/i3bar/src/config.c:101] Adding tray_output = primary to the list.
[../i3-4.16/../i3-4.16/i3bar/src/config.c:337] tray_padding = 2
[../i3-4.16/../i3-4.16/i3bar/src/config.c:109] mode = dock, len = 4
[../i3-4.16/../i3-4.16/i3bar/src/config.c:117] hidden_state = hide, len = 4
[../i3-4.16/../i3-4.16/i3bar/src/config.c:343] modifier = 64
[../i3-4.16/../i3-4.16/i3bar/src/config.c:182] position = bottom
[../i3-4.16/../i3-4.16/i3bar/src/config.c:188] command = i3blocks
[../i3-4.16/../i3-4.16/i3bar/src/config.c:195] font = pango:DejaVu Sans Mono 12px
[../i3-4.16/../i3-4.16/i3bar/src/config.c:290] workspace_buttons = 1
[../i3-4.16/../i3-4.16/i3bar/src/config.c:296] strip_workspace_numbers = 0
[../i3-4.16/../i3-4.16/i3bar/src/config.c:302] strip_workspace_name = 0
[../i3-4.16/../i3-4.16/i3bar/src/config.c:284] binding_mode_indicator = 1
[../i3-4.16/../i3-4.16/i3bar/src/config.c:237] background = bar_bg = #000000
[../i3-4.16/../i3-4.16/i3bar/src/config.c:236] statusline = bar_fg = #ffffff
[../i3-4.16/../i3-4.16/i3bar/src/config.c:243] focused_workspace_bg = focus_ws_bg = #285577
[../i3-4.16/../i3-4.16/i3bar/src/config.c:244] focused_workspace_text = focus_ws_fg = #ffffff
[../i3-4.16/../i3-4.16/i3bar/src/config.c:246] active_workspace_bg = active_ws_bg = #333333
[../i3-4.16/../i3-4.16/i3bar/src/config.c:247] active_workspace_text = active_ws_fg = #ffffff
[../i3-4.16/../i3-4.16/i3bar/src/config.c:249] inactive_workspace_bg = inactive_ws_bg = #222222
[../i3-4.16/../i3-4.16/i3bar/src/config.c:250] inactive_workspace_text = inactive_ws_fg = #888888
[../i3-4.16/../i3-4.16/i3bar/src/config.c:252] urgent_workspace_bg = urgent_ws_bg = #900000
[../i3-4.16/../i3-4.16/i3bar/src/config.c:253] urgent_workspace_text = urgent_ws_fg = #ffffff
[libi3] ../i3-4.16/../i3-4.16/libi3/font.c Using Pango font DejaVu Sans Mono, size 12
[../i3-4.16/../i3-4.16/i3bar/src/xcb.c:1263] Calculated font height: 15
[../i3-4.16/../i3-4.16/i3bar/src/xcb.c:1400] Setting bar_fg = #ffffff as _NET_SYSTEM_TRAY_COLORS
[../i3-4.16/../i3-4.16/i3bar/src/xcb.c:1874] Drawing bars...
[../i3-4.16/../i3-4.16/i3bar/src/xcb.c:1884] Output xroot-0 inactive, skipping...
[../i3-4.16/../i3-4.16/i3bar/src/xcb.c:1901] Drawing button for WS log at x = 0, len = 21
[../i3-4.16/../i3-4.16/i3bar/src/xcb.c:1977] Printing statusline!
[../i3-4.16/../i3-4.16/i3bar/src/ipc.c:217] Got data!
[../i3-4.16/../i3-4.16/i3bar/src/ipc.c:46] Got workspace data!
[../i3-4.16/../i3-4.16/i3bar/src/workspaces.c:143] Got workspace canonical: log, name: 'log', name_width: 21, glyphs: 3
[../i3-4.16/../i3-4.16/i3bar/src/xcb.c:1874] Drawing bars...
[../i3-4.16/../i3-4.16/i3bar/src/xcb.c:1884] Output xroot-0 inactive, skipping...
[../i3-4.16/../i3-4.16/i3bar/src/xcb.c:1901] Drawing button for WS log at x = 0, len = 21
[../i3-4.16/../i3-4.16/i3bar/src/xcb.c:1977] Printing statusline!
[../i3-4.16/../i3-4.16/i3bar/src/ipc.c:217] Got data!
[../i3-4.16/../i3-4.16/i3bar/src/ipc.c:66] Clearing old output configuration...
[../i3-4.16/../i3-4.16/i3bar/src/ipc.c:69] Parsing outputs JSON...
[../i3-4.16/../i3-4.16/i3bar/src/ipc.c:71] Reconfiguring windows...
[../i3-4.16/../i3-4.16/i3bar/src/xcb.c:1640] Destroying window for output xroot-0
[../i3-4.16/../i3-4.16/i3bar/src/xcb.c:1645] Creating window for output eDP1
[../i3-4.16/../i3-4.16/i3bar/src/xcb.c:1874] Drawing bars...
[../i3-4.16/../i3-4.16/i3bar/src/xcb.c:1884] Output xroot-0 inactive, skipping...
[../i3-4.16/../i3-4.16/i3bar/src/xcb.c:1977] Printing statusline!
[../i3-4.16/../i3-4.16/i3bar/src/xcb.c:906] UnmapNotify for window = 00a00006, event = 00a00006
[../i3-4.16/../i3-4.16/i3bar/src/xcb.c:912] checking output eDP1
[../i3-4.16/../i3-4.16/i3bar/src/ipc.c:217] Got data!
[../i3-4.16/../i3-4.16/i3bar/src/ipc.c:46] Got workspace data!
[../i3-4.16/../i3-4.16/i3bar/src/workspaces.c:143] Got workspace canonical: log, name: 'log', name_width: 21, glyphs: 3
[../i3-4.16/../i3-4.16/i3bar/src/xcb.c:1874] Drawing bars...
[../i3-4.16/../i3-4.16/i3bar/src/xcb.c:1884] Output xroot-0 inactive, skipping...
[../i3-4.16/../i3-4.16/i3bar/src/xcb.c:1901] Drawing button for WS log at x = 0, len = 21
[../i3-4.16/../i3-4.16/i3bar/src/xcb.c:1977] Printing statusline!
[../i3-4.16/../i3-4.16/i3bar/src/child.c:304] copying statusline_buffer to statusline_head
[../i3-4.16/../i3-4.16/i3bar/src/child.c:308] dumping statusline: 
@chron-isch

This comment has been minimized.

Copy link

chron-isch commented Jan 17, 2019

@bebehei If you haven't cleared /var/cache/pacman/pkg/ recently, you need to downgrade every single qt5 package to 5.11.2 to work around the bug.

pacman -U phonon-qt5-4.10.1-2-x86_64.pkg.tar.xz pyqt5-common-5.11.3-1-x86_64.pkg.tar.xz python-pyqt5-5.11.3-1-x86_64.pkg.tar.xz python2-pyqt5-5.11.3-1-x86_64.pkg.tar.xz qt5-3d-5.11.2-1-x86_64.pkg.tar.xz qt5-base-5.11.2-3-x86_64.pkg.tar.xz qt5-charts-5.11.2-1-x86_64.pkg.tar.xz qt5-datavis3d-5.11.2-1-x86_64.pkg.tar.xz qt5-declarative-5.11.2-1-x86_64.pkg.tar.xz qt5-location-5.11.2-2-x86_64.pkg.tar.xz qt5-multimedia-5.11.2-1-x86_64.pkg.tar.xz qt5-script-5.11.2-1-x86_64.pkg.tar.xz qt5-scxml-5.11.2-1-x86_64.pkg.tar.xz qt5-sensors-5.11.2-1-x86_64.pkg.tar.xz qt5-serialport-5.11.2-1-x86_64.pkg.tar.xz qt5-speech-5.11.2-1-x86_64.pkg.tar.xz qt5-svg-5.11.2-1-x86_64.pkg.tar.xz qt5-tools-5.11.2-2-x86_64.pkg.tar.xz qt5-webchannel-5.11.2-1-x86_64.pkg.tar.xz qt5-webengine-5.11.2-2-x86_64.pkg.tar.xz qt5-websockets-5.11.2-1-x86_64.pkg.tar.xz qt5-x11extras-5.11.2-1-x86_64.pkg.tar.xz qt5-xmlpatterns-5.11.2-1-x86_64.pkg.tar.xz qt5ct-0.36-1-x86_64.pkg.tar.xz qt5-webkit-5.212.0alpha2-21-x86_64.pkg.tar.xz

Keep in mind though that I don't have every qt5 extra package installed, so there could be a few missing from that command. Don't forget to update IgnorePkg or set IgnoreGroup = qt5 and that you need to rebuild every package using the new Qt 5.12 libs.

@JonnyHaystack

This comment has been minimized.

Copy link

JonnyHaystack commented Jan 18, 2019

Isn't this just because the clients aren't repainting their icons because those applications just have static icons to show they are running? I always thought it was intended behaviour, although it can be quite annoying.

@algmyr

This comment has been minimized.

Copy link

algmyr commented Jan 18, 2019

Isn't this just because the clients aren't repainting their icons because those applications just have static icons to show they are running?

Doesn't seem like it. Mumble behaves the same way, and it updates the icons shown in the tray pretty frequently. Interestingly, I still got a popup that tried to originate from the icon that wasn't there anymore.

image
(Before restart, After restart, Popup after restart)

Can also confirm that the GTK and QT4 applications I've tried work fine. So it definitely seems to be some regression in QT5.

@bebehei

This comment has been minimized.

Copy link
Contributor Author

bebehei commented Jan 22, 2019

@chron-isch Thank you for the clear commands. I appreciate your i3 log.

@algmyr Pretty interesting catch!

Made some progress in debugging it!

  • I've inspected the QSystemTrayIcon class and used a small Qt example as a reproducer.
  • I modified my i3-config and added another bar. Only the second bar has got a configured tray_output, so I have a tray output, which I can regularly start for debugging in terminal with i3-bar -b bar-1.

Most important thing are the Qt docs for the isSystemTrayAvailable getter:

If the system tray is currently unavailable but becomes available later, QSystemTrayIcon will automatically add an entry in the system tray if it is visible.

So you can create a QSystemTrayIcon and call its show() function, which should display the object in the traybar. If there's no traybar available, it'll be an object with void functionality for your program. But if there's a traybar coming up later, the icon should get displayed immediately.

But with my Qt version, this isn't the case. I have to actively call hide() and show() on the QSystemTrayIcon object that it'll get shown if there's a traybar spawning after the program.

I still don't know, whether this is a QT bug. I'm probably going to bisect Qt now.

@bebehei

This comment has been minimized.

Copy link
Contributor Author

bebehei commented Feb 1, 2019

I can't bisect Qt. It's not feasible for me. I haven't got enough space free on my SSD. Parallel build takes more than 24GB of RAM. And using one job takes forever. Also partial rebuilds aren't possible. Also the active use of submodules makes it harder. Worst conditions to do bisection.

But: I've opened an upstream Qt issue. Let's see what the Qt devs say.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment