-
-
Notifications
You must be signed in to change notification settings - Fork 620
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
[Bug]: Conky 1.19.7 makes tint2 crash #1767
Comments
Try 1.19.8 if you can, this is probably fixed with #1748. |
I'm tried new version. Slackware64-15.0 with latest update now/today;
With old version, |
Hello, i tried conky 1.19.8 and, as above, when i move the mouse over my conky, tint2 crashes. `
mars 05 14:23:41 archlinux systemd[1]: systemd-coredump@0-1152-0.service: Deactivated successfully.
|
tint2 17.0.2-3 with conky 1.9.7 - tint2 crashes when I move my mouse over conky. |
I've found that the crash only happens when the conky config file contains |
Thanks, |
Bisected: Commit description fits the crime described in the stack trace: If this bug fix is correct, it's maybe tint2's fault? |
I'm running Slackware 15.0 I thought I was loosing my mind, when I saw tint2-17.0.2 disappear and was crashed.
These are my Conky settings I am using in Slack. conky.config = { own_window = true, own_window_argb_visual = true, minimum_width = 2560, double_buffer = true, alignment = 'top_middle', conky.text = [[ |
And I am running FreeBSD, Conky 1.19.8, Openbox 3.6_10, Tint 16.7_4 |
Hi everyone. I have solved this issue (as good as it gets for now). This line will fix the problem int tint2 if((e->type==4 || e->type==5 || e->type==6) && e->xproperty.window==server.root_win) Insert it after line 420 in main.c (source of tint2 from github) to modify the handle_x_event function. You will have to ofcourse compile and install tint2 again. I hope it helps As for the explanation of the problem and fix (I will try my best here) For whatever reason that I have not fully investigated yet, hovering or clicking on Conky on your desktop triggers a certain kind of event in tint2 which gets poorly handled. Normally in tint2 the Desktop events are handled fine as they have a different "type" assigned to them, but conky triggers them with type 4 or 5 or 6 (hover, press and release) and window id of the root window. The segfault happens with a null panel is returned and the event handler tries to iterate on it. My code will make tint2 ignore these events involving conky My suspicion is that the real problem might be elsewhere like in Conky or Xlib because other widgets on my desktop don't trigger the event in the same way. I have a weather widget and notes widget on my desktop that don't cause tint2 to crash. This may also have something to do with the settings in conkyrc, mine has the settings own_window yes For various reasons like appearance tastes, my conky rc settings let conky blend into the desktop and doesn't show up in the taskbar. Let me know if it works out for you guys. Thanks |
The fault is probably on conky side. I changed how event propagation works which is causing the crash now because conky (captures and) propagates more events than it previously did. @lineage-of-roots gave a good patch for tint2 code that avoids this bad interaction.
Mouse events get captured differently (not at all) when conky is mounted on root window. Conky passes events to the desktop window (if not captured from the lua hook) in order to appear "transparent". If |
I did some further investigation and testing: I have now confirmed that the tint2 crash happens when interacting with conky on the following Window Managers My guess is it will happen on all Window Managers ...Because tint2 will not crash when interacting with conky on Desktop Environments such as MATE, XFCE, LXDE, Plasma(X11) On Desktop Environments the event type that tint2 receives is 28 PropertyNotify I haven't looked at the conky code but from the snippet @Caellian showed, I am guessing it has something to do with the line XSendEvent(display, window.desktop, False, window.event_mask, &ev); Particulary, the window.desktop that's being passed...Could this be working as intended for Desktop Environments but not Window managers? Whereever window.desktop is coming from in the conky code, could be the culprit. However, I am just guessing about conky here. I hope I was of help to the guys working on conky |
tint2 listens for There's another bug where, even though we're propagating mouse events to the root, right clicking doesn't open the menu on openbox. Have to investigate openbox sources to figure out how it opens the menu - The fault isn't fully ours though,
Here's a patch for curl https://gist.githubusercontent.com/Caellian/334a31b00ddeaec2b124a8e66125e251/raw/fixes.patch | git apply - and then re-building. This still requires more tinkering to be considered fixed:
|
@Caellian This can be seen when setting a breakpoint on the lines and XGetInputFocus(display, &focused, &_revert_to); in x11.cc The Openbox menu will appear as long as execution is held. It will lose focus to something afterwards. I am not sure what it loses it to. In Fluxbox, the menu grabs focus and holds on to it, so the menu appears, but Openbox seems to not do that. Another interesting tidbit is that Fluxbox will only respond to events sent to the root window and not to Fluxbox directly. In MATE desktop environment, I couldn't get the desktop menu to appear in any case. It didn't respond to root window events or sent to desktop Works fine in Plasma(x11), the menu appears Lastly, I am sure you already know this.... in case of Window Managers the window.desktop and window.root get set to the same id, but in Desktop Environments (At least in Mate Desktop Environment) window.desktop and window.root are different. |
The code was missing a call to
which (I believe) I removed during the initial rewrite of the function (because I tested only on Plasma and Gnome).
MATE uses caja for desktop icons and menu, so I added code to figure out the window behind conky, which now returns (propagates events to) caja but it still doesn't open the menu. The window behind thing should work best in most cases because it redirects the event to whatever is in the position of the cursor (mouse event) and would get the event if conky wasn't there. |
@Caellian As far as MATE is concerned, it seems this is a GTK thing. Particularly, that GTK will ignore stuff coming from Xsendevent() (Unless the app is somehow set up to receive them) , so that's why the Menu won't appear on MATE. Now the question is: Why is it working on Gnome? |
@Caellian, I have Conky 1.19.8, Openbox and Tint2. Menus on Openbox open but mouse movement over Conky kill tint2. |
It's not (because all events go though that), it's just ignoring basic X11 input events and instead uses (newer) Xinput events. Gnome might be supporting those for backwards compatibility reasons. I'm moving that to a separate PR as changing it will require rewriting large parts of event code and I don't want to create a large and hard to read PR (again). I'm marking this issue as wontfix and closing it, because it can't (shouldn't; everything's possible) be fixed from conky code. So, we're doing exactly the same as
curl https://gist.githubusercontent.com/Caellian/334a31b00ddeaec2b124a8e66125e251/raw/fixes.patch | git apply - The final version of the patch includes suggestion from @lineage-of-roots as well. So now, the code is super safe. |
Thank you for your work, everything works fine. |
@brunoGenX @Caellian There's a new updated tint2 package in the Arch repos as of a couple hours ago. I installed it and verified that it doesn't crash due to conky anymore. So I guess it's upto the maintainers of packages in other distros to update their tint2. And just to answer my own confusion...It turns out that events sent to root window get sent everywhere listening for them. I was under the impression that tint2 was getting the event "Before" the window manager, however, all listening children of the root window get it. |
Nice, I left a comment on AUR with the patch, it's possible the maintainer applied the patch in the build script since.
I'm just wondering what's the difference between someone clicking on the background and us sending the event - i.e. why isn't a regular click being propagated (I'm pretty sure we're setting "propagate" argument to False while sending the event). |
@Caellian Counterintuitively, setting "propagate" to "false" in the XsendEvent() function makes sure it gets sent to all children. And from the Documentation: • Even if set to "True" there's still a chance it gets sent everywhere. I don't yet fully understand what setting it to "True" means...But setting it to false does guarantee it gets sent to all children of root window. |
I think the |
@Caellian I just wanted to know one more thing. When setting own_window_type to desktop, the code doing event sending does not get executed. When it's set to own_window_type normal, that's when the event event sending works. |
Currect, current implementation of mouse events works best with |
What happened?
Hello,
Conky 1.19.7-1 crash and makes crash tint2 (taskbar).
Conky 1.19.7-2 work fine (issue 1748) but makes crash tint2
Conky and tint2 works fine with conky 1.19.6
`mars 03 09:22:00 archlinux kernel: tint2[2856]: segfault at 40 ip 000061e7396ec2f5 sp 00007ffd87bcfbf0 error 4 in tint2[61e7396c2000+3f000] likely on CPU 3 (core 1, socket 0)
mars 03 09:22:00 archlinux kernel: Code: 77 04 39 d6 7f e1 01 f1 31 c0 39 d1 0f 9d c0 c3 0f 1f 44 00 00 f3 0f 1e fa 41 56 49 89 fe 41 55 41 89 d5 41 54 41 89 f4 55 53 <49> 8b 5e 40 48 85 db 75 1b eb 6c 44 89 ea 44 89 e6 48 89 ef ff d1
mars 03 09:22:00 archlinux systemd[1]: Started Process Core Dump (PID 2860/UID 0).
mars 03 09:22:00 archlinux systemd-coredump[2861]: [🡕] Process 2856 (tint2) of user 1000 dumped core.
mars 03 09:22:00 archlinux systemd[1]: systemd-coredump@1-2860-0.service: Deactivated successfully.`
Thanks in advance
Version
1.19.7-2
Which OS/distro are you seeing the problem on?
Arch Linux
Conky config
No response
Stack trace
No response
Relevant log output
No response
The text was updated successfully, but these errors were encountered: