Commit fea61914 authored by Søren Sandmann's avatar Søren Sandmann Committed by Søren Sandmann Pedersen
Browse files

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.
parent 0eab7bd1
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>
* src/textboxes.c (test_area, test_intersect, test_equal,
......
......@@ -222,7 +222,7 @@ fi
if test x$have_xcomposite = xyes; then
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])
## force on render also
......
This diff is collapsed.
......@@ -25,6 +25,10 @@
#include "util.h"
#include "display.h"
#include <X11/extensions/Xfixes.h>
typedef void (* MetaMinimizeFinishedFunc) (gpointer data);
MetaCompositor* meta_compositor_new (MetaDisplay *display);
void meta_compositor_unref (MetaCompositor *compositor);
void meta_compositor_process_event (MetaCompositor *compositor,
......@@ -35,22 +39,21 @@ void meta_compositor_add_window (MetaCompositor *compositor,
XWindowAttributes *attrs);
void meta_compositor_remove_window (MetaCompositor *compositor,
Window xwindow);
void meta_compositor_set_debug_updates (MetaCompositor *compositor,
gboolean debug_updates);
void meta_compositor_manage_screen (MetaCompositor *compositor,
MetaScreen *screen);
void meta_compositor_unmanage_screen (MetaCompositor *compositor,
MetaScreen *screen);
void meta_compositor_damage_window (MetaCompositor *compositor,
MetaWindow *window);
void meta_compositor_minimize (MetaCompositor *compositor,
MetaWindow *window,
int x,
int y,
int width,
int height,
MetaMinimizeFinishedFunc finished_cb,
gpointer finished_data);
#endif /* META_COMPOSITOR_H */
......@@ -689,7 +689,22 @@ meta_display_open (const char *name)
tmp = display->screens;
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;
}
......@@ -811,7 +826,7 @@ void
meta_display_close (MetaDisplay *display)
{
GSList *tmp;
if (display->error_traps > 0)
meta_bug ("Display closed with error traps pending\n");
......@@ -3456,12 +3471,6 @@ meta_display_begin_grab_op (MetaDisplay *display,
if (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;
......@@ -3574,13 +3583,6 @@ meta_display_end_grab_op (MetaDisplay *display,
display->grab_sync_request_alarm = None;
}
#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_screen = NULL;
......
......@@ -97,7 +97,6 @@ meta_error_trap_pop_internal (MetaDisplay *display,
XErrorEvent *);
restored_error_handler = XSetErrorHandler (x_error_handler);
g_assert (restored_error_handler == x_error_handler);
/* remove this */
display->error_trap_handler = NULL;
......@@ -183,8 +182,11 @@ x_error_handler (Display *xdisplay,
XGetErrorText (xdisplay, error->error_code, buf, 63);
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
* saved from GDK
......
......@@ -534,13 +534,8 @@ meta_screen_new (MetaDisplay *display,
screen->columns_of_workspaces = -1;
screen->vertical_workspaces = FALSE;
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;
XGCValues gc_values;
......@@ -652,9 +647,6 @@ meta_screen_new (MetaDisplay *display,
meta_workspace_activate (space, timestamp);
}
meta_compositor_manage_screen (screen->display->compositor,
screen);
meta_verbose ("Added screen %d ('%s') root 0x%lx\n",
screen->number, screen->screen_name, screen->xroot);
......
......@@ -116,12 +116,8 @@ struct _MetaScreen
/* gc for XOR on root window */
GC root_xor_gc;
/* Managed by compositor.c; top of stack is first in list */
GList *compositor_windows;
XID root_picture;
XID damage_region;
XID trans_pixmap;
XID trans_picture;
/* Managed by compositor.c */
gpointer compositor_data;
};
MetaScreen* meta_screen_new (MetaDisplay *display,
......
......@@ -41,6 +41,7 @@
#include "group.h"
#include "window-props.h"
#include "constraints.h"
#include "compositor.h"
#include <X11/Xatom.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);
}
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
implement_showing (MetaWindow *window,
gboolean showing)
......@@ -1354,16 +1370,34 @@ implement_showing (MetaWindow *window,
}
meta_window_get_outer_rect (window, &window_rect);
/* Draw a nice cool animation */
meta_effects_draw_box_animation (window->screen,
&window_rect,
&icon_rect,
META_MINIMIZE_ANIMATION_LENGTH,
META_BOX_ANIM_SCALE);
}
meta_window_hide (window);
if (window->display->compositor)
{
/* 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,
&window_rect,
&icon_rect,
META_MINIMIZE_ANIMATION_LENGTH,
META_BOX_ANIM_SCALE);
finish_minimize (window);
}
}
else
{
finish_minimize (window);
}
}
else
{
......@@ -2000,7 +2034,7 @@ meta_window_show (MetaWindow *window)
}
}
void
static void
meta_window_hide (MetaWindow *window)
{
gboolean did_hide;
......@@ -2078,7 +2112,6 @@ meta_window_minimize (MetaWindow *window)
meta_topic (META_DEBUG_FOCUS,
"Focusing default window due to minimization of focus window %s\n",
window->desc);
meta_workspace_focus_default_window (window->screen->active_workspace, window, meta_display_get_current_time_roundtrip (window->display));
}
else
{
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment