As some of you might be aware, there's a bug with either Conky or PCManFM (the desktop manager aspect of it) that makes the Conky window disappear in one of these situations:
- Setting "own_window_type override" in .conkyrc (the usual configuration for Nautilus) flat out doesn't show the Conky window at all.
- Setting "own_window_type desktop" in .conkyrc shows the Conky window, but it disappears if you click on the desktop.
- Setting "own_window_type normal" in .conkyrc shows the Conky window, it doesn't disappear when clicking on the desktop, BUT... it disappears if you use LXPanel's "Minimize all windows" plugin ("Show desktop" equivalent). This happens if using the keyboard shortcut as well.
There are some workarounds to this, such as deactivating PCManFM's desktop management (and using feh for setting the wallpaper and, presumably, iDesk for the icons) or using another file manager altogether, but I've come to notice these are all subpar solutions. I really like PCManFM and I really like Conky. What's a guy to do? :-/
So I dug in LXPanel's source and found a relevant piece of code that might house my fix. The file is src/plugins/wincmd.c .
The idea I have is that when the "Minimize all windows" button is clicked, all windows (class) names would be compared to a static string "Conky" and if it matches, it simply wouldn't minimize that window. Simple, and it should work. But the problem is it has been a few years since I've touched any C code and I haven't really played with Xlib that much.
So far, I have done the following changes:
19a20
> #include <string.h>
77a79,82
>
> /* Getting window's class name */
> XClassHint class;
> XGetClassHint(GDK_DISPLAY(), client_list[i], &class);
81c88
< if (((task_desktop == -1) || (task_desktop == current_desktop))
---
> if (((task_desktop == -1) || (task_desktop == current_desktop) || strcmp(class.res_name, "Conky") != 0)
This compiles correctly, but when I run the new lxpanel and click on "Minimize all windows", Conky still disappears as before.
If someone can look into this file and see if my changes make sense, I'd be very grateful.
Thanks SO! :)