mirror of
https://github.com/brl/mutter.git
synced 2024-11-25 17:40:40 -05:00
src/core/display.c (meta_display_open), fetch & use composite version, for
2008-01-28 Michael Meeks <michael.meeks@novell.com> * src/core/display.c (meta_display_open), * src/core/compositor.c: fetch & use composite version, for remote screens that don't match the compile system's version. (meta_compositor_manage_screen): bin erroneous FIXME. (add_win): remove common warning churn for (very) transient windows svn path=/trunk/; revision=3550
This commit is contained in:
parent
a9a69ac807
commit
2f43d436c8
10
ChangeLog
10
ChangeLog
@ -1,3 +1,13 @@
|
|||||||
|
2008-01-28 Michael Meeks <michael.meeks@novell.com>
|
||||||
|
|
||||||
|
* src/core/display.c (meta_display_open),
|
||||||
|
* src/core/compositor.c: fetch & use composite
|
||||||
|
version, for remote screens that don't match the
|
||||||
|
compile system's version.
|
||||||
|
(meta_compositor_manage_screen): bin erroneous FIXME.
|
||||||
|
(add_win): remove common warning churn for (very)
|
||||||
|
transient windows
|
||||||
|
|
||||||
2008-02-03 Thomas Thurman <tthurman@gnome.org>
|
2008-02-03 Thomas Thurman <tthurman@gnome.org>
|
||||||
|
|
||||||
* tools/patch-wrangler.py: another program I use for maintenance
|
* tools/patch-wrangler.py: another program I use for maintenance
|
||||||
|
@ -55,6 +55,20 @@
|
|||||||
|
|
||||||
#define USE_IDLE_REPAINT 1
|
#define USE_IDLE_REPAINT 1
|
||||||
|
|
||||||
|
static inline gboolean
|
||||||
|
composite_at_least_version (MetaDisplay *display,
|
||||||
|
int maj, int minor)
|
||||||
|
{
|
||||||
|
return (display->composite_major_version > maj
|
||||||
|
|| (display->composite_major_version == maj
|
||||||
|
&& display->composite_minor_version >= minor));
|
||||||
|
}
|
||||||
|
|
||||||
|
#define have_name_window_pixmap(display) \
|
||||||
|
composite_at_least_version (display, 0, 2)
|
||||||
|
#define have_cow(display) \
|
||||||
|
composite_at_least_version (display, 0, 3)
|
||||||
|
|
||||||
typedef enum _MetaCompWindowType
|
typedef enum _MetaCompWindowType
|
||||||
{
|
{
|
||||||
META_COMP_WINDOW_NORMAL,
|
META_COMP_WINDOW_NORMAL,
|
||||||
@ -893,11 +907,14 @@ get_window_picture (MetaCompWindow *cw)
|
|||||||
meta_error_trap_push (display);
|
meta_error_trap_push (display);
|
||||||
|
|
||||||
#ifdef HAVE_NAME_WINDOW_PIXMAP
|
#ifdef HAVE_NAME_WINDOW_PIXMAP
|
||||||
|
if (have_name_window_pixmap (display))
|
||||||
|
{
|
||||||
if (cw->back_pixmap == None)
|
if (cw->back_pixmap == None)
|
||||||
cw->back_pixmap = XCompositeNameWindowPixmap (display->xdisplay, cw->id);
|
cw->back_pixmap = XCompositeNameWindowPixmap (display->xdisplay, cw->id);
|
||||||
|
|
||||||
if (cw->back_pixmap != None)
|
if (cw->back_pixmap != None)
|
||||||
draw = cw->back_pixmap;
|
draw = cw->back_pixmap;
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
format = get_window_format (cw);
|
format = get_window_format (cw);
|
||||||
@ -1049,16 +1066,21 @@ paint_windows (MetaScreen *screen,
|
|||||||
int x, y, wid, hei;
|
int x, y, wid, hei;
|
||||||
|
|
||||||
#ifdef HAVE_NAME_WINDOW_PIXMAP
|
#ifdef HAVE_NAME_WINDOW_PIXMAP
|
||||||
|
if (have_name_window_pixmap (display))
|
||||||
|
{
|
||||||
x = cw->attrs.x;
|
x = cw->attrs.x;
|
||||||
y = cw->attrs.y;
|
y = cw->attrs.y;
|
||||||
wid = cw->attrs.width + cw->attrs.border_width * 2;
|
wid = cw->attrs.width + cw->attrs.border_width * 2;
|
||||||
hei = cw->attrs.height + cw->attrs.border_width * 2;
|
hei = cw->attrs.height + cw->attrs.border_width * 2;
|
||||||
#else
|
}
|
||||||
|
else
|
||||||
|
#endif
|
||||||
|
{
|
||||||
x = cw->attrs.x + cw->attrs.border_width;
|
x = cw->attrs.x + cw->attrs.border_width;
|
||||||
y = cw->attrs.y + cw->attrs.border_width;
|
y = cw->attrs.y + cw->attrs.border_width;
|
||||||
wid = cw->attrs.width;
|
wid = cw->attrs.width;
|
||||||
hei = cw->attrs.height;
|
hei = cw->attrs.height;
|
||||||
#endif
|
}
|
||||||
|
|
||||||
XFixesSetPictureClipRegion (xdisplay, root_buffer,
|
XFixesSetPictureClipRegion (xdisplay, root_buffer,
|
||||||
0, 0, paint_region);
|
0, 0, paint_region);
|
||||||
@ -1135,16 +1157,21 @@ paint_windows (MetaScreen *screen,
|
|||||||
{
|
{
|
||||||
int x, y, wid, hei;
|
int x, y, wid, hei;
|
||||||
#ifdef HAVE_NAME_WINDOW_PIXMAP
|
#ifdef HAVE_NAME_WINDOW_PIXMAP
|
||||||
|
if (have_name_window_pixmap (display))
|
||||||
|
{
|
||||||
x = cw->attrs.x;
|
x = cw->attrs.x;
|
||||||
y = cw->attrs.y;
|
y = cw->attrs.y;
|
||||||
wid = cw->attrs.width + cw->attrs.border_width * 2;
|
wid = cw->attrs.width + cw->attrs.border_width * 2;
|
||||||
hei = cw->attrs.height + cw->attrs.border_width * 2;
|
hei = cw->attrs.height + cw->attrs.border_width * 2;
|
||||||
#else
|
}
|
||||||
|
else
|
||||||
|
#endif
|
||||||
|
{
|
||||||
x = cw->attrs.x + cw->attrs.border_width;
|
x = cw->attrs.x + cw->attrs.border_width;
|
||||||
y = cw->attrs.y + cw->attrs.border_width;
|
y = cw->attrs.y + cw->attrs.border_width;
|
||||||
wid = cw->attrs.width;
|
wid = cw->attrs.width;
|
||||||
hei = cw->attrs.height;
|
hei = cw->attrs.height;
|
||||||
#endif
|
}
|
||||||
|
|
||||||
XRenderComposite (xdisplay, PictOpOver, cw->picture,
|
XRenderComposite (xdisplay, PictOpOver, cw->picture,
|
||||||
cw->alpha_pict, root_buffer, 0, 0, 0, 0,
|
cw->alpha_pict, root_buffer, 0, 0, 0, 0,
|
||||||
@ -1350,6 +1377,8 @@ free_win (MetaCompWindow *cw,
|
|||||||
MetaCompScreen *info = cw->screen->compositor_data;
|
MetaCompScreen *info = cw->screen->compositor_data;
|
||||||
|
|
||||||
#ifdef HAVE_NAME_WINDOW_PIXMAP
|
#ifdef HAVE_NAME_WINDOW_PIXMAP
|
||||||
|
if (have_name_window_pixmap (display))
|
||||||
|
{
|
||||||
/* See comment in map_win */
|
/* See comment in map_win */
|
||||||
if (cw->back_pixmap && destroy)
|
if (cw->back_pixmap && destroy)
|
||||||
{
|
{
|
||||||
@ -1362,6 +1391,7 @@ free_win (MetaCompWindow *cw,
|
|||||||
XFreePixmap (display->xdisplay, cw->shaded_back_pixmap);
|
XFreePixmap (display->xdisplay, cw->shaded_back_pixmap);
|
||||||
cw->shaded_back_pixmap = None;
|
cw->shaded_back_pixmap = None;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (cw->picture)
|
if (cw->picture)
|
||||||
@ -1615,7 +1645,6 @@ add_win (MetaScreen *screen,
|
|||||||
|
|
||||||
if (!XGetWindowAttributes (display->xdisplay, xwindow, &cw->attrs))
|
if (!XGetWindowAttributes (display->xdisplay, xwindow, &cw->attrs))
|
||||||
{
|
{
|
||||||
g_warning ("Could not get attrs");
|
|
||||||
g_free (cw);
|
g_free (cw);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -1807,6 +1836,8 @@ resize_win (MetaCompWindow *cw,
|
|||||||
if (cw->attrs.width != width || cw->attrs.height != height)
|
if (cw->attrs.width != width || cw->attrs.height != height)
|
||||||
{
|
{
|
||||||
#ifdef HAVE_NAME_WINDOW_PIXMAP
|
#ifdef HAVE_NAME_WINDOW_PIXMAP
|
||||||
|
if (have_name_window_pixmap (display))
|
||||||
|
{
|
||||||
if (cw->shaded_back_pixmap)
|
if (cw->shaded_back_pixmap)
|
||||||
{
|
{
|
||||||
XFreePixmap (xdisplay, cw->shaded_back_pixmap);
|
XFreePixmap (xdisplay, cw->shaded_back_pixmap);
|
||||||
@ -1828,6 +1859,7 @@ resize_win (MetaCompWindow *cw,
|
|||||||
cw->back_pixmap = None;
|
cw->back_pixmap = None;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
if (cw->picture)
|
if (cw->picture)
|
||||||
{
|
{
|
||||||
@ -2271,12 +2303,16 @@ meta_compositor_remove_window (MetaCompositor *compositor,
|
|||||||
#ifdef HAVE_COMPOSITE_EXTENSIONS
|
#ifdef HAVE_COMPOSITE_EXTENSIONS
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
#ifdef HAVE_COW
|
|
||||||
static void
|
static void
|
||||||
show_overlay_window (MetaScreen *screen,
|
show_overlay_window (MetaScreen *screen,
|
||||||
Window cow)
|
Window cow)
|
||||||
{
|
{
|
||||||
MetaDisplay *display = screen->display;
|
MetaDisplay *display = screen->display;
|
||||||
|
|
||||||
|
#ifdef HAVE_COW
|
||||||
|
if (have_cow (display))
|
||||||
|
{
|
||||||
XserverRegion region;
|
XserverRegion region;
|
||||||
|
|
||||||
region = XFixesCreateRegion (display->xdisplay, NULL, 0);
|
region = XFixesCreateRegion (display->xdisplay, NULL, 0);
|
||||||
@ -2288,7 +2324,10 @@ show_overlay_window (MetaScreen *screen,
|
|||||||
|
|
||||||
damage_screen (screen);
|
damage_screen (screen);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
#if 0
|
||||||
static void
|
static void
|
||||||
hide_overlay_window (MetaScreen *screen,
|
hide_overlay_window (MetaScreen *screen,
|
||||||
Window cow)
|
Window cow)
|
||||||
@ -2302,19 +2341,28 @@ hide_overlay_window (MetaScreen *screen,
|
|||||||
0, 0, region);
|
0, 0, region);
|
||||||
XFixesDestroyRegion (display->xdisplay, region);
|
XFixesDestroyRegion (display->xdisplay, region);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
static Window
|
static Window
|
||||||
get_overlay_window (MetaScreen *screen)
|
get_output_window (MetaScreen *screen)
|
||||||
{
|
{
|
||||||
MetaDisplay *display = screen->display;
|
MetaDisplay *display = screen->display;
|
||||||
Window cow;
|
Window output;
|
||||||
|
|
||||||
cow = XCompositeGetOverlayWindow (display->xdisplay, screen->xroot);
|
#ifdef HAVE_COW
|
||||||
XSelectInput (display->xdisplay, cow, ExposureMask);
|
if (have_cow (display))
|
||||||
|
{
|
||||||
return cow;
|
output = XCompositeGetOverlayWindow (display->xdisplay, screen->xroot);
|
||||||
|
XSelectInput (display->xdisplay, output, ExposureMask);
|
||||||
}
|
}
|
||||||
|
else
|
||||||
#endif
|
#endif
|
||||||
|
{
|
||||||
|
output = screen->xroot;
|
||||||
|
}
|
||||||
|
|
||||||
|
return output;
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
meta_compositor_manage_screen (MetaCompositor *compositor,
|
meta_compositor_manage_screen (MetaCompositor *compositor,
|
||||||
@ -2331,7 +2379,6 @@ meta_compositor_manage_screen (MetaCompositor *compositor,
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
gdk_error_trap_push ();
|
gdk_error_trap_push ();
|
||||||
/* FIXME: Use correct composite mode */
|
|
||||||
XCompositeRedirectSubwindows (display->xdisplay, screen->xroot,
|
XCompositeRedirectSubwindows (display->xdisplay, screen->xroot,
|
||||||
CompositeRedirectManual);
|
CompositeRedirectManual);
|
||||||
XSync (display->xdisplay, FALSE);
|
XSync (display->xdisplay, FALSE);
|
||||||
@ -2357,11 +2404,7 @@ meta_compositor_manage_screen (MetaCompositor *compositor,
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef HAVE_COW
|
info->output = get_output_window (screen);
|
||||||
info->output = get_overlay_window (screen);
|
|
||||||
#else
|
|
||||||
info->output = screen->xroot;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
pa.subwindow_mode = IncludeInferiors;
|
pa.subwindow_mode = IncludeInferiors;
|
||||||
info->root_picture = XRenderCreatePicture (display->xdisplay, info->output,
|
info->root_picture = XRenderCreatePicture (display->xdisplay, info->output,
|
||||||
@ -2394,12 +2437,9 @@ meta_compositor_manage_screen (MetaCompositor *compositor,
|
|||||||
|
|
||||||
meta_screen_set_cm_selection (screen);
|
meta_screen_set_cm_selection (screen);
|
||||||
|
|
||||||
#ifdef HAVE_COW
|
|
||||||
/* Now we're up and running we can show the output if needed */
|
/* Now we're up and running we can show the output if needed */
|
||||||
show_overlay_window (screen, info->output);
|
show_overlay_window (screen, info->output);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
@ -2596,12 +2636,15 @@ meta_compositor_get_window_pixmap (MetaCompositor *compositor,
|
|||||||
return None;
|
return None;
|
||||||
|
|
||||||
#ifdef HAVE_NAME_WINDOW_PIXMAP
|
#ifdef HAVE_NAME_WINDOW_PIXMAP
|
||||||
|
if (have_name_window_pixmap (window->display))
|
||||||
|
{
|
||||||
if (window->shaded)
|
if (window->shaded)
|
||||||
return cw->shaded_back_pixmap;
|
return cw->shaded_back_pixmap;
|
||||||
else
|
else
|
||||||
return cw->back_pixmap;
|
return cw->back_pixmap;
|
||||||
#else
|
}
|
||||||
|
else
|
||||||
|
#endif
|
||||||
return None;
|
return None;
|
||||||
#endif
|
#endif
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
@ -752,11 +752,28 @@ meta_display_open (void)
|
|||||||
display->composite_event_base = 0;
|
display->composite_event_base = 0;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
{
|
||||||
|
display->composite_major_version = 0;
|
||||||
|
display->composite_minor_version = 0;
|
||||||
|
if (XCompositeQueryVersion (display->xdisplay,
|
||||||
|
&display->composite_major_version,
|
||||||
|
&display->composite_minor_version))
|
||||||
|
{
|
||||||
display->have_composite = TRUE;
|
display->have_composite = TRUE;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
display->composite_major_version = 0;
|
||||||
|
display->composite_minor_version = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
meta_verbose ("Attempted to init Composite, found error base %d event base %d\n",
|
meta_verbose ("Attempted to init Composite, found error base %d event base %d "
|
||||||
|
"extn ver %d %d\n",
|
||||||
display->composite_error_base,
|
display->composite_error_base,
|
||||||
display->composite_event_base);
|
display->composite_event_base,
|
||||||
|
display->composite_major_version,
|
||||||
|
display->composite_minor_version);
|
||||||
|
|
||||||
display->have_damage = FALSE;
|
display->have_damage = FALSE;
|
||||||
|
|
||||||
|
@ -357,6 +357,8 @@ struct _MetaDisplay
|
|||||||
#ifdef HAVE_COMPOSITE_EXTENSIONS
|
#ifdef HAVE_COMPOSITE_EXTENSIONS
|
||||||
int composite_event_base;
|
int composite_event_base;
|
||||||
int composite_error_base;
|
int composite_error_base;
|
||||||
|
int composite_major_version;
|
||||||
|
int composite_minor_version;
|
||||||
int damage_event_base;
|
int damage_event_base;
|
||||||
int damage_error_base;
|
int damage_error_base;
|
||||||
int xfixes_event_base;
|
int xfixes_event_base;
|
||||||
|
Loading…
Reference in New Issue
Block a user