Code cleanup and pretification.

This commit is contained in:
Tomas Frydrych 2008-08-20 09:33:39 +01:00
parent 8589eab403
commit b48f9ca907

View File

@ -43,20 +43,17 @@
#define DESTROY_TIMEOUT 300 #define DESTROY_TIMEOUT 300
#define MINIMIZE_TIMEOUT 600 #define MINIMIZE_TIMEOUT 600
ClutterActor* static ClutterActor* tidy_texture_frame_new (ClutterTexture *texture,
tidy_texture_frame_new (ClutterTexture *texture,
gint left, gint left,
gint top, gint top,
gint right, gint right,
gint bottom); gint bottom);
static unsigned char * static unsigned char* shadow_gaussian_make_tile (void);
shadow_gaussian_make_tile (void);
#ifdef HAVE_COMPOSITE_EXTENSIONS #ifdef HAVE_COMPOSITE_EXTENSIONS
static inline gboolean static inline gboolean
composite_at_least_version (MetaDisplay *display, composite_at_least_version (MetaDisplay *display, int maj, int min)
int maj, int min)
{ {
static int major = -1; static int major = -1;
static int minor = -1; static int minor = -1;
@ -90,15 +87,14 @@ typedef enum _MetaCompWindowType
typedef struct _MetaCompositorClutter typedef struct _MetaCompositorClutter
{ {
MetaCompositor compositor; MetaCompositor compositor;
MetaDisplay *display; MetaDisplay *display;
Atom atom_x_root_pixmap; Atom atom_x_root_pixmap;
Atom atom_x_set_root; Atom atom_x_set_root;
Atom atom_net_wm_window_opacity; Atom atom_net_wm_window_opacity;
guint show_redraw : 1; gboolean show_redraw : 1;
guint debug : 1; gboolean debug : 1;
} MetaCompositorClutter; } MetaCompositorClutter;
typedef struct _MetaCompScreen typedef struct _MetaCompScreen
@ -116,7 +112,6 @@ typedef struct _MetaCompScreen
ClutterEffectTemplate *minimize_effect; ClutterEffectTemplate *minimize_effect;
ClutterActor *shadow_src; ClutterActor *shadow_src;
} MetaCompScreen; } MetaCompScreen;
/* /*
@ -171,9 +166,9 @@ struct _MetaCompWindowPrivate
enum enum
{ {
PROP_META_WINDOW = 1, PROP_MCW_META_WINDOW = 1,
PROP_META_SCREEN, PROP_MCW_META_SCREEN,
PROP_X_WINDOW, PROP_MCW_X_WINDOW,
}; };
static void meta_comp_window_class_init (MetaCompWindowClass *klass); static void meta_comp_window_class_init (MetaCompWindowClass *klass);
@ -216,7 +211,7 @@ meta_comp_window_class_init (MetaCompWindowClass *klass)
G_PARAM_READWRITE | G_PARAM_CONSTRUCT); G_PARAM_READWRITE | G_PARAM_CONSTRUCT);
g_object_class_install_property (object_class, g_object_class_install_property (object_class,
PROP_META_WINDOW, PROP_MCW_META_WINDOW,
pspec); pspec);
pspec = g_param_spec_pointer ("meta-screen", pspec = g_param_spec_pointer ("meta-screen",
@ -225,7 +220,7 @@ meta_comp_window_class_init (MetaCompWindowClass *klass)
G_PARAM_READWRITE | G_PARAM_CONSTRUCT); G_PARAM_READWRITE | G_PARAM_CONSTRUCT);
g_object_class_install_property (object_class, g_object_class_install_property (object_class,
PROP_META_SCREEN, PROP_MCW_META_SCREEN,
pspec); pspec);
pspec = g_param_spec_ulong ("x-window", pspec = g_param_spec_ulong ("x-window",
@ -237,7 +232,7 @@ meta_comp_window_class_init (MetaCompWindowClass *klass)
G_PARAM_READWRITE | G_PARAM_CONSTRUCT); G_PARAM_READWRITE | G_PARAM_CONSTRUCT);
g_object_class_install_property (object_class, g_object_class_install_property (object_class,
PROP_X_WINDOW, PROP_MCW_X_WINDOW,
pspec); pspec);
} }
@ -277,10 +272,11 @@ meta_comp_window_constructed (GObject *object)
meta_comp_window_get_window_type (self); meta_comp_window_get_window_type (self);
/* If Metacity has decided not to manage this window then the input events /*
won't have been set on the window */ * If Metacity has decided not to manage this window then the input events
* won't have been set on the window
*/
event_mask = priv->attrs.your_event_mask | PropertyChangeMask; event_mask = priv->attrs.your_event_mask | PropertyChangeMask;
XSelectInput (xdisplay, xwindow, event_mask); XSelectInput (xdisplay, xwindow, event_mask);
priv->shaped = is_shaped (display, xwindow); priv->shaped = is_shaped (display, xwindow);
@ -292,11 +288,8 @@ meta_comp_window_constructed (GObject *object)
format = XRenderFindVisualFormat (xdisplay, priv->attrs.visual); format = XRenderFindVisualFormat (xdisplay, priv->attrs.visual);
if (format && format->type == PictTypeDirect && if (format && format->type == PictTypeDirect && format->direct.alphaMask)
format->direct.alphaMask)
{
priv->argb32 = TRUE; priv->argb32 = TRUE;
}
if (meta_comp_window_has_shadow (self)) if (meta_comp_window_has_shadow (self))
{ {
@ -362,9 +355,6 @@ meta_comp_window_dispose (GObject *object)
static void static void
meta_comp_window_finalize (GObject *object) meta_comp_window_finalize (GObject *object)
{ {
#if 0
MetaCompWindowPrivate *priv = META_COMP_WINDOW (object)->priv;
#endif
G_OBJECT_CLASS (meta_comp_window_parent_class)->finalize (object); G_OBJECT_CLASS (meta_comp_window_parent_class)->finalize (object);
} }
@ -378,13 +368,13 @@ meta_comp_window_set_property (GObject *object,
switch (prop_id) switch (prop_id)
{ {
case PROP_META_WINDOW: case PROP_MCW_META_WINDOW:
priv->window = g_value_get_pointer (value); priv->window = g_value_get_pointer (value);
break; break;
case PROP_META_SCREEN: case PROP_MCW_META_SCREEN:
priv->screen = g_value_get_pointer (value); priv->screen = g_value_get_pointer (value);
break; break;
case PROP_X_WINDOW: case PROP_MCW_X_WINDOW:
priv->xwindow = g_value_get_ulong (value); priv->xwindow = g_value_get_ulong (value);
break; break;
default: default:
@ -403,13 +393,13 @@ meta_comp_window_get_property (GObject *object,
switch (prop_id) switch (prop_id)
{ {
case PROP_META_WINDOW: case PROP_MCW_META_WINDOW:
g_value_set_pointer (value, priv->window); g_value_set_pointer (value, priv->window);
break; break;
case PROP_META_SCREEN: case PROP_MCW_META_SCREEN:
g_value_set_pointer (value, priv->screen); g_value_set_pointer (value, priv->screen);
break; break;
case PROP_X_WINDOW: case PROP_MCW_X_WINDOW:
g_value_set_ulong (value, priv->xwindow); g_value_set_ulong (value, priv->xwindow);
break; break;
default: default:
@ -419,8 +409,7 @@ meta_comp_window_get_property (GObject *object,
} }
static MetaCompWindow* static MetaCompWindow*
find_window_for_screen (MetaScreen *screen, find_window_for_screen (MetaScreen *screen, Window xwindow)
Window xwindow)
{ {
MetaCompScreen *info = meta_screen_get_compositor_data (screen); MetaCompScreen *info = meta_screen_get_compositor_data (screen);
@ -431,8 +420,7 @@ find_window_for_screen (MetaScreen *screen,
} }
static MetaCompWindow * static MetaCompWindow *
find_window_in_display (MetaDisplay *display, find_window_in_display (MetaDisplay *display, Window xwindow)
Window xwindow)
{ {
GSList *index; GSList *index;
@ -450,11 +438,9 @@ find_window_in_display (MetaDisplay *display,
} }
static MetaCompWindow * static MetaCompWindow *
find_window_for_child_window_in_display (MetaDisplay *display, find_window_for_child_window_in_display (MetaDisplay *display, Window xwindow)
Window xwindow)
{ {
Window ignored1, *ignored2; Window ignored1, *ignored2, parent;
Window parent;
guint ignored_children; guint ignored_children;
XQueryTree (meta_display_get_xdisplay (display), xwindow, &ignored1, XQueryTree (meta_display_get_xdisplay (display), xwindow, &ignored1,
@ -473,16 +459,16 @@ meta_comp_window_get_window_type (MetaCompWindow *self)
MetaScreen *screen = priv->screen; MetaScreen *screen = priv->screen;
MetaDisplay *display = meta_screen_get_display (screen); MetaDisplay *display = meta_screen_get_display (screen);
Window xwindow = priv->xwindow; Window xwindow = priv->xwindow;
gint n_atoms;
int n_atoms;
Atom *atoms; Atom *atoms;
int i; gint i;
/* /*
* If the window is managed by the WM, get the type from the WM, * If the window is managed by the WM, get the type from the WM,
* otherwise do it the hard way. * otherwise do it the hard way.
*/ */
if (priv->window && meta_window_get_type_atom (priv->window) != None) { if (priv->window && meta_window_get_type_atom (priv->window) != None)
{
priv->type = (MetaCompWindowType) meta_window_get_type (priv->window); priv->type = (MetaCompWindowType) meta_window_get_type (priv->window);
return; return;
} }
@ -523,7 +509,7 @@ meta_comp_window_get_window_type (MetaCompWindow *self)
priv->type = META_COMP_WINDOW_DOCK; priv->type = META_COMP_WINDOW_DOCK;
break; break;
} }
else if ( atoms[i] == else if (atoms[i] ==
meta_display_get_atom (display, meta_display_get_atom (display,
META_ATOM__NET_WM_WINDOW_TYPE_TOOLBAR) || META_ATOM__NET_WM_WINDOW_TYPE_TOOLBAR) ||
atoms[i] == atoms[i] ==
@ -554,9 +540,9 @@ static gboolean
is_shaped (MetaDisplay *display, Window xwindow) is_shaped (MetaDisplay *display, Window xwindow)
{ {
Display *xdisplay = meta_display_get_xdisplay (display); Display *xdisplay = meta_display_get_xdisplay (display);
int xws, yws, xbs, ybs; gint xws, yws, xbs, ybs;
unsigned wws, hws, wbs, hbs; guint wws, hws, wbs, hbs;
int bounding_shaped, clip_shaped; gint bounding_shaped, clip_shaped;
if (meta_display_has_shape (display)) if (meta_display_has_shape (display))
{ {
@ -577,37 +563,50 @@ meta_comp_window_has_shadow (MetaCompWindow *self)
/* /*
* Do not add shadows to ARGB windows (since they are probably transparent * Do not add shadows to ARGB windows (since they are probably transparent
*/ */
if (priv->argb32 || priv->opacity != 0xff) { if (priv->argb32 || priv->opacity != 0xff)
{
meta_verbose ("Window has no shadow as it is ARGB\n"); meta_verbose ("Window has no shadow as it is ARGB\n");
return FALSE; return FALSE;
} }
/*
* Add shadows to override redirect windows (e.g., Gtk menus).
*/
if (priv->attrs.override_redirect) if (priv->attrs.override_redirect)
{ {
meta_verbose ("Window has shadow because it is override redirect.\n"); meta_verbose ("Window has shadow because it is override redirect.\n");
return TRUE; return TRUE;
} }
/* Always put a shadow around windows with a frame - This should override /*
the restriction about not putting a shadow around shaped windows * Always put a shadow around windows with a frame - This should override
as the frame might be the reason the window is shaped */ * the restriction about not putting a shadow around shaped windows
* as the frame might be the reason the window is shaped
*/
if (priv->window) if (priv->window)
{ {
if (meta_window_get_frame (priv->window)) { if (meta_window_get_frame (priv->window))
{
meta_verbose ("Window has shadow because it has a frame\n"); meta_verbose ("Window has shadow because it has a frame\n");
return TRUE; return TRUE;
} }
} }
/* Never put a shadow around shaped windows */ /*
if (priv->shaped) { * Never put a shadow around shaped windows
*/
if (priv->shaped)
{
meta_verbose ("Window has no shadow as it is shaped\n"); meta_verbose ("Window has no shadow as it is shaped\n");
return FALSE; return FALSE;
} }
/* Don't put shadow around DND icon windows */ /*
* Don't put shadow around DND icon windows
*/
if (priv->type == META_COMP_WINDOW_DND || if (priv->type == META_COMP_WINDOW_DND ||
priv->type == META_COMP_WINDOW_DESKTOP) { priv->type == META_COMP_WINDOW_DESKTOP)
{
meta_verbose ("Window has no shadow as it is DND or Desktop\n"); meta_verbose ("Window has no shadow as it is DND or Desktop\n");
return FALSE; return FALSE;
} }
@ -616,13 +615,15 @@ meta_comp_window_has_shadow (MetaCompWindow *self)
#if 0 #if 0
|| priv->type == META_COMP_WINDOW_DROP_DOWN_MENU || priv->type == META_COMP_WINDOW_DROP_DOWN_MENU
#endif #endif
) { )
{
meta_verbose ("Window has shadow as it is a menu\n"); meta_verbose ("Window has shadow as it is a menu\n");
return TRUE; return TRUE;
} }
#if 0 #if 0
if (priv->type == META_COMP_WINDOW_TOOLTIP) { if (priv->type == META_COMP_WINDOW_TOOLTIP)
{
meta_verbose ("Window has shadow as it is a tooltip\n"); meta_verbose ("Window has shadow as it is a tooltip\n");
return TRUE; return TRUE;
} }
@ -672,25 +673,21 @@ destroy_win (MetaDisplay *display, Window xwindow)
} }
static void static void
restack_win (MetaCompWindow *cw, restack_win (MetaCompWindow *cw, Window above)
Window above)
{ {
MetaCompWindowPrivate *priv = cw->priv; MetaCompWindowPrivate *priv = cw->priv;
MetaScreen *screen; MetaScreen *screen = priv->screen;
MetaCompScreen *info; MetaCompScreen *info = meta_screen_get_compositor_data (screen);
Window previous_above; Window previous_above;
GList *sibling, *next; GList *sibling, *next;
screen = priv->screen;
info = meta_screen_get_compositor_data (screen);
sibling = g_list_find (info->windows, (gconstpointer) cw); sibling = g_list_find (info->windows, (gconstpointer) cw);
next = g_list_next (sibling); next = g_list_next (sibling);
previous_above = None; previous_above = None;
if (next) if (next)
{ {
MetaCompWindow *ncw = (MetaCompWindow *) next->data; MetaCompWindow *ncw = next->data;
previous_above = ncw->priv->xwindow; previous_above = ncw->priv->xwindow;
} }
@ -709,7 +706,8 @@ restack_win (MetaCompWindow *cw,
{ {
GList *index; GList *index;
for (index = info->windows; index; index = index->next) { for (index = info->windows; index; index = index->next)
{
MetaCompWindow *cw2 = (MetaCompWindow *) index->data; MetaCompWindow *cw2 = (MetaCompWindow *) index->data;
if (cw2->priv->xwindow == above) if (cw2->priv->xwindow == above)
break; break;
@ -717,12 +715,12 @@ restack_win (MetaCompWindow *cw,
if (index != NULL) if (index != NULL)
{ {
MetaCompWindow *above_win = (MetaCompWindow *) index->data; ClutterActor *above_win = index->data;
info->windows = g_list_delete_link (info->windows, sibling); info->windows = g_list_delete_link (info->windows, sibling);
info->windows = g_list_insert_before (info->windows, index, cw); info->windows = g_list_insert_before (info->windows, index, cw);
clutter_actor_raise (CLUTTER_ACTOR (cw), CLUTTER_ACTOR (above_win)); clutter_actor_raise (CLUTTER_ACTOR (cw), above_win);
} }
} }
} }
@ -737,9 +735,6 @@ resize_win (MetaCompWindow *cw,
gboolean override_redirect) gboolean override_redirect)
{ {
MetaCompWindowPrivate *priv = cw->priv; MetaCompWindowPrivate *priv = cw->priv;
MetaScreen *screen = priv->screen;
MetaDisplay *display = meta_screen_get_display (screen);
Display *xdisplay = meta_display_get_xdisplay (display);
priv->attrs.x = x; priv->attrs.x = x;
priv->attrs.y = y; priv->attrs.y = y;
@ -749,13 +744,7 @@ resize_win (MetaCompWindow *cw,
/* Note, let named named pixmap resync actually resize actor */ /* Note, let named named pixmap resync actually resize actor */
if (priv->attrs.width != width || priv->attrs.height != height) if (priv->attrs.width != width || priv->attrs.height != height)
{ meta_comp_window_detach (cw);
if (priv->back_pixmap)
{
XFreePixmap (xdisplay, priv->back_pixmap);
priv->back_pixmap = None;
}
}
priv->attrs.width = width; priv->attrs.width = width;
priv->attrs.height = height; priv->attrs.height = height;
@ -764,12 +753,9 @@ resize_win (MetaCompWindow *cw,
} }
static void static void
map_win (MetaDisplay *display, map_win (MetaDisplay *display, MetaScreen *screen, Window id)
MetaScreen *screen,
Window id)
{ {
MetaCompWindow *cw = find_window_for_screen (screen, id); MetaCompWindow *cw = find_window_for_screen (screen, id);
Display *xdisplay = meta_display_get_xdisplay (display);
MetaCompWindowPrivate *priv; MetaCompWindowPrivate *priv;
if (cw == NULL) if (cw == NULL)
@ -779,12 +765,6 @@ map_win (MetaDisplay *display,
priv->attrs.map_state = IsViewable; priv->attrs.map_state = IsViewable;
if (priv->back_pixmap)
{
XFreePixmap (xdisplay, priv->back_pixmap);
priv->back_pixmap = None;
}
priv->minimize_in_progress = FALSE; priv->minimize_in_progress = FALSE;
clutter_actor_show (CLUTTER_ACTOR (cw)); clutter_actor_show (CLUTTER_ACTOR (cw));
@ -792,9 +772,7 @@ map_win (MetaDisplay *display,
static void static void
unmap_win (MetaDisplay *display, unmap_win (MetaDisplay *display, MetaScreen *screen, Window id)
MetaScreen *screen,
Window id)
{ {
MetaCompWindow *cw = find_window_for_screen (screen, id); MetaCompWindow *cw = find_window_for_screen (screen, id);
MetaCompScreen *info = meta_screen_get_compositor_data (screen); MetaCompScreen *info = meta_screen_get_compositor_data (screen);
@ -813,16 +791,12 @@ unmap_win (MetaDisplay *display,
meta_comp_window_detach (cw); meta_comp_window_detach (cw);
if (!priv->minimize_in_progress) if (!priv->minimize_in_progress)
{
clutter_actor_hide (CLUTTER_ACTOR (cw)); clutter_actor_hide (CLUTTER_ACTOR (cw));
}
} }
static void static void
add_win (MetaScreen *screen, add_win (MetaScreen *screen, MetaWindow *window, Window xwindow)
MetaWindow *window,
Window xwindow)
{ {
MetaDisplay *display = meta_screen_get_display (screen); MetaDisplay *display = meta_screen_get_display (screen);
MetaCompScreen *info = meta_screen_get_compositor_data (screen); MetaCompScreen *info = meta_screen_get_compositor_data (screen);
@ -859,8 +833,6 @@ add_win (MetaScreen *screen,
} }
#if 0 #if 0
/* Add this to the list at the top of the stack
before it is mapped so that map_win can find it again */
printf ("added 0x%x (%p) type:", (guint)xwindow, cw); printf ("added 0x%x (%p) type:", (guint)xwindow, cw);
switch (cw->type) switch (cw->type)
@ -890,6 +862,10 @@ add_win (MetaScreen *screen,
printf("\n"); printf("\n");
#endif #endif
/*
* Add this to the list at the top of the stack before it is mapped so that
* map_win can find it again
*/
info->windows = g_list_prepend (info->windows, cw); info->windows = g_list_prepend (info->windows, cw);
g_hash_table_insert (info->windows_by_xid, (gpointer) xwindow, cw); g_hash_table_insert (info->windows_by_xid, (gpointer) xwindow, cw);
@ -900,7 +876,7 @@ add_win (MetaScreen *screen,
static void static void
repair_win (MetaCompWindow *cw) repair_win (MetaCompWindow *cw)
{ {
MetaCompWindowPrivate * priv = cw->priv; MetaCompWindowPrivate *priv = cw->priv;
MetaScreen *screen = priv->screen; MetaScreen *screen = priv->screen;
MetaDisplay *display = meta_screen_get_display (screen); MetaDisplay *display = meta_screen_get_display (screen);
Display *xdisplay = meta_display_get_xdisplay (display); Display *xdisplay = meta_display_get_xdisplay (display);
@ -938,8 +914,6 @@ repair_win (MetaCompWindow *cw)
if (priv->shadow) if (priv->shadow)
clutter_actor_set_size (priv->shadow, pxm_width, pxm_height); clutter_actor_set_size (priv->shadow, pxm_width, pxm_height);
clutter_actor_show (priv->actor);
} }
/* /*
@ -1006,14 +980,14 @@ process_create (MetaCompositorClutter *compositor,
MetaWindow *window) MetaWindow *window)
{ {
MetaScreen *screen; MetaScreen *screen;
/* We are only interested in top level windows, others will
be caught by normal metacity functions */
screen = meta_display_screen_for_root (compositor->display, event->parent); screen = meta_display_screen_for_root (compositor->display, event->parent);
if (screen == NULL) if (screen == NULL)
return; return;
/* This is quite silly as we end up creating windows as then immediatly /*
* This is quite silly as we end up creating windows as then immediatly
* destroying them as they (likely) become framed and thus reparented. * destroying them as they (likely) become framed and thus reparented.
*/ */
if (!find_window_in_display (compositor->display, event->window)) if (!find_window_in_display (compositor->display, event->window))
@ -1028,6 +1002,7 @@ process_reparent (MetaCompositorClutter *compositor,
MetaScreen *screen; MetaScreen *screen;
screen = meta_display_screen_for_root (compositor->display, event->parent); screen = meta_display_screen_for_root (compositor->display, event->parent);
if (screen != NULL) if (screen != NULL)
{ {
meta_verbose ("reparent: adding a new window 0x%x\n", meta_verbose ("reparent: adding a new window 0x%x\n",
@ -1105,8 +1080,6 @@ process_circulate_notify (MetaCompositorClutter *compositor,
event->window); event->window);
MetaCompWindow *top; MetaCompWindow *top;
MetaCompScreen *info; MetaCompScreen *info;
MetaScreen *screen;
GList *first;
Window above; Window above;
MetaCompWindowPrivate *priv; MetaCompWindowPrivate *priv;
@ -1115,10 +1088,8 @@ process_circulate_notify (MetaCompositorClutter *compositor,
priv = cw->priv; priv = cw->priv;
screen = priv->screen; info = meta_screen_get_compositor_data (priv->screen);
info = meta_screen_get_compositor_data (screen); top = info->windows->data;
first = info->windows;
top = (MetaCompWindow *) first->data;
if ((event->place == PlaceOnTop) && top) if ((event->place == PlaceOnTop) && top)
above = top->priv->xwindow; above = top->priv->xwindow;
@ -1214,8 +1185,7 @@ process_property_notify (MetaCompositorClutter *compositor,
return; return;
} }
else if (event->atom == meta_display_get_atom (display,
if (event->atom == meta_display_get_atom (display,
META_ATOM__NET_WM_WINDOW_TYPE)) META_ATOM__NET_WM_WINDOW_TYPE))
{ {
MetaCompWindow *cw = find_window_in_display (display, event->window); MetaCompWindow *cw = find_window_in_display (display, event->window);
@ -1224,14 +1194,12 @@ process_property_notify (MetaCompositorClutter *compositor,
return; return;
meta_comp_window_get_window_type (cw); meta_comp_window_get_window_type (cw);
//cw->needs_shadow = window_has_shadow (cw);
return; return;
} }
} }
static void static void
show_overlay_window (MetaScreen *screen, show_overlay_window (MetaScreen *screen, Window cow)
Window cow)
{ {
MetaDisplay *display = meta_screen_get_display (screen); MetaDisplay *display = meta_screen_get_display (screen);
Display *xdisplay = meta_display_get_xdisplay (display); Display *xdisplay = meta_display_get_xdisplay (display);
@ -1278,11 +1246,11 @@ clutter_cmp_manage_screen (MetaCompositor *compositor,
if (meta_screen_get_compositor_data (screen)) if (meta_screen_get_compositor_data (screen))
return; return;
gdk_error_trap_push (); meta_error_trap_push_with_return (display);
XCompositeRedirectSubwindows (xdisplay, xroot, CompositeRedirectManual); XCompositeRedirectSubwindows (xdisplay, xroot, CompositeRedirectManual);
XSync (xdisplay, FALSE); XSync (xdisplay, FALSE);
if (gdk_error_trap_pop ()) if (meta_error_trap_pop_with_return (display, FALSE))
{ {
g_warning ("Another compositing manager is running on screen %i", g_warning ("Another compositing manager is running on screen %i",
screen_number); screen_number);
@ -1501,13 +1469,10 @@ clutter_cmp_destroy_window (MetaCompositor *compositor,
{ {
#ifdef HAVE_COMPOSITE_EXTENSIONS #ifdef HAVE_COMPOSITE_EXTENSIONS
MetaCompWindow *cw = NULL; MetaCompWindow *cw = NULL;
MetaCompScreen *info; MetaScreen *screen = meta_window_get_screen (window);
MetaScreen *screen; MetaCompScreen *info = meta_screen_get_compositor_data (screen);
MetaFrame *f = meta_window_get_frame (window); MetaFrame *f = meta_window_get_frame (window);
screen = meta_window_get_screen (window);
info = meta_screen_get_compositor_data (screen);
/* Chances are we actually get the window frame here */ /* Chances are we actually get the window frame here */
cw = find_window_for_screen (screen, cw = find_window_for_screen (screen,
f ? meta_frame_get_xwindow (f) : f ? meta_frame_get_xwindow (f) :
@ -1515,10 +1480,8 @@ clutter_cmp_destroy_window (MetaCompositor *compositor,
if (!cw) if (!cw)
return; return;
meta_verbose ("Animating destroy of 0x%x\n", /*
(guint)meta_window_get_xwindow (window)); * We remove the window from internal lookup hashes and thus any other
/* We remove the window from internal lookup hashes and thus any other
* unmap events etc fail * unmap events etc fail
*/ */
info->windows = g_list_remove (info->windows, (gconstpointer) cw); info->windows = g_list_remove (info->windows, (gconstpointer) cw);
@ -1561,11 +1524,10 @@ on_minimize_effect_complete (ClutterActor *actor,
} }
static void static void
clutter_cmp_minimize_window (MetaCompositor *compositor, clutter_cmp_minimize_window (MetaCompositor *compositor, MetaWindow *window)
MetaWindow *window)
{ {
#ifdef HAVE_COMPOSITE_EXTENSIONS #ifdef HAVE_COMPOSITE_EXTENSIONS
MetaCompWindow *cw = NULL; MetaCompWindow *cw;
MetaCompScreen *info; MetaCompScreen *info;
MetaScreen *screen; MetaScreen *screen;
MetaFrame *f = meta_window_get_frame (window); MetaFrame *f = meta_window_get_frame (window);
@ -2311,7 +2273,7 @@ tidy_texture_frame_init (TidyTextureFrame *self)
self->priv = priv = TIDY_TEXTURE_FRAME_GET_PRIVATE (self); self->priv = priv = TIDY_TEXTURE_FRAME_GET_PRIVATE (self);
} }
ClutterActor* static ClutterActor*
tidy_texture_frame_new (ClutterTexture *texture, tidy_texture_frame_new (ClutterTexture *texture,
gint left, gint left,
gint top, gint top,