Add a dependency on libcm when building with compositor.

Fri Jan 13 14:40:19 2006  Søren Sandmann  <sandmann@redhat.com>

	* configure.in: Add a dependency on libcm when building with
	compositor.

	* src/window.c (meta_window_hide): Make this function static.

	* src/window.c (implement_showing): Use meta_compositor_minimize()
	to do a weird minimize effect.

	* src/compositor.[ch]: Beginning of new GL based compositor.

	* src/screen.h (struct _MetaScreen): Add void pointer to
	compositor data.

	* src/screen.c (meta_screen_new): Remove obsolete compositor
	stuff; initialize compositor_data. Don't composite manage screen
	out of this function.

	* src/errors.c (x_error_handler): Check that display is non-NULL
	before using it. Add comment about how that can happen.

	* src/display.c (meta_display_{begin,end}_grab_op): Remove
	explicity damage of windows.

	* src/display.c (meta_display_open): Composite manage all the
	screens.
This commit is contained in:
Søren Sandmann 2006-01-13 19:41:01 +00:00 committed by Søren Sandmann Pedersen
parent 0eab7bd14c
commit fea6191473
9 changed files with 602 additions and 1001 deletions

View File

@ -1,3 +1,31 @@
Fri Jan 13 14:40:19 2006 Søren Sandmann <sandmann@redhat.com>
* configure.in: Add a dependency on libcm when building with
compositor.
* src/window.c (meta_window_hide): Make this function static.
* src/window.c (implement_showing): Use meta_compositor_minimize()
to do a weird minimize effect.
* src/compositor.[ch]: Beginning of new GL based compositor.
* src/screen.h (struct _MetaScreen): Add void pointer to
compositor data.
* src/screen.c (meta_screen_new): Remove obsolete compositor
stuff; initialize compositor_data. Don't composite manage screen
out of this function.
* src/errors.c (x_error_handler): Check that display is non-NULL
before using it. Add comment about how that can happen.
* src/display.c (meta_display_{begin,end}_grab_op): Remove
explicity damage of windows.
* src/display.c (meta_display_open): Composite manage all the
screens.
2006-01-11 Elijah Newren <newren gmail com> 2006-01-11 Elijah Newren <newren gmail com>
* src/textboxes.c (test_area, test_intersect, test_equal, * src/textboxes.c (test_area, test_intersect, test_equal,

View File

@ -222,7 +222,7 @@ fi
if test x$have_xcomposite = xyes; then if test x$have_xcomposite = xyes; then
echo "Building with CompositeExt" echo "Building with CompositeExt"
METACITY_PC_MODULES="$METACITY_PC_MODULES xcomposite >= $XCOMPOSITE_VERSION xfixes xrender xdamage" METACITY_PC_MODULES="$METACITY_PC_MODULES xcomposite >= $XCOMPOSITE_VERSION xfixes xrender xdamage cm"
AC_DEFINE(HAVE_COMPOSITE_EXTENSIONS, , [Building with compositing manager support]) AC_DEFINE(HAVE_COMPOSITE_EXTENSIONS, , [Building with compositing manager support])
## force on render also ## force on render also

File diff suppressed because it is too large Load Diff

View File

@ -25,6 +25,10 @@
#include "util.h" #include "util.h"
#include "display.h" #include "display.h"
#include <X11/extensions/Xfixes.h>
typedef void (* MetaMinimizeFinishedFunc) (gpointer data);
MetaCompositor* meta_compositor_new (MetaDisplay *display); MetaCompositor* meta_compositor_new (MetaDisplay *display);
void meta_compositor_unref (MetaCompositor *compositor); void meta_compositor_unref (MetaCompositor *compositor);
void meta_compositor_process_event (MetaCompositor *compositor, void meta_compositor_process_event (MetaCompositor *compositor,
@ -35,22 +39,21 @@ void meta_compositor_add_window (MetaCompositor *compositor,
XWindowAttributes *attrs); XWindowAttributes *attrs);
void meta_compositor_remove_window (MetaCompositor *compositor, void meta_compositor_remove_window (MetaCompositor *compositor,
Window xwindow); Window xwindow);
void meta_compositor_set_debug_updates (MetaCompositor *compositor,
gboolean debug_updates);
void meta_compositor_manage_screen (MetaCompositor *compositor, void meta_compositor_manage_screen (MetaCompositor *compositor,
MetaScreen *screen); MetaScreen *screen);
void meta_compositor_unmanage_screen (MetaCompositor *compositor, void meta_compositor_unmanage_screen (MetaCompositor *compositor,
MetaScreen *screen); MetaScreen *screen);
void meta_compositor_damage_window (MetaCompositor *compositor, void meta_compositor_minimize (MetaCompositor *compositor,
MetaWindow *window); MetaWindow *window,
int x,
int y,
int width,
int height,
MetaMinimizeFinishedFunc finished_cb,
gpointer finished_data);
#endif /* META_COMPOSITOR_H */ #endif /* META_COMPOSITOR_H */

View File

@ -689,7 +689,22 @@ meta_display_open (const char *name)
tmp = display->screens; tmp = display->screens;
while (tmp != NULL) while (tmp != NULL)
{ {
meta_screen_manage_all_windows (tmp->data); MetaScreen *screen = tmp->data;
/* The compositing manager opens its own connection to the X server
* and uses the XTest extension to ignore grabs. However, it also
* uses GL which opens yet another connection to the X server. With
* this ungrab/grab we would block indefinitely in XOpenDisplay().
*/
meta_display_ungrab (display);
meta_compositor_manage_screen (screen->display->compositor,
screen);
meta_display_grab (display);
meta_screen_manage_all_windows (screen);
tmp = tmp->next; tmp = tmp->next;
} }
@ -3456,12 +3471,6 @@ meta_display_begin_grab_op (MetaDisplay *display,
if (display->grab_window) if (display->grab_window)
{ {
meta_window_refresh_resize_popup (display->grab_window); meta_window_refresh_resize_popup (display->grab_window);
/* repaint window in case we draw it differently
* when grabbed
*/
meta_compositor_damage_window (display->compositor,
display->grab_window);
} }
return TRUE; return TRUE;
@ -3575,13 +3584,6 @@ meta_display_end_grab_op (MetaDisplay *display,
} }
#endif /* HAVE_XSYNC */ #endif /* HAVE_XSYNC */
/* repaint window in case the grab op drew it in a
* nonstandard way such as transparent or wireframe
*/
if (display->grab_window != NULL)
meta_compositor_damage_window (display->compositor,
display->grab_window);
display->grab_window = NULL; display->grab_window = NULL;
display->grab_screen = NULL; display->grab_screen = NULL;
display->grab_xwindow = None; display->grab_xwindow = None;

View File

@ -97,7 +97,6 @@ meta_error_trap_pop_internal (MetaDisplay *display,
XErrorEvent *); XErrorEvent *);
restored_error_handler = XSetErrorHandler (x_error_handler); restored_error_handler = XSetErrorHandler (x_error_handler);
g_assert (restored_error_handler == x_error_handler);
/* remove this */ /* remove this */
display->error_trap_handler = NULL; display->error_trap_handler = NULL;
@ -184,7 +183,10 @@ x_error_handler (Display *xdisplay,
display = meta_display_for_x_display (xdisplay); display = meta_display_for_x_display (xdisplay);
if (display->error_traps > 0) /* Display can be NULL here because the compositing manager
* has its own Display, but Xlib only has one global error handler
*/
if (display && display->error_traps > 0)
{ {
/* we're in an error trap, chain to the trap handler /* we're in an error trap, chain to the trap handler
* saved from GDK * saved from GDK

View File

@ -534,12 +534,7 @@ meta_screen_new (MetaDisplay *display,
screen->columns_of_workspaces = -1; screen->columns_of_workspaces = -1;
screen->vertical_workspaces = FALSE; screen->vertical_workspaces = FALSE;
screen->starting_corner = META_SCREEN_TOPLEFT; screen->starting_corner = META_SCREEN_TOPLEFT;
screen->compositor_data = NULL;
screen->compositor_windows = NULL;
screen->damage_region = None;
screen->root_picture = None;
screen->trans_pixmap = None;
screen->trans_picture = None;
{ {
XFontStruct *font_info; XFontStruct *font_info;
@ -652,9 +647,6 @@ meta_screen_new (MetaDisplay *display,
meta_workspace_activate (space, timestamp); meta_workspace_activate (space, timestamp);
} }
meta_compositor_manage_screen (screen->display->compositor,
screen);
meta_verbose ("Added screen %d ('%s') root 0x%lx\n", meta_verbose ("Added screen %d ('%s') root 0x%lx\n",
screen->number, screen->screen_name, screen->xroot); screen->number, screen->screen_name, screen->xroot);

View File

@ -116,12 +116,8 @@ struct _MetaScreen
/* gc for XOR on root window */ /* gc for XOR on root window */
GC root_xor_gc; GC root_xor_gc;
/* Managed by compositor.c; top of stack is first in list */ /* Managed by compositor.c */
GList *compositor_windows; gpointer compositor_data;
XID root_picture;
XID damage_region;
XID trans_pixmap;
XID trans_picture;
}; };
MetaScreen* meta_screen_new (MetaDisplay *display, MetaScreen* meta_screen_new (MetaDisplay *display,

View File

@ -41,6 +41,7 @@
#include "group.h" #include "group.h"
#include "window-props.h" #include "window-props.h"
#include "constraints.h" #include "constraints.h"
#include "compositor.h"
#include <X11/Xatom.h> #include <X11/Xatom.h>
#include <string.h> #include <string.h>
@ -1312,6 +1313,21 @@ meta_window_should_be_showing (MetaWindow *window)
return on_workspace && meta_window_showing_on_its_workspace (window); return on_workspace && meta_window_showing_on_its_workspace (window);
} }
static void
finish_minimize (gpointer data)
{
MetaWindow *window = data;
meta_window_hide (window);
if (window->has_focus)
{
meta_workspace_focus_default_window
(window->screen->active_workspace,
window,
meta_display_get_current_time_roundtrip (window->display));
}
}
static void static void
implement_showing (MetaWindow *window, implement_showing (MetaWindow *window,
gboolean showing) gboolean showing)
@ -1355,15 +1371,33 @@ implement_showing (MetaWindow *window,
meta_window_get_outer_rect (window, &window_rect); meta_window_get_outer_rect (window, &window_rect);
if (window->display->compositor)
{
/* Draw a nice cool animation */ /* Draw a nice cool animation */
meta_compositor_minimize (window->display->compositor,
window,
icon_rect.x,
icon_rect.y,
icon_rect.width,
icon_rect.height,
finish_minimize,
window);
}
else
{
meta_effects_draw_box_animation (window->screen, meta_effects_draw_box_animation (window->screen,
&window_rect, &window_rect,
&icon_rect, &icon_rect,
META_MINIMIZE_ANIMATION_LENGTH, META_MINIMIZE_ANIMATION_LENGTH,
META_BOX_ANIM_SCALE); META_BOX_ANIM_SCALE);
}
meta_window_hide (window); finish_minimize (window);
}
}
else
{
finish_minimize (window);
}
} }
else else
{ {
@ -2000,7 +2034,7 @@ meta_window_show (MetaWindow *window)
} }
} }
void static void
meta_window_hide (MetaWindow *window) meta_window_hide (MetaWindow *window)
{ {
gboolean did_hide; gboolean did_hide;
@ -2078,7 +2112,6 @@ meta_window_minimize (MetaWindow *window)
meta_topic (META_DEBUG_FOCUS, meta_topic (META_DEBUG_FOCUS,
"Focusing default window due to minimization of focus window %s\n", "Focusing default window due to minimization of focus window %s\n",
window->desc); window->desc);
meta_workspace_focus_default_window (window->screen->active_workspace, window, meta_display_get_current_time_roundtrip (window->display));
} }
else else
{ {