Disabled bling for now; added function for handling CirculateNotify
* src/compositor.c: Disabled bling for now; added function for handling CirculateNotify XEvent; some commenting. * src/compositor.h, src/c-window.c: fix function prototype visibility.
This commit is contained in:
parent
34138ff44e
commit
5080b8fefb
@ -1,3 +1,9 @@
|
|||||||
|
2006-12-21 Thomas Thurman <thomas@thurman.org.uk>
|
||||||
|
|
||||||
|
* src/compositor.c: Disabled bling for now; added function for
|
||||||
|
handling CirculateNotify XEvent; some commenting.
|
||||||
|
* src/compositor.h, src/c-window.c: fix function prototype visibility.
|
||||||
|
|
||||||
2006-12-12 Thomas Thurman <thomas@thurman.org.uk>
|
2006-12-12 Thomas Thurman <thomas@thurman.org.uk>
|
||||||
|
|
||||||
* src/compositor.c (do_effect): Sanity check to avoid dereferencing
|
* src/compositor.c (do_effect): Sanity check to avoid dereferencing
|
||||||
|
@ -36,7 +36,8 @@
|
|||||||
#include "c-window.h"
|
#include "c-window.h"
|
||||||
#include "window.h"
|
#include "window.h"
|
||||||
#include "frame.h"
|
#include "frame.h"
|
||||||
#include "spring-model.h"
|
#include "compositor.h"
|
||||||
|
#include "workspace.h"
|
||||||
|
|
||||||
typedef struct UnminimizeInfo UnminimizeInfo;
|
typedef struct UnminimizeInfo UnminimizeInfo;
|
||||||
|
|
||||||
@ -1186,10 +1187,6 @@ typedef struct
|
|||||||
gdouble last_time;
|
gdouble last_time;
|
||||||
} FocusInfo;
|
} FocusInfo;
|
||||||
|
|
||||||
/* XXX HATE */
|
|
||||||
extern void get_patch_points (Model *model, CmPoint points[4][4]);
|
|
||||||
extern void compute_window_rect (MetaWindow *window, MetaRectangle *rect);
|
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
update_focus (gpointer data)
|
update_focus (gpointer data)
|
||||||
{
|
{
|
||||||
|
@ -49,7 +49,6 @@
|
|||||||
#include <X11/extensions/Xdamage.h>
|
#include <X11/extensions/Xdamage.h>
|
||||||
#include <X11/extensions/Xfixes.h>
|
#include <X11/extensions/Xfixes.h>
|
||||||
#include <X11/extensions/Xrender.h>
|
#include <X11/extensions/Xrender.h>
|
||||||
#include "spring-model.h"
|
|
||||||
#include <cm/state.h>
|
#include <cm/state.h>
|
||||||
|
|
||||||
#include "effects.h"
|
#include "effects.h"
|
||||||
@ -113,6 +112,11 @@ get_xid (MetaWindow *window)
|
|||||||
|
|
||||||
#ifdef HAVE_COMPOSITE_EXTENSIONS
|
#ifdef HAVE_COMPOSITE_EXTENSIONS
|
||||||
|
|
||||||
|
#ifdef SPIFFY_COMPOSITOR
|
||||||
|
/* This is called by Metacity's effect code when an effect needs to happen.
|
||||||
|
* In compositor-less Metacity, this includes things like the wireframe
|
||||||
|
* zoom when a window is minimised. We have a rather larger box of tricks.
|
||||||
|
*/
|
||||||
static void
|
static void
|
||||||
do_effect (MetaEffect *effect,
|
do_effect (MetaEffect *effect,
|
||||||
gpointer data)
|
gpointer data)
|
||||||
@ -164,9 +168,13 @@ do_effect (MetaEffect *effect,
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif /* SPIFFY_COMPOSITOR */
|
||||||
|
|
||||||
#endif /* HAVE_COMPOSITE_EXTENSIONS */
|
#endif /* HAVE_COMPOSITE_EXTENSIONS */
|
||||||
|
|
||||||
|
/* Constructs a new compositor. The rest of Metacity knows whether the
|
||||||
|
* compositor is turned on by whether this function returns NULL or not.
|
||||||
|
*/
|
||||||
MetaCompositor *
|
MetaCompositor *
|
||||||
meta_compositor_new (MetaDisplay *display)
|
meta_compositor_new (MetaDisplay *display)
|
||||||
{
|
{
|
||||||
@ -211,7 +219,9 @@ meta_compositor_new (MetaDisplay *display)
|
|||||||
|
|
||||||
compositor->enabled = TRUE;
|
compositor->enabled = TRUE;
|
||||||
|
|
||||||
|
#ifdef SPIFFY_COMPOSITOR
|
||||||
meta_push_effect_handler (do_effect, compositor);
|
meta_push_effect_handler (do_effect, compositor);
|
||||||
|
#endif
|
||||||
|
|
||||||
return compositor;
|
return compositor;
|
||||||
#else /* HAVE_COMPOSITE_EXTENSIONS */
|
#else /* HAVE_COMPOSITE_EXTENSIONS */
|
||||||
@ -219,6 +229,7 @@ meta_compositor_new (MetaDisplay *display)
|
|||||||
#endif /* HAVE_COMPOSITE_EXTENSIONS */
|
#endif /* HAVE_COMPOSITE_EXTENSIONS */
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if 0
|
||||||
void
|
void
|
||||||
meta_compositor_set_debug_updates (MetaCompositor *compositor,
|
meta_compositor_set_debug_updates (MetaCompositor *compositor,
|
||||||
gboolean debug_updates)
|
gboolean debug_updates)
|
||||||
@ -227,6 +238,7 @@ meta_compositor_set_debug_updates (MetaCompositor *compositor,
|
|||||||
compositor->debug_updates = !!debug_updates;
|
compositor->debug_updates = !!debug_updates;
|
||||||
#endif /* HAVE_COMPOSITE_EXTENSIONS */
|
#endif /* HAVE_COMPOSITE_EXTENSIONS */
|
||||||
}
|
}
|
||||||
|
#endif /* 0 */
|
||||||
|
|
||||||
#ifdef HAVE_COMPOSITE_EXTENSIONS
|
#ifdef HAVE_COMPOSITE_EXTENSIONS
|
||||||
static void
|
static void
|
||||||
@ -255,8 +267,29 @@ meta_compositor_unref (MetaCompositor *compositor)
|
|||||||
#endif /* HAVE_COMPOSITE_EXTENSIONS */
|
#endif /* HAVE_COMPOSITE_EXTENSIONS */
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef HAVE_COMPOSITE_EXTENSIONS
|
/****************************************************************************
|
||||||
|
*
|
||||||
|
* HANDLING X EVENTS
|
||||||
|
*
|
||||||
|
* Here are several process_* functions, which are all called by
|
||||||
|
* meta_compositor_process_event at the bottom.
|
||||||
|
*
|
||||||
|
****************************************************************************/
|
||||||
|
|
||||||
|
#ifdef HAVE_COMPOSITE_EXTENSIONS
|
||||||
|
/* Handles the CirculateNotify XEvent.
|
||||||
|
*/
|
||||||
|
static void
|
||||||
|
process_circulate_notify (MetaCompositor *compositor,
|
||||||
|
XCirculateEvent* event)
|
||||||
|
{
|
||||||
|
/* FIXME: Do something here. */
|
||||||
|
}
|
||||||
|
#endif /* HAVE_COMPOSITE_EXTENSIONS */
|
||||||
|
|
||||||
|
#ifdef HAVE_COMPOSITE_EXTENSIONS
|
||||||
|
/* Handles the ConfigureNotify XEvent.
|
||||||
|
*/
|
||||||
static void
|
static void
|
||||||
process_configure_notify (MetaCompositor *compositor,
|
process_configure_notify (MetaCompositor *compositor,
|
||||||
XConfigureEvent *event)
|
XConfigureEvent *event)
|
||||||
@ -290,6 +323,9 @@ process_configure_notify (MetaCompositor *compositor,
|
|||||||
|
|
||||||
|
|
||||||
#ifdef HAVE_COMPOSITE_EXTENSIONS
|
#ifdef HAVE_COMPOSITE_EXTENSIONS
|
||||||
|
/* Handles the Expose XEvent.
|
||||||
|
* XXX FIXME: This looks like it quite urgently needs looking into. --tthurman
|
||||||
|
*/
|
||||||
static void
|
static void
|
||||||
process_expose (MetaCompositor *compositor,
|
process_expose (MetaCompositor *compositor,
|
||||||
XExposeEvent *event)
|
XExposeEvent *event)
|
||||||
@ -301,6 +337,10 @@ process_expose (MetaCompositor *compositor,
|
|||||||
|
|
||||||
#ifdef HAVE_COMPOSITE_EXTENSIONS
|
#ifdef HAVE_COMPOSITE_EXTENSIONS
|
||||||
|
|
||||||
|
#if 0
|
||||||
|
|
||||||
|
/* Apparently never used. */
|
||||||
|
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
CmDrawableNode *node;
|
CmDrawableNode *node;
|
||||||
@ -340,9 +380,12 @@ fade_out (gpointer data)
|
|||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif /* 0 */
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef HAVE_COMPOSITE_EXTENSIONS
|
#ifdef HAVE_COMPOSITE_EXTENSIONS
|
||||||
|
/* Handles the MapNotify XEvent.
|
||||||
|
*/
|
||||||
static void
|
static void
|
||||||
process_map (MetaCompositor *compositor,
|
process_map (MetaCompositor *compositor,
|
||||||
XMapEvent *event)
|
XMapEvent *event)
|
||||||
@ -374,6 +417,8 @@ process_map (MetaCompositor *compositor,
|
|||||||
#endif /* HAVE_COMPOSITE_EXTENSIONS */
|
#endif /* HAVE_COMPOSITE_EXTENSIONS */
|
||||||
|
|
||||||
#ifdef HAVE_COMPOSITE_EXTENSIONS
|
#ifdef HAVE_COMPOSITE_EXTENSIONS
|
||||||
|
/* Handles the UnmapNotify XEvent.
|
||||||
|
*/
|
||||||
static void
|
static void
|
||||||
process_unmap (MetaCompositor *compositor,
|
process_unmap (MetaCompositor *compositor,
|
||||||
XUnmapEvent *event)
|
XUnmapEvent *event)
|
||||||
@ -400,6 +445,8 @@ process_unmap (MetaCompositor *compositor,
|
|||||||
#endif /* HAVE_COMPOSITE_EXTENSIONS */
|
#endif /* HAVE_COMPOSITE_EXTENSIONS */
|
||||||
|
|
||||||
#ifdef HAVE_COMPOSITE_EXTENSIONS
|
#ifdef HAVE_COMPOSITE_EXTENSIONS
|
||||||
|
/* Handles the CreateNotify XEvent.
|
||||||
|
*/
|
||||||
static void
|
static void
|
||||||
process_create (MetaCompositor *compositor,
|
process_create (MetaCompositor *compositor,
|
||||||
XCreateWindowEvent *event)
|
XCreateWindowEvent *event)
|
||||||
@ -441,6 +488,8 @@ process_create (MetaCompositor *compositor,
|
|||||||
#endif /* HAVE_COMPOSITE_EXTENSIONS */
|
#endif /* HAVE_COMPOSITE_EXTENSIONS */
|
||||||
|
|
||||||
#ifdef HAVE_COMPOSITE_EXTENSIONS
|
#ifdef HAVE_COMPOSITE_EXTENSIONS
|
||||||
|
/* Handles the DestroyNotify XEvent.
|
||||||
|
*/
|
||||||
static void
|
static void
|
||||||
process_destroy (MetaCompositor *compositor,
|
process_destroy (MetaCompositor *compositor,
|
||||||
XDestroyWindowEvent *event)
|
XDestroyWindowEvent *event)
|
||||||
@ -474,6 +523,8 @@ process_destroy (MetaCompositor *compositor,
|
|||||||
|
|
||||||
|
|
||||||
#ifdef HAVE_COMPOSITE_EXTENSIONS
|
#ifdef HAVE_COMPOSITE_EXTENSIONS
|
||||||
|
/* Handles the ReparentNotify XEvent.
|
||||||
|
*/
|
||||||
static void
|
static void
|
||||||
process_reparent (MetaCompositor *compositor,
|
process_reparent (MetaCompositor *compositor,
|
||||||
XReparentEvent *event)
|
XReparentEvent *event)
|
||||||
@ -516,6 +567,9 @@ process_reparent (MetaCompositor *compositor,
|
|||||||
|
|
||||||
#endif /* HAVE_COMPOSITE_EXTENSIONS */
|
#endif /* HAVE_COMPOSITE_EXTENSIONS */
|
||||||
|
|
||||||
|
/* If the compositor is enabled, this function gets called with any XEvent
|
||||||
|
* in case we want to deal with it specially.
|
||||||
|
*/
|
||||||
void
|
void
|
||||||
meta_compositor_process_event (MetaCompositor *compositor,
|
meta_compositor_process_event (MetaCompositor *compositor,
|
||||||
XEvent *event,
|
XEvent *event,
|
||||||
@ -525,9 +579,12 @@ meta_compositor_process_event (MetaCompositor *compositor,
|
|||||||
if (!compositor->enabled)
|
if (!compositor->enabled)
|
||||||
return; /* no extension */
|
return; /* no extension */
|
||||||
|
|
||||||
/* FIXME support CirculateNotify */
|
if (event->type == CirculateNotify)
|
||||||
|
{
|
||||||
if (event->type == ConfigureNotify)
|
process_circulate_notify (compositor,
|
||||||
|
(XCirculateEvent*) event);
|
||||||
|
}
|
||||||
|
else if (event->type == ConfigureNotify)
|
||||||
{
|
{
|
||||||
process_configure_notify (compositor,
|
process_configure_notify (compositor,
|
||||||
(XConfigureEvent*) event);
|
(XConfigureEvent*) event);
|
||||||
@ -567,10 +624,13 @@ meta_compositor_process_event (MetaCompositor *compositor,
|
|||||||
}
|
}
|
||||||
|
|
||||||
#ifdef HAVE_COMPOSITE_EXTENSIONS
|
#ifdef HAVE_COMPOSITE_EXTENSIONS
|
||||||
|
#if 0
|
||||||
static GTimer *timer;
|
static GTimer *timer;
|
||||||
|
#endif /* 0 */
|
||||||
#endif /* HAVE_COMPOSITE_EXTENSIONS */
|
#endif /* HAVE_COMPOSITE_EXTENSIONS */
|
||||||
|
|
||||||
#ifdef HAVE_COMPOSITE_EXTENSIONS
|
#ifdef HAVE_COMPOSITE_EXTENSIONS
|
||||||
|
#if 0
|
||||||
static void
|
static void
|
||||||
dump_stacking_order (GList *nodes)
|
dump_stacking_order (GList *nodes)
|
||||||
{
|
{
|
||||||
@ -584,6 +644,7 @@ dump_stacking_order (GList *nodes)
|
|||||||
}
|
}
|
||||||
g_print ("\n");
|
g_print ("\n");
|
||||||
}
|
}
|
||||||
|
#endif /* 0 */
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* This is called when metacity does its XQueryTree() on startup
|
/* This is called when metacity does its XQueryTree() on startup
|
||||||
@ -770,7 +831,7 @@ struct MoveInfo
|
|||||||
|
|
||||||
void
|
void
|
||||||
get_patch_points (Model *model,
|
get_patch_points (Model *model,
|
||||||
CmPoint points[4][4])
|
CmPoint points[4][4])
|
||||||
{
|
{
|
||||||
int i, j;
|
int i, j;
|
||||||
|
|
||||||
|
@ -26,6 +26,13 @@
|
|||||||
|
|
||||||
#include "util.h"
|
#include "util.h"
|
||||||
#include "display.h"
|
#include "display.h"
|
||||||
|
#include "spring-model.h"
|
||||||
|
|
||||||
|
#ifdef HAVE_COMPOSITE_EXTENSIONS
|
||||||
|
#include "cm/deform.h"
|
||||||
|
/* FIXME: Needs namespacing. */
|
||||||
|
void get_patch_points (Model *model, CmPoint points[4][4]);
|
||||||
|
#endif
|
||||||
|
|
||||||
typedef void (* MetaAnimationFinishedFunc) (gpointer data);
|
typedef void (* MetaAnimationFinishedFunc) (gpointer data);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user