Make MetaCompositor the clutter compositor
* Move compositor-mutter.c to compositor.c * Remove the 'Mutter' typedef and define the structure for MetaCompositor directly. http://bugzilla.gnome.org/show_bug.cgi?id=581813
This commit is contained in:
parent
3aff9726eb
commit
72149a054e
@ -15,7 +15,7 @@ mutter_SOURCES= \
|
|||||||
core/bell.h \
|
core/bell.h \
|
||||||
core/boxes.c \
|
core/boxes.c \
|
||||||
include/boxes.h \
|
include/boxes.h \
|
||||||
compositor/compositor-mutter.c \
|
compositor/compositor.c \
|
||||||
compositor/mutter-module.c \
|
compositor/mutter-module.c \
|
||||||
compositor/mutter-module.h \
|
compositor/mutter-module.h \
|
||||||
compositor/mutter-plugin.c \
|
compositor/mutter-plugin.c \
|
||||||
|
@ -117,7 +117,7 @@ composite_at_least_version (MetaDisplay *display, int maj, int min)
|
|||||||
return (major > maj || (major == maj && minor >= min));
|
return (major > maj || (major == maj && minor >= min));
|
||||||
}
|
}
|
||||||
|
|
||||||
typedef struct _Mutter
|
struct _MetaCompositor
|
||||||
{
|
{
|
||||||
MetaDisplay *display;
|
MetaDisplay *display;
|
||||||
|
|
||||||
@ -130,7 +130,7 @@ typedef struct _Mutter
|
|||||||
gboolean show_redraw : 1;
|
gboolean show_redraw : 1;
|
||||||
gboolean debug : 1;
|
gboolean debug : 1;
|
||||||
gboolean no_mipmaps : 1;
|
gboolean no_mipmaps : 1;
|
||||||
} Mutter;
|
};
|
||||||
|
|
||||||
typedef struct _MetaCompScreen
|
typedef struct _MetaCompScreen
|
||||||
{
|
{
|
||||||
@ -311,8 +311,8 @@ mutter_window_init (MutterWindow *self)
|
|||||||
|
|
||||||
static gboolean is_shaped (MetaDisplay *display, Window xwindow);
|
static gboolean is_shaped (MetaDisplay *display, Window xwindow);
|
||||||
static gboolean mutter_window_has_shadow (MutterWindow *self);
|
static gboolean mutter_window_has_shadow (MutterWindow *self);
|
||||||
static void update_shape (Mutter *compositor,
|
static void update_shape (MetaCompositor *compositor,
|
||||||
MutterWindow *cw);
|
MutterWindow *cw);
|
||||||
|
|
||||||
static void
|
static void
|
||||||
mutter_meta_window_decorated_notify (MetaWindow *mw,
|
mutter_meta_window_decorated_notify (MetaWindow *mw,
|
||||||
@ -403,10 +403,10 @@ mutter_window_constructed (GObject *object)
|
|||||||
Display *xdisplay = meta_display_get_xdisplay (display);
|
Display *xdisplay = meta_display_get_xdisplay (display);
|
||||||
XRenderPictFormat *format;
|
XRenderPictFormat *format;
|
||||||
gulong value;
|
gulong value;
|
||||||
Mutter *compositor;
|
MetaCompositor *compositor;
|
||||||
Window xwin_child;
|
Window xwin_child;
|
||||||
|
|
||||||
compositor = (Mutter*) meta_display_get_compositor (display);
|
compositor = meta_display_get_compositor (display);
|
||||||
xwin_child = meta_window_get_xwindow (priv->window);
|
xwin_child = meta_window_get_xwindow (priv->window);
|
||||||
|
|
||||||
mutter_window_query_window_type (self);
|
mutter_window_query_window_type (self);
|
||||||
@ -575,9 +575,9 @@ mutter_window_set_property (GObject *object,
|
|||||||
{
|
{
|
||||||
gfloat w, h;
|
gfloat w, h;
|
||||||
MetaDisplay *display = meta_screen_get_display (priv->screen);
|
MetaDisplay *display = meta_screen_get_display (priv->screen);
|
||||||
Mutter *compositor;
|
MetaCompositor *compositor;
|
||||||
|
|
||||||
compositor = (Mutter*) meta_display_get_compositor (display);
|
compositor = meta_display_get_compositor (display);
|
||||||
|
|
||||||
clutter_actor_get_size (CLUTTER_ACTOR (mw), &w, &h);
|
clutter_actor_get_size (CLUTTER_ACTOR (mw), &w, &h);
|
||||||
|
|
||||||
@ -1432,7 +1432,7 @@ repair_win (MutterWindow *cw)
|
|||||||
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);
|
||||||
MetaCompScreen *info = meta_screen_get_compositor_data (screen);
|
MetaCompScreen *info = meta_screen_get_compositor_data (screen);
|
||||||
Mutter *compositor;
|
MetaCompositor *compositor;
|
||||||
Window xwindow = priv->xwindow;
|
Window xwindow = priv->xwindow;
|
||||||
gboolean full = FALSE;
|
gboolean full = FALSE;
|
||||||
|
|
||||||
@ -1440,7 +1440,7 @@ repair_win (MutterWindow *cw)
|
|||||||
xwindow == clutter_x11_get_stage_window (CLUTTER_STAGE (info->stage)))
|
xwindow == clutter_x11_get_stage_window (CLUTTER_STAGE (info->stage)))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
compositor = (Mutter*)meta_display_get_compositor (display);
|
compositor = meta_display_get_compositor (display);
|
||||||
|
|
||||||
meta_error_trap_push (display);
|
meta_error_trap_push (display);
|
||||||
|
|
||||||
@ -1559,8 +1559,8 @@ repair_win (MutterWindow *cw)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
process_damage (Mutter *compositor,
|
process_damage (MetaCompositor *compositor,
|
||||||
XDamageNotifyEvent *event)
|
XDamageNotifyEvent *event)
|
||||||
{
|
{
|
||||||
XEvent next;
|
XEvent next;
|
||||||
Display *dpy = event->display;
|
Display *dpy = event->display;
|
||||||
@ -1598,8 +1598,8 @@ process_damage (Mutter *compositor,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
update_shape (Mutter *compositor,
|
update_shape (MetaCompositor *compositor,
|
||||||
MutterWindow *cw)
|
MutterWindow *cw)
|
||||||
{
|
{
|
||||||
MutterWindowPrivate *priv = cw->priv;
|
MutterWindowPrivate *priv = cw->priv;
|
||||||
|
|
||||||
@ -1631,8 +1631,8 @@ update_shape (Mutter *compositor,
|
|||||||
|
|
||||||
#ifdef HAVE_SHAPE
|
#ifdef HAVE_SHAPE
|
||||||
static void
|
static void
|
||||||
process_shape (Mutter *compositor,
|
process_shape (MetaCompositor *compositor,
|
||||||
XShapeEvent *event)
|
XShapeEvent *event)
|
||||||
{
|
{
|
||||||
MutterWindow *cw = find_window_in_display (compositor->display,
|
MutterWindow *cw = find_window_in_display (compositor->display,
|
||||||
event->window);
|
event->window);
|
||||||
@ -1652,7 +1652,7 @@ process_shape (Mutter *compositor,
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
static void
|
static void
|
||||||
process_property_notify (Mutter *compositor,
|
process_property_notify (MetaCompositor *compositor,
|
||||||
XPropertyEvent *event)
|
XPropertyEvent *event)
|
||||||
{
|
{
|
||||||
MetaDisplay *display = compositor->display;
|
MetaDisplay *display = compositor->display;
|
||||||
@ -2014,8 +2014,6 @@ meta_compositor_process_event (MetaCompositor *compositor,
|
|||||||
XEvent *event,
|
XEvent *event,
|
||||||
MetaWindow *window)
|
MetaWindow *window)
|
||||||
{
|
{
|
||||||
Mutter *xrc = (Mutter *) compositor;
|
|
||||||
|
|
||||||
if (window)
|
if (window)
|
||||||
{
|
{
|
||||||
MetaCompScreen *info;
|
MetaCompScreen *info;
|
||||||
@ -2033,9 +2031,8 @@ meta_compositor_process_event (MetaCompositor *compositor,
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
GSList *l;
|
GSList *l;
|
||||||
Mutter *clc = (Mutter*)compositor;
|
|
||||||
|
|
||||||
l = meta_display_get_screens (clc->display);
|
l = meta_display_get_screens (compositor->display);
|
||||||
|
|
||||||
while (l)
|
while (l)
|
||||||
{
|
{
|
||||||
@ -2061,30 +2058,30 @@ meta_compositor_process_event (MetaCompositor *compositor,
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
meta_error_trap_push (xrc->display);
|
meta_error_trap_push (compositor->display);
|
||||||
switch (event->type)
|
switch (event->type)
|
||||||
{
|
{
|
||||||
case PropertyNotify:
|
case PropertyNotify:
|
||||||
process_property_notify (xrc, (XPropertyEvent *) event);
|
process_property_notify (compositor, (XPropertyEvent *) event);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
if (event->type == meta_display_get_damage_event_base (xrc->display) + XDamageNotify)
|
if (event->type == meta_display_get_damage_event_base (compositor->display) + XDamageNotify)
|
||||||
{
|
{
|
||||||
DEBUG_TRACE ("clutter_cmp_process_event (process_damage)\n");
|
DEBUG_TRACE ("clutter_cmp_process_event (process_damage)\n");
|
||||||
process_damage (xrc, (XDamageNotifyEvent *) event);
|
process_damage (compositor, (XDamageNotifyEvent *) event);
|
||||||
}
|
}
|
||||||
#ifdef HAVE_SHAPE
|
#ifdef HAVE_SHAPE
|
||||||
else if (event->type == meta_display_get_shape_event_base (xrc->display) + ShapeNotify)
|
else if (event->type == meta_display_get_shape_event_base (compositor->display) + ShapeNotify)
|
||||||
{
|
{
|
||||||
DEBUG_TRACE ("clutter_cmp_process_event (process_shape)\n");
|
DEBUG_TRACE ("clutter_cmp_process_event (process_shape)\n");
|
||||||
process_shape (xrc, (XShapeEvent *) event);
|
process_shape (compositor, (XShapeEvent *) event);
|
||||||
}
|
}
|
||||||
#endif /* HAVE_SHAPE */
|
#endif /* HAVE_SHAPE */
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
meta_error_trap_pop (xrc->display, FALSE);
|
meta_error_trap_pop (compositor->display, FALSE);
|
||||||
|
|
||||||
/* Clutter needs to know about MapNotify events otherwise it will
|
/* Clutter needs to know about MapNotify events otherwise it will
|
||||||
think the stage is invisible */
|
think the stage is invisible */
|
||||||
@ -2578,7 +2575,6 @@ meta_compositor_new (MetaDisplay *display)
|
|||||||
"_NET_WM_WINDOW_OPACITY",
|
"_NET_WM_WINDOW_OPACITY",
|
||||||
};
|
};
|
||||||
Atom atoms[G_N_ELEMENTS(atom_names)];
|
Atom atoms[G_N_ELEMENTS(atom_names)];
|
||||||
Mutter *clc;
|
|
||||||
MetaCompositor *compositor;
|
MetaCompositor *compositor;
|
||||||
Display *xdisplay = meta_display_get_xdisplay (display);
|
Display *xdisplay = meta_display_get_xdisplay (display);
|
||||||
guchar *data;
|
guchar *data;
|
||||||
@ -2586,30 +2582,28 @@ meta_compositor_new (MetaDisplay *display)
|
|||||||
if (!composite_at_least_version (display, 0, 3))
|
if (!composite_at_least_version (display, 0, 3))
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
clc = g_new0 (Mutter, 1);
|
compositor = g_new0 (MetaCompositor, 1);
|
||||||
|
|
||||||
compositor = (MetaCompositor *) clc;
|
compositor->display = display;
|
||||||
|
|
||||||
clc->display = display;
|
|
||||||
|
|
||||||
if (g_getenv("MUTTER_DISABLE_MIPMAPS"))
|
if (g_getenv("MUTTER_DISABLE_MIPMAPS"))
|
||||||
clc->no_mipmaps = TRUE;
|
compositor->no_mipmaps = TRUE;
|
||||||
|
|
||||||
meta_verbose ("Creating %d atoms\n", (int) G_N_ELEMENTS (atom_names));
|
meta_verbose ("Creating %d atoms\n", (int) G_N_ELEMENTS (atom_names));
|
||||||
XInternAtoms (xdisplay, atom_names, G_N_ELEMENTS (atom_names),
|
XInternAtoms (xdisplay, atom_names, G_N_ELEMENTS (atom_names),
|
||||||
False, atoms);
|
False, atoms);
|
||||||
|
|
||||||
clc->atom_x_root_pixmap = atoms[0];
|
compositor->atom_x_root_pixmap = atoms[0];
|
||||||
clc->atom_x_set_root = atoms[1];
|
compositor->atom_x_set_root = atoms[1];
|
||||||
clc->atom_net_wm_window_opacity = atoms[2];
|
compositor->atom_net_wm_window_opacity = atoms[2];
|
||||||
|
|
||||||
/* Shadow setup */
|
/* Shadow setup */
|
||||||
|
|
||||||
data = shadow_gaussian_make_tile ();
|
data = shadow_gaussian_make_tile ();
|
||||||
|
|
||||||
clc->shadow_src = clutter_texture_new ();
|
compositor->shadow_src = clutter_texture_new ();
|
||||||
|
|
||||||
clutter_texture_set_from_rgb_data (CLUTTER_TEXTURE (clc->shadow_src),
|
clutter_texture_set_from_rgb_data (CLUTTER_TEXTURE (compositor->shadow_src),
|
||||||
data,
|
data,
|
||||||
TRUE,
|
TRUE,
|
||||||
TILE_WIDTH,
|
TILE_WIDTH,
|
Loading…
x
Reference in New Issue
Block a user