A question about XCompositeRedirectSubwindows

Egil Möller egil at innovationgarage.no
Tue Jun 19 21:23:11 UTC 2018


Oups, sorry for my reply-to-you-only, that was a mistake.

So my problem with letting events "fall through" to the window is that I
plan to do zoom (hence the OpenGL), both in and out, and would like to
have events working even in a zoomed state... The window manager idea
I'd like to build is one that extends the multiple virtual workspaces
metaphor into an infinite desktop that you can zoom and pan as you like,
and paste a window onto at any size at any zoom level... It might be a
bit hard as a first project this deep into X stuff, but it's something
I've wanted to build for a long while. So, what are the reasons
synthesizing events will fail (and how will they fail)?

Hehe, that is the impression I got from plowing through the specs and
code too.. It would kind of be useful to get to talk to one of those
people about how things are "supposed to work".

Thanks! I think I might need it :P


On 19. juni 2018 16:52, Jasper St. Pierre wrote:
> Hi,
>
> (Re-adding xorg-devel. Please make sure to keep the list CC'd in the
> future)
>
> It is possible for a window to set "no background color", in which
> case the existing window contents are used for the pixmap. xclock
> likely sets no background color. You can check an individual window's
> properties with xwininfo.
>
> Redrawing the screen every frame isn't a bad idea for a simple
> compositor to get started. For a more fancy, complete redraw loop, you
> can track when windows get drawn to with with the Damage extension,
> and schedule a repaint when that happens. Bonus points if you use the
> damage rectangles to be more accurate with your redraw. Also, helpful
> hint that windows get their backing pixmaps thrown away when resized
> -- you need to pay attention to ConfigureNotify and regrab the backing
> pixmap with XCompositeNameWindowPixmap, and that whole jazz.
>
> I don't recommend synthesizing input events -- a lot of things are
> likely to break or just not work well. Set an empty input shape on the
> COW, and make sure to draw windows where they want to be. Pay
> attention to MotionNotify events from windows that are moving.
>
> I'm unaware of any beginner-level documentation or tutorials. The
> number of people that have written a compositing manager from scratch
> can be counted on one hand, and a lot of them had a hand in designing
> the architecture to begin with.
> https://magcius.github.io/xplain/article/composite.html has some ideas
> of the broader concepts, but none of the details.
>
> Good luck.
>
> On Tue, Jun 19, 2018 at 2:01 AM Egil Möller <egil at innovationgarage.no
> <mailto:egil at innovationgarage.no>> wrote:
>
>     Hi!
>
>     Thanks for answering a noob question :) Ha! That's so not
>     documented (in an obvious way)! I was assuming that I could get
>     the initial window content, as already drawn (obviously clipped to
>     whatever is visible on screen) directly... So why does xclock
>     "work" then? I just haven't gotten around to event handling yet,
>     wanted to learn the drawing/copying methods themselves first...
>
>     Two follow up questions:
>
>       * How should I redraw the screen? As often as I can, or waiting
>     for some event for all redirected windows (which event)?
>       * Can I capture input events (key, mouse) for the overlay window
>     and then somehow synthesize them for whatever window / subwindow
>     my window manager thinks it has drawn in that position? Some docs
>     I read sounded like this is impossible, and you should turn of
>     input for the overlay, and position the real window underneath in
>     a "strategic position"...
>
>     Also, is there any good documentation and/or tutorials around this
>     anywhere?
>
>     /Egil
>
>     On 19. juni 2018 08:42, Jasper St. Pierre wrote:
>>     Hi,
>>
>>     What you're seeing here is a fun little side effect of composite.
>>     As you might be aware, unredirected X windows don't have any
>>     backing storage beyond the front buffer -- the full window
>>     contents are not really there. That means that when the X server
>>     first goes to redirect these windows, it decides that it should
>>     let the window paint again, and sends the window an Expose event
>>     to let it know it should repaint. A side effect of this is that
>>     the X server redraws the background for the window. This is the
>>     semantics for what an Expose event means -- an area that is
>>     "Exposed" is the background color until the client paints over it.
>>
>>     The client will eventually paint its window contents, but since
>>     your CM does not appear to have a frame loop, and it only paints
>>     once, you do not see the updated frame contents.
>>
>>     On Sun, Jun 17, 2018 at 1:28 PM Egil Möller
>>     <egil at innovationgarage.no <mailto:egil at innovationgarage.no>> wrote:
>>
>>         Hi!
>>
>>         I'm trying to write a new compositing window manager, and
>>         finding the
>>         documentation for the API:s I need quite spread out.
>>
>>         The particular problem I'm having right now is that copying
>>         some windows (xclock) using
>>         XCompositeRedirectSubwindows and e.g. XRenderComposite works
>>         fine, while
>>         other windows (xterm, xlock) leaves me we a square with only
>>         their
>>         background color. This seems to be true for both
>>         XRenderComposite and 
>>         glXBindTexImageEXT. Any ideas what's different between them,
>>         and what I
>>         need to do differently?
>>
>>         My code is here: https://github.com/redhog/InfiniteGlass
>>         (main code is in wm.c; running "make" ahould give you an
>>         Xephyr nested X
>>         session that shows the problem).
>>
>>         Thanks in advance,
>>
>>         Egil Möller
>>
>>
>>
>>         _______________________________________________
>>         xorg-devel at lists.x.org <mailto:xorg-devel at lists.x.org>: X.Org
>>         development
>>         Archives: http://lists.x.org/archives/xorg-devel
>>         Info: https://lists.x.org/mailman/listinfo/xorg-devel
>>
>>
>>
>>     -- 
>>       Jasper
>
>
>
>
> -- 
>   Jasper


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.x.org/archives/xorg-devel/attachments/20180619/4b74bd88/attachment-0001.html>


More information about the xorg-devel mailing list