3 #include "extensions.h"
6 void composite_startup(gboolean reconfig
) {}
7 void composite_shutdown(gboolean reconfig
) {}
8 gboolean
composite_window_has_alpha(Visual
*vis
) { return FALSE
; }
9 XID
composite_get_window_picture(Window win
, Visual
*vis
) { return None
; }
10 Pixmap
composite_get_window_pixmap(Window win
) { return None
; }
11 void composite_setup_root_window() {}
12 void composite_enable_for_window(Window win
) {}
15 static Picture root_picture
= None
;
17 void composite_startup(gboolean reconfig
)
20 if (!extensions_comp
) return;
23 void composite_shutdown(gboolean reconfig
)
26 if (!extensions_comp
) return;
29 void composite_setup_root_window()
32 XRenderFreePicture(ob_display
, root_picture
);
35 composite_get_window_picture(RootWindow(ob_display
, ob_screen
),
36 RrVisual(ob_rr_inst
));
39 gboolean
composite_window_has_alpha(Visual
*vis
)
41 XRenderPictFormat
*format
;
43 if (!extensions_comp
) return FALSE
;
45 format
= XRenderFindVisualFormat(ob_display
, vis
);
46 return format
->type
== PictTypeDirect
&& format
->direct
.alphaMask
;
49 XID
composite_get_window_picture(Window win
, Visual
*vis
)
51 XRenderPictureAttributes pa
;
52 XRenderPictFormat
*format
;
54 if (!extensions_comp
) return None
;
56 format
= XRenderFindVisualFormat(ob_display
, vis
);
58 pa
.subwindow_mode
= IncludeInferiors
;
59 return XRenderCreatePicture(ob_display
, win
, format
, CPSubwindowMode
, &pa
);
62 Pixmap
composite_get_window_pixmap(Window win
)
64 if (!extensions_comp
) return None
;
66 return XCompositeNameWindowPixmap(ob_display
, win
);
69 void composite_enable_for_window(Window win
)
71 /* Redirect window contents to offscreen pixmaps */
72 XCompositeRedirectWindow(ob_display
, win
, CompositeRedirectAutomatic
);