1
0
Fork 0

Inherit visual from frame window so that metacity will work with the new

2003-11-15  Rob Adams  <readams@readams.net>

	Inherit visual from frame window so that metacity will work with
	the new compositing manager extension work by Keith on
	freedesktop.org, so that ARGB windows can be full
	alpha-transparent without a metacity frame getting drawn in the
	background.  In the long term, we need to actually set alpha
	values when drawing the frame so that it will really work; this is
	a stopgap solution.  Patch from Keith Packard; see Bug 126875.

	* src/frame.c (meta_window_ensure_frame): pass client visual to
	frame.

	* src/ui.[ch] (meta_ui_create_frame_window): add new xvisual
	parameter and use it to create new window.
This commit is contained in:
Rob Adams 2003-11-16 04:19:18 +00:00 committed by Rob Adams
parent a88f44ea64
commit 6ac67f80a6
4 changed files with 42 additions and 7 deletions

View file

@ -1,3 +1,19 @@
2003-11-15 Rob Adams <readams@readams.net>
Inherit visual from frame window so that metacity will work with
the new compositing manager extension work by Keith on
freedesktop.org, so that ARGB windows can be full
alpha-transparent without a metacity frame getting drawn in the
background. In the long term, we need to actually set alpha
values when drawing the frame so that it will really work; this is
a stopgap solution. Patch from Keith Packard; see Bug 126875.
* src/frame.c (meta_window_ensure_frame): pass client visual to
frame.
* src/ui.[ch] (meta_ui_create_frame_window): add new xvisual
parameter and use it to create new window.
2003-11-15 Rob Adams <readams@readams.net> 2003-11-15 Rob Adams <readams@readams.net>
* src/window.c (update_net_wm_type): don't set window->type_atom * src/window.c (update_net_wm_type): don't set window->type_atom

View file

@ -39,6 +39,7 @@ meta_window_ensure_frame (MetaWindow *window)
{ {
MetaFrame *frame; MetaFrame *frame;
XSetWindowAttributes attrs; XSetWindowAttributes attrs;
Visual *visual;
if (window->frame) if (window->frame)
return; return;
@ -78,8 +79,14 @@ meta_window_ensure_frame (MetaWindow *window)
* visual as the client. * visual as the client.
*/ */
visual = 0;
/* XXX special case for depth 32 windows (assumed to be ARGB) */
if (window->depth == 32)
visual = window->xvisual;
frame->xwindow = meta_ui_create_frame_window (window->screen->ui, frame->xwindow = meta_ui_create_frame_window (window->screen->ui,
window->display->xdisplay, window->display->xdisplay,
visual,
frame->rect.x, frame->rect.x,
frame->rect.y, frame->rect.y,
frame->rect.width, frame->rect.width,

View file

@ -155,6 +155,7 @@ meta_ui_get_frame_geometry (MetaUI *ui,
Window Window
meta_ui_create_frame_window (MetaUI *ui, meta_ui_create_frame_window (MetaUI *ui,
Display *xdisplay, Display *xdisplay,
Visual *xvisual,
gint x, gint x,
gint y, gint y,
gint width, gint width,
@ -166,12 +167,22 @@ meta_ui_create_frame_window (MetaUI *ui,
GdkWindowAttr attrs; GdkWindowAttr attrs;
gint attributes_mask; gint attributes_mask;
GdkWindow *window; GdkWindow *window;
GdkVisual *visual;
GdkColormap *cmap = gdk_screen_get_default_colormap (screen);
/* Default depth/visual handles clients with weird visuals; they can /* Default depth/visual handles clients with weird visuals; they can
* always be children of the root depth/visual obviously, but * always be children of the root depth/visual obviously, but
* e.g. DRI games can't be children of a parent that has the same * e.g. DRI games can't be children of a parent that has the same
* visual as the client. * visual as the client.
*/ */
if (!xvisual)
visual = gdk_screen_get_system_visual (screen);
else
{
visual = gdk_x11_screen_lookup_visual (screen,
XVisualIDFromVisual (xvisual));
cmap = gdk_colormap_new (visual, FALSE);
}
attrs.title = NULL; attrs.title = NULL;
@ -185,8 +196,8 @@ meta_ui_create_frame_window (MetaUI *ui,
attrs.x = x; attrs.x = x;
attrs.y = y; attrs.y = y;
attrs.wclass = GDK_INPUT_OUTPUT; attrs.wclass = GDK_INPUT_OUTPUT;
attrs.visual = gdk_screen_get_system_visual (screen); attrs.visual = visual;
attrs.colormap = gdk_screen_get_default_colormap (screen); attrs.colormap = cmap;
attrs.window_type = GDK_WINDOW_CHILD; attrs.window_type = GDK_WINDOW_CHILD;
attrs.cursor = NULL; attrs.cursor = NULL;
attrs.wmclass_name = NULL; attrs.wmclass_name = NULL;

View file

@ -59,6 +59,7 @@ void meta_ui_get_frame_geometry (MetaUI *ui,
int *left_width, int *right_width); int *left_width, int *right_width);
Window meta_ui_create_frame_window (MetaUI *ui, Window meta_ui_create_frame_window (MetaUI *ui,
Display *xdisplay, Display *xdisplay,
Visual *xvisual,
gint x, gint x,
gint y, gint y,
gint width, gint width,