Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Compton and shadow for tray #223
Compton draws shadow for tray, even with option "... attempts to avoid painting shadows on panels and docks" (option -C from command line) - because it gets window's hints and with this option does not make shadows for windows of type _NET_WM_WINDOW_TYPE_DOCK. This is not visible, when tray placed at bottom, but when tray placed at top or left side of screen - shadow is "slightly ugly".
"Quick fix": set tray's window hints after creating windows - in func. StartupTray (in tray.c) right after create trays's window(after "tp->window = JXCreateWindow(...)"), before check opacity - "if(settings.trayOpacity < UINT_MAX) ..." add this code:
"Right fix": add function in hint.c, which set type hint for all JWM's windows - trays, menus and dialog. This will make JWM "more relevant" freedesktop.org standards. BTW, JWM uses _NET_WM_WINDOW_TYPE hints for other windows, but not for own )
I agree JWM should set _NET_WM_WINDOW_TYPE on all of its windows. I think the set of windows is status windows for move/resize, menus, trays, and confirm dialogs.
JWM reads these hints, but, since JWM controls its own windows, it doesn't set the hints. Obviously that would be useful for things like compton and other pagers, etc.
I am afraid to write the patch - you rewrite it .... Currently, Freedesktop.org provides (http://standards.freedesktop.org/wm-spec/1.3/ar01s05.html) the following types of windows (I have noted those that are in the JWM):
Small window with size and position - specific to JWM, for them hints are not required, I suppose.
Don't be afraid to write a patch. I usually try to make things look consistent and may change stuff around if I think there's a better way to accomplish something, but I certainly don't mind doing so. I know the code pretty well (obviously) and like to keep things consistent if possible, but that shouldn't stop anyone from tinkering and submitting patches.
In any case, this is a pretty small and useful change, so I added a new "SetAtomAtom" function to hint.c and call it to set the window type after the relevant XCreateWindow calls.
added a commit
Sep 19, 2015
Mmm... Your last commit doesn't work for trays, because initialization of atoms(atomsList) occures after creation of tray(s) - maybe call StartupHints() before call any Startup() in func. Startup (in main.c)? Another "lite refactoring" suggestion: so if atoms have already initialized, may be to rewrite code with call JXInternAtom in dock.c and tray.c?