chjj / compton

A compositor for X11.
Other
2.25k stars 500 forks source link

imagemagick and xscreensaver programs cannot draw into root window #226

Open aliveinadream opened 10 years ago

aliveinadream commented 10 years ago

If I try animate -window root some_file.gif or /usr/lib/xscreensaver/helix -root

nothing is displayed at all in the root window. If I kill compton then the programs display correctly.

ghost commented 10 years ago

I can reproduce this with both the mentioned programs using --config /dev/null. I can also do so using my config:

backend = "glx";
vsync = "opengl-swc";
paint-on-overlay = true;
glx-no-stencil = true;
xrender-sync = true;
xrender-sync-fence = true;

I suppose I never noticed it because I have feh in my xinitrc running before compton.

Edit: Feh can set the wallpaper while compton is running, for me at least.

actionless commented 10 years ago

i've encountered that issue when was trying to set "live" wallpaper using one of xscreensaver's "hacks" (how they're naming it)

i've seen a workaround here: https://wiki.archlinux.org/index.php/XScreenSaver#XScreenSaver_as_wallpaper_under_xcompmgr

richardgv commented 10 years ago

It is not sensible to use compton with another application that attempts to draw to the root window, because compton (directly, or indirectly if --paint-on-overlay is used) draws to the root window as well. Two applications drawing onto the same window may introduces unexpected behaviors.

To make it work you would have to wrap the thing you wish to draw inside another window, as xwinwrap in the solution provided by @actionless does. (Modifying _XROOTPMAP_ID / _XSETROOT_ID would work as well, but I guess nobody would be interested in it.)

tomkel commented 10 years ago

@richardgv Wrapping mpv or gifview with xwinwrap doesn't seem to work, so I'm interested in modifying _XROOTPMAP_ID or _XSETROOT_ID. Compton creates an X window with the properties

COMPTON_VERSION(STRING) = "git-v0.1_beta2-47-g8c88b4d-2014-09-07"
_NET_WM_PID(CARDINAL) = 30213
WM_LOCALE_NAME(STRING) = "en_US.UTF-8"
WM_CLASS(STRING) = "compton", "xcompmgr"
WM_CLIENT_MACHINE(STRING) = "arch"
WM_ICON_NAME(STRING) = "xcompmgr"
WM_NAME(STRING) = "xcompmgr"

Playing to this window from mpv or gifview however does nothing. If there were a writable window which compton created then it would be simple to play animated backgrounds with compton.

richardgv commented 10 years ago

@tomkel:

Sorry for the late reply.

To wrap mpv to a full-screen background window with xwinwrap:

xwinwrap -ov -fs -- mpv -vo x11 -wid WID /path/to/video/file

(mpv actually plays animated GIF.)

To wrap (animated) gifview with xwinwrap:

xwinwrap -ov -fs -- gifview -w WID -a /tmp/email.jpg.gif

Playing to this window from mpv or gifview however does nothing.

No, that window is not visible and painting to it will not work. Its sole purpose is to tell some applications "xcompmgr" is running. I was talking about _XROOTPMAP_ID or _XSETROOT_ID on the root window, and making using of them would be nontrivial.

tomkel commented 10 years ago

@richardgv

Thank you for your helpful reply. I forgot to mention that xwinwrap doesn't work. Some very strange behaviors occur, perhaps it is better if you see what it does than me attempt to explain it. For the record, I am using bspwm as my window manager.

richardgv commented 10 years ago

@tomkel:

With baskerville/bspwm@9f8f115534 and baskerville/bspwm@0.8.9, both commands I gave above work correctly here. Note that "xv" output of mpv causes the content to float over other windows here -- please use -vo x11.

Or probably, you have something weird in bspwm configuration that causes the window to be restacked?

tomkel commented 10 years ago

@richardgv

Thank you for your time again in testing this issue, going the length of installing two different versions of bspwm to test.

Here is an example of what happens: https://mediacru.sh/Yoj7a-YHy2T_

richardgv commented 10 years ago

@tomkel:

The command I mentioned in the previous reply is:

xwinwrap -ov -fs -- gifview -w WID -a /path/to/the/gif-file.gif

And what I saw in your video is:

xwinwrap -ov -fs -- gifview -w root -a /path/to/the/gif-file.gif

-w root would not work, unfortunately. I suppose -w WID is the correct one.

tomkel commented 10 years ago

@richardgv The -w flag specifies an existing window to draw to. Are you suggesting I draw to a window with an integer ID of WID?

richardgv commented 10 years ago

@tomkel:

xwinwrap creates a window for painting, then internally replaces WID argument to the target command with the ID of its window, to tell the application where to paint. So, yes, use -w WID, literally.

tomkel commented 9 years ago

@richardgv Wow, good to know! And voila, it works!!!! Thank you for your time and support!