Problems while writing a Composite Manager with Damage, Render, XFixes and Composite

Arnaud Fontaine arnaud at andesi.org
Mon Jul 13 12:22:21 PDT 2009


Hello,

I'm currently  writing a Composite  Manager with XCB as  an university
project[0]. I'm using  a library for EWMH[1] I  have written and which
has not been committed yet to xcb-util because it is not finished yet.

I read xcompmgr code along  with the extensions specifications to figure
out how all these extensions interacts together.  At the moment, I'm not
writing the code from a performance point of view, so I'm just trying to
stick to the minimum features and especially to make it work.

However, I  have the  following problems and  I really can't  figure out
what's wrong (the main code is in render.c for Render related functions,
window.c and event.c):

1/  When receiving  a DestroyNotify  event, I  use DamageDestroy  on the
   previously created damage object but  I get a BadDamage error whereas
   it  is the same  damage object  identifier from  its creation  to the
   DamageDestroy request.

2/ I  don't have  any problem when  starting the Composite  Manager when
   windows already  exist (e.g.  existing  are correctly painted  on the
   screen), but it does not work  when trying to paint new window on the
   screen (I don't  get any error though).  Basically,  my code does the
   following:

   1) Initialization (working fine):

     a)  RenderCreatePicture with  the root  window identifier  and with
        SubwindowMode equals to  IncludeInferiors and assigned to global
        variable globalconf.root_picture.

     b) Get the  root background pixmap, if there is  none, create a new
        pixmap  of  1x1  pixels,  then RenderCreatePicture  with  Repeat
        equals  to true,  then  fill it  with RenderFillRectangles,  and
        assigned to a global variable
        globalconf.root_background_picture.

     c) RenderComposite from b) to a).
   
   2) When a CreateNotify event is received:

      a) DamageCreate on the new window identifier.

   3) When a MapNotify event is received:

      a) Set the map state to Viewable.
      b) Get the window pixmap with CompositeNameWindowPixmap.
   
   4) When a DamageNotify is received:

      a) Set the window as damaged.
   
   5) Paint all the windows:

      a) RenderComposite from 1b) to 1a) in order to repaint the screen.
      b) RenderCreatePicture on the pixmap 3b).
      c) RenderComposite from b) to 1a).
                                       
Is there  anything wrong  in these  requests? I think  I may  have not
understood an  important concept but I  can't figure out  which one. I
have not used  XFixes for now because I don't really  know when to use
it because  as far  as I have  understood, XFixes would  avoid useless
copy of pixels.  I'm also a bit confused  about DamageSubtract too and
don't know exactly when it would be useful (for handling opacity?).

Thank you very much in advance for your answers.

Regards,
Arnaud Fontaine

[0] http://git.mini-dweeb.org/?p=arnau/pcompmgr.git;a=summary
[1] http://git.mini-dweeb.org/?p=arnau/xcb-util.git;a=summary



More information about the xorg mailing list