diff -Nru compiz-0.9.7.8/debian/changelog compiz-0.9.7.8/debian/changelog --- compiz-0.9.7.8/debian/changelog 2012-06-25 11:17:26.000000000 +0000 +++ compiz-0.9.7.8/debian/changelog 2012-07-10 18:18:45.000000000 +0000 @@ -1,3 +1,9 @@ +compiz (1:0.9.7.8-0ubuntu1.2) precise-proposed; urgency=low + + * Revert SRU because of last minute regression being reported. (LP: #1019337) + + -- Stéphane Graber Tue, 10 Jul 2012 14:18:18 -0400 + compiz (1:0.9.7.8-0ubuntu1.1) precise-proposed; urgency=low [ Łukasz 'sil2100' Zemczak ] diff -Nru compiz-0.9.7.8/debian/control compiz-0.9.7.8/debian/control --- compiz-0.9.7.8/debian/control 2012-06-25 11:17:26.000000000 +0000 +++ compiz-0.9.7.8/debian/control 2012-04-27 06:30:08.000000000 +0000 @@ -27,7 +27,7 @@ metacity-common, libx11-xcb-dev, gnome-control-center-dev, Standards-Version: 3.9.3 -Vcs-Bzr: https://code.launchpad.net/~ubuntu-desktop/compiz/precise +Vcs-Bzr: https://code.launchpad.net/~compiz/compiz/ubuntu Package: compiz Architecture: all diff -Nru compiz-0.9.7.8/debian/patches/fix_1005569.patch compiz-0.9.7.8/debian/patches/fix_1005569.patch --- compiz-0.9.7.8/debian/patches/fix_1005569.patch 2012-06-25 11:17:26.000000000 +0000 +++ compiz-0.9.7.8/debian/patches/fix_1005569.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,102 +0,0 @@ -=== modified file 'include/core/option.h' ---- old/include/core/option.h 2012-02-16 08:30:33 +0000 -+++ new/include/core/option.h 2012-06-20 11:43:47 +0000 -@@ -238,6 +238,7 @@ - ~CompOption (); - - void setName (CompString name, Type type); -+ void setName (const char *name, Type type); - - void reset (); - - -=== modified file 'src/event.cpp' ---- old/src/event.cpp 2012-04-04 03:11:55 +0000 -+++ new/src/event.cpp 2012-06-20 11:41:54 +0000 -@@ -649,15 +649,19 @@ - bool - PrivateScreen::handleActionEvent (XEvent *event) - { -- static CompOption::Vector o (8); -+ static CompOption::Vector o; - Window xid; - -- o[0].setName ("event_window", CompOption::TypeInt); -- o[1].setName ("window", CompOption::TypeInt); -- o[2].setName ("modifiers", CompOption::TypeInt); -- o[3].setName ("x", CompOption::TypeInt); -- o[4].setName ("y", CompOption::TypeInt); -- o[5].setName ("root", CompOption::TypeInt); -+ if (o.empty ()) -+ { -+ o.resize (8); -+ o[0].setName ("event_window", CompOption::TypeInt); -+ o[1].setName ("window", CompOption::TypeInt); -+ o[2].setName ("modifiers", CompOption::TypeInt); -+ o[3].setName ("x", CompOption::TypeInt); -+ o[4].setName ("y", CompOption::TypeInt); -+ o[5].setName ("root", CompOption::TypeInt); -+ } - o[6].reset (); - o[7].reset (); - -@@ -937,6 +941,14 @@ - if (event->type == xkbEvent) - { - XkbAnyEvent *xkbEvent = (XkbAnyEvent *) event; -+ static CompOption::Vector o; -+ -+ if (o.empty ()) -+ { -+ o.resize (8); -+ o[0].setName ("event_window", CompOption::TypeInt); -+ o[1].setName ("window", CompOption::TypeInt); -+ } - - if (xkbEvent->xkb_type == XkbStateNotify) - { -@@ -944,13 +956,10 @@ - - o[0].value ().set ((int) activeWindow); - o[1].value ().set ((int) activeWindow); -+ o[2].setName ("modifiers", CompOption::TypeInt); - o[2].value ().set ((int) stateEvent->mods); -- - o[3].setName ("time", CompOption::TypeInt); - o[3].value ().set ((int) xkbEvent->time); -- o[4].reset (); -- o[5].reset (); -- o[6].reset (); - o[7].value ().set ((int) xkbEvent->time); - - if (stateEvent->event_type == KeyPress) -@@ -971,9 +980,6 @@ - o[2].setName ("time", CompOption::TypeInt); - o[2].value ().set ((int) xkbEvent->time); - o[3].reset (); -- o[4].reset (); -- o[5].reset (); -- - - foreach (CompPlugin *p, CompPlugin::getPlugins ()) - { - -=== modified file 'src/option.cpp' ---- old/src/option.cpp 2012-02-20 08:09:35 +0000 -+++ new/src/option.cpp 2012-06-20 11:43:47 +0000 -@@ -458,6 +458,14 @@ - priv->type = type; - } - -+void -+CompOption::setName (const char *name, CompOption::Type type) -+{ -+ if (priv->name != name) -+ priv->name = name; -+ priv->type = type; -+} -+ - CompString - CompOption::name () - { - diff -Nru compiz-0.9.7.8/debian/patches/fix_1006335.patch compiz-0.9.7.8/debian/patches/fix_1006335.patch --- compiz-0.9.7.8/debian/patches/fix_1006335.patch 2012-06-25 11:17:26.000000000 +0000 +++ compiz-0.9.7.8/debian/patches/fix_1006335.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,320 +0,0 @@ -=== modified file 'src/main.cpp' ---- old/src/main.cpp 2012-03-08 12:37:21 +0000 -+++ new/src/main.cpp 2012-06-20 15:32:11 +0000 -@@ -172,14 +172,6 @@ - screen->priv->setDirtyPluginList (); - screen->priv->updatePlugins (); - -- if (debugOutput) -- { -- StackDebugger::SetDefault (new StackDebugger (screen->dpy (), -- screen->root (), -- boost::bind (&PrivateScreen::queueEvents, -- screen->priv.get()))); -- } -- - if (!disableSm) - { - if (clientId == NULL) - -=== modified file 'src/privatescreen.h' ---- old/src/privatescreen.h 2012-04-04 03:11:55 +0000 -+++ new/src/privatescreen.h 2012-06-20 15:32:11 +0000 -@@ -788,6 +788,23 @@ - - }} // namespace compiz::private_screen - -+class FetchXEventInterface -+{ -+ public: -+ -+ virtual ~FetchXEventInterface () {} -+ -+ virtual bool getNextXEvent (XEvent &) = 0; -+}; -+ -+class FetchEventInterface -+{ -+ public: -+ -+ virtual ~FetchEventInterface () {} -+ virtual bool getNextEvent (XEvent &) = 0; -+}; -+ - class PrivateScreen : - public compiz::private_screen::EventManager, - public compiz::private_screen::WindowManager, -@@ -795,7 +812,9 @@ - public compiz::private_screen::History, - public compiz::private_screen::StartupSequence, - public compiz::private_screen::OrphanData, -- public compiz::private_screen::PseudoNamespace -+ public compiz::private_screen::PseudoNamespace, -+ public FetchXEventInterface, -+ public FetchEventInterface - { - - public: -@@ -804,7 +823,8 @@ - - bool setOption (const CompString &name, CompOption::Value &value); - -- std::list queueEvents (); -+ bool getNextEvent (XEvent &); -+ bool getNextXEvent (XEvent &); - void processEvents (); - - bool triggerButtonPressBindings (CompOption::Vector &options, - -=== modified file 'src/privatestackdebugger.h' ---- old/src/privatestackdebugger.h 2011-09-29 03:29:41 +0000 -+++ new/src/privatestackdebugger.h 2012-06-20 15:32:11 +0000 -@@ -27,20 +27,23 @@ - * so that this can be come a truly standalone - * object */ - #include -+#include - - #ifndef _COMPIZ_PRIVATESTACKDEBUGGER_H - #define _COMPIZ_PRIVATESTACKDEBUGGER_H - -+class FetchXEventInterface; -+ - class StackDebugger - { - public: - -- typedef std::list eventList; -+ typedef std::vector eventList; - -- StackDebugger (Display *, Window, boost::function evProc); -+ StackDebugger (Display *, Window, FetchXEventInterface *fetchXEvent); - ~StackDebugger (); - -- eventList loadStack (CompWindowList &serverWindows, bool wait = false); -+ void loadStack (CompWindowList &serverWindows, bool wait = false); - void windowsChanged (bool change) { mWindowsChanged = change; }; - void serverWindowsChanged (bool change) { mServerWindowsChanged = change; }; - bool windowsChanged () { return mWindowsChanged; } -@@ -54,6 +57,7 @@ - CompWindowList &serverWindows, - bool verbose = false); - bool timedOut (); -+ bool getNextEvent (XEvent &); - - bool checkSanity (CompWindowList &serverWindows, bool verbose = false); - -@@ -70,9 +74,10 @@ - bool mServerWindowsChanged; - Window mRoot; - Display *mDpy; -- boost::function getEventsProc; -+ FetchXEventInterface *mFetchXEvent; - bool mTimeoutRequired; - CompWindowList mLastServerWindows; -+ std::list mEvents; - }; - - #endif - -=== modified file 'src/screen.cpp' ---- old/src/screen.cpp 2012-03-30 06:26:33 +0000 -+++ new/src/screen.cpp 2012-06-20 15:32:11 +0000 -@@ -742,41 +742,48 @@ - return rv; - } - --std::list --PrivateScreen::queueEvents () -+bool -+PrivateScreen::getNextXEvent (XEvent &ev) - { -- std::list events; -+ if (!XEventsQueued (dpy, QueuedAlready)) -+ return false; -+ XNextEvent (dpy, &ev); - -- while (XPending (dpy)) -+ /* Skip to the last MotionNotify -+ * event in this sequence */ -+ if (ev.type == MotionNotify) - { -- XEvent event, peekEvent; -- XNextEvent (dpy, &event); -- -- /* Skip to the last MotionNotify -- * event in this sequence */ -- if (event.type == MotionNotify) -+ XEvent peekEvent; -+ while (XPending (dpy)) - { -- while (XPending (dpy)) -- { -- XPeekEvent (dpy, &peekEvent); -- -- if (peekEvent.type != MotionNotify) -- break; -- -- XNextEvent (dpy, &event); -- } -+ XPeekEvent (dpy, &peekEvent); -+ -+ if (peekEvent.type != MotionNotify) -+ break; -+ -+ XNextEvent (dpy, &peekEvent); - } -- -- events.push_back (event); -- } -- -- return events; -+ } -+ -+ return true; -+} -+ -+bool -+PrivateScreen::getNextEvent (XEvent &ev) -+{ -+ StackDebugger *dbg = StackDebugger::Default (); -+ -+ if (StackDebugger::Default ()) -+ { -+ return dbg->getNextEvent (ev); -+ } -+ else -+ return getNextXEvent (ev); - } - - void - PrivateScreen::processEvents () - { -- std::list events; - StackDebugger *dbg = StackDebugger::Default (); - - if (isDirtyPluginList ()) -@@ -801,14 +808,14 @@ - { - dbg->windowsChanged (false); - dbg->serverWindowsChanged (false); -- events = dbg->loadStack (serverWindows); -+ dbg->loadStack (serverWindows); - } -- else -- events = queueEvents (); - - stackIsFresh = false; - -- foreach (XEvent &event, events) -+ XEvent event; -+ -+ while (getNextEvent (event)) - { - switch (event.type) { - case ButtonPress: - -=== modified file 'src/stackdebugger.cpp' ---- old/src/stackdebugger.cpp 2011-10-07 11:45:38 +0000 -+++ new/src/stackdebugger.cpp 2012-06-20 15:32:11 +0000 -@@ -24,6 +24,7 @@ - */ - - #include "privatestackdebugger.h" -+#include "privatescreen.h" - #include "privatewindow.h" - #include - -@@ -47,14 +48,14 @@ - gStackDebugger = dbg; - } - --StackDebugger::StackDebugger (Display *dpy, Window root, boost::function evProc) : -+StackDebugger::StackDebugger (Display *dpy, Window root, FetchXEventInterface *fetchXEvent) : - mServerNChildren (0), - mServerChildren (NULL), - mWindowsChanged (false), - mServerWindowsChanged (false), - mRoot (root), - mDpy (dpy), -- getEventsProc (evProc) -+ mFetchXEvent (fetchXEvent) - { - } - -@@ -118,11 +119,23 @@ - mLastServerWindows.push_front (tl); - } - --StackDebugger::eventList -+bool -+StackDebugger::getNextEvent (XEvent &ev) -+{ -+ if (mEvents.empty ()) -+ return false; -+ -+ ev = mEvents.front (); -+ -+ mEvents.pop_front (); -+ -+ return true; -+} -+ -+void - StackDebugger::loadStack (CompWindowList &serverWindows, bool wait) - { - Window rootRet, parentRet; -- eventList events; - - if (mServerChildren) - XFree (mServerChildren); -@@ -132,7 +145,16 @@ - XQueryTree (mDpy, mRoot, &rootRet, &parentRet, - &mServerChildren, &mServerNChildren); - -- events = getEventsProc (); -+ unsigned int n = XEventsQueued (mDpy, QueuedAfterFlush); -+ mEvents.clear (); -+ mEvents.resize (n); -+ std::list ::iterator it = mEvents.begin (); -+ -+ while (it != mEvents.end ()) -+ { -+ mFetchXEvent->getNextXEvent ((*it)); -+ it++; -+ } - - XSync (mDpy, FALSE); - -@@ -145,7 +167,6 @@ - - if (mServerNChildren != serverWindows.size () && wait) - { -- eventList moreEvents; - struct pollfd pfd; - - pfd.events = POLLIN; -@@ -154,10 +175,10 @@ - - poll (&pfd, 1, 300); - -- moreEvents = getEventsProc (); -+ XEvent e; - -- foreach (XEvent e, moreEvents) -- events.push_back (e); -+ while (mFetchXEvent->getNextXEvent (e)) -+ mEvents.push_back (e); - - mTimeoutRequired = true; - } -@@ -166,8 +187,6 @@ - - XUngrabServer (mDpy); - XSync (mDpy, FALSE); -- -- return events; - } - - void - diff -Nru compiz-0.9.7.8/debian/patches/fix_1007754.patch compiz-0.9.7.8/debian/patches/fix_1007754.patch --- compiz-0.9.7.8/debian/patches/fix_1007754.patch 2012-06-25 11:17:26.000000000 +0000 +++ compiz-0.9.7.8/debian/patches/fix_1007754.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,27 +0,0 @@ -=== modified file 'gtk/window-decorator/wnck.c' ---- old/gtk/window-decorator/wnck.c 2012-06-15 16:41:34 +0000 -+++ new/gtk/window-decorator/wnck.c 2012-06-20 12:50:52 +0000 -@@ -419,12 +419,16 @@ - GINT_TO_POINTER (frame), - GINT_TO_POINTER (xid)); - } -- update_window_decoration_state (win); -- update_window_decoration_actions (win); -- update_window_decoration_icon (win); -- request_update_window_decoration_size (win); -- -- update_event_windows (win); -+ -+ if (d->decorated) -+ { -+ update_window_decoration_state (win); -+ update_window_decoration_actions (win); -+ update_window_decoration_icon (win); -+ request_update_window_decoration_size (win); -+ -+ update_event_windows (win); -+ } - } - else - { - diff -Nru compiz-0.9.7.8/debian/patches/fix_1009338.patch compiz-0.9.7.8/debian/patches/fix_1009338.patch --- compiz-0.9.7.8/debian/patches/fix_1009338.patch 2012-06-25 11:17:26.000000000 +0000 +++ compiz-0.9.7.8/debian/patches/fix_1009338.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,46 +0,0 @@ -=== modified file 'plugins/composite/composite.xml.in' ---- old/plugins/composite/composite.xml.in 2012-02-08 10:54:35 +0000 -+++ new/plugins/composite/composite.xml.in 2012-06-20 12:57:14 +0000 -@@ -16,7 +16,7 @@ - - -=== modified file 'plugins/composite/src/screen.cpp' ---- old/plugins/composite/src/screen.cpp 2012-03-27 12:14:56 +0000 -+++ new/plugins/composite/src/screen.cpp 2012-06-20 12:57:14 +0000 -@@ -45,6 +45,8 @@ - - #include - -+static const int FALLBACK_REFRESH_RATE = 60; /* if all else fails */ -+ - CompWindow *lastDamagedWindow = 0; - - void -@@ -274,8 +276,8 @@ - exposeRects (), - windowPaintOffset (0, 0), - overlayWindowCount (0), -- redrawTime (1000 / 50), -- optimalRedrawTime (1000 / 50), -+ redrawTime (1000 / FALLBACK_REFRESH_RATE), -+ optimalRedrawTime (1000 / FALLBACK_REFRESH_RATE), - scheduled (false), - painting (false), - reschedule (false), -@@ -651,7 +653,7 @@ - } - - if (value.i () == 0) -- value.set ((int) 50); -+ value.set ((int) FALLBACK_REFRESH_RATE); - - mOptions[CompositeOptions::DetectRefreshRate].value ().set (false); - screen->setOptionForPlugin ("composite", "refresh_rate", value); - diff -Nru compiz-0.9.7.8/debian/patches/fix_929989.patch compiz-0.9.7.8/debian/patches/fix_929989.patch --- compiz-0.9.7.8/debian/patches/fix_929989.patch 2012-06-25 11:17:26.000000000 +0000 +++ compiz-0.9.7.8/debian/patches/fix_929989.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,1475 +0,0 @@ -=== modified file 'gtk/window-decorator/decorator.c' ---- old/gtk/window-decorator/decorator.c 2012-03-30 07:01:48 +0000 -+++ new/gtk/window-decorator/decorator.c 2012-06-15 16:41:34 +0000 -@@ -564,6 +564,52 @@ - } - } - -+/* -+ * request_update_window_decoration_size -+ * Description: asks the rendering process to allow a size update -+ * for pixmap synchronization */ -+ -+ -+gboolean -+request_update_window_decoration_size (WnckWindow *win) -+{ -+ decor_t *d; -+ gint width, height; -+ gint x, y, w, h, name_width; -+ -+ if (win == NULL) -+ return FALSE; -+ -+ d = g_object_get_data (G_OBJECT (win), "decor"); -+ -+ if (!d->decorated) -+ return FALSE; -+ -+ /* Get the geometry of the window, we'll need it later */ -+ wnck_window_get_client_window_geometry (win, &x, &y, &w, &h); -+ -+ /* Get the width of the name */ -+ name_width = max_window_name_width (win); -+ -+ /* Ask the theme to tell us how much space it needs. If this is not successful -+ * update the decoration name and return false */ -+ if (!(*theme_calc_decoration_size) (d, w, h, name_width, &width, &height)) -+ { -+ update_window_decoration_name (win); -+ return FALSE; -+ } -+ -+ d->width = width; -+ d->height = height; -+ -+ decor_post_pending (gdk_x11_display_get_xdisplay (gdk_display_get_default ()), -+ wnck_window_get_xid (win), -+ populate_frame_type (d), -+ populate_frame_state (d), -+ populate_frame_actions (d)); -+ -+ return TRUE; -+} - - /* - * update_window_decoration_size -@@ -581,8 +627,6 @@ - decor_t *d; - GdkPixmap *pixmap, *buffer_pixmap = NULL; - Picture picture; -- gint width, height; -- gint x, y, w, h, name_width; - Display *xdisplay; - XRenderPictFormat *format; - -@@ -591,30 +635,19 @@ - - d = g_object_get_data (G_OBJECT (win), "decor"); - -+ if (!d->decorated) -+ return FALSE; -+ - xdisplay = GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()); - -- /* Get the geometry of the window, we'll need it later */ -- wnck_window_get_client_window_geometry (win, &x, &y, &w, &h); -- -- /* Get the width of the name */ -- name_width = max_window_name_width (win); -- -- /* Ask the theme to tell us how much space it needs. If this is not successful -- * update the decoration name and return false */ -- if (!(*theme_calc_decoration_size) (d, w, h, name_width, &width, &height)) -- { -- update_window_decoration_name (win); -- return FALSE; -- } -- - gdk_error_trap_push (); - - /* Get the correct depth for the frame window in reparenting mode, otherwise - * enforce 32 */ - if (d->frame_window) -- pixmap = create_pixmap (width, height, d->frame->style_window_rgb); -+ pixmap = create_pixmap (d->width, d->height, d->frame->style_window_rgb); - else -- pixmap = create_pixmap (width, height, d->frame->style_window_rgba); -+ pixmap = create_pixmap (d->width, d->height, d->frame->style_window_rgba); - - gdk_flush (); - -@@ -628,9 +661,9 @@ - gdk_error_trap_push (); - - if (d->frame_window) -- buffer_pixmap = create_pixmap (width, height, d->frame->style_window_rgb); -+ buffer_pixmap = create_pixmap (d->width, d->height, d->frame->style_window_rgb); - else -- buffer_pixmap = create_pixmap (width, height, d->frame->style_window_rgba); -+ buffer_pixmap = create_pixmap (d->width, d->height, d->frame->style_window_rgba); - - gdk_flush (); - -@@ -649,7 +682,7 @@ - - /* Destroy the old pixmaps and pictures */ - if (d->pixmap) -- g_object_unref (G_OBJECT (d->pixmap)); -+ g_hash_table_insert (destroyed_pixmaps_table, GINT_TO_POINTER (GDK_PIXMAP_XID (d->pixmap)), d->pixmap); - - if (d->buffer_pixmap) - g_object_unref (G_OBJECT (d->buffer_pixmap)); -@@ -667,9 +700,6 @@ - - d->picture = picture; - -- d->width = width; -- d->height = height; -- - d->prop_xid = wnck_window_get_xid (win); - - update_window_decoration_name (win); -@@ -1205,7 +1235,7 @@ - d->context = NULL; - d->width = d->height = 0; - -- update_window_decoration_size (win); -+ request_update_window_decoration_size (win); - update_event_windows (win); - } - } - -=== modified file 'gtk/window-decorator/events.c' ---- old/gtk/window-decorator/events.c 2012-03-30 07:01:48 +0000 -+++ new/gtk/window-decorator/events.c 2012-06-15 16:41:34 +0000 -@@ -1014,7 +1014,7 @@ - update_window_decoration_state (win); - update_window_decoration_actions (win); - update_window_decoration_icon (win); -- update_window_decoration_size (win); -+ request_update_window_decoration_size (win); - update_event_windows (win); - } - else -@@ -1069,6 +1069,17 @@ - } - } - } -+ else if (xevent->xclient.message_type == decor_request_atom) -+ { -+ WnckWindow *win = wnck_window_get (xevent->xclient.window); -+ -+ if (win) -+ update_window_decoration_size (win); -+ } -+ else if (xevent->xclient.message_type == decor_delete_pixmap_atom) -+ { -+ g_hash_table_remove (destroyed_pixmaps_table, GINT_TO_POINTER (xevent->xclient.data.l[0])); -+ } - default: - break; - } - -=== modified file 'gtk/window-decorator/gtk-window-decorator.c' ---- old/gtk/window-decorator/gtk-window-decorator.c 2012-03-30 07:01:48 +0000 -+++ new/gtk/window-decorator/gtk-window-decorator.c 2012-06-15 16:41:34 +0000 -@@ -48,6 +48,9 @@ - Atom toolkit_action_atom; - Atom toolkit_action_window_menu_atom; - Atom toolkit_action_force_quit_dialog_atom; -+Atom decor_request_atom; -+Atom decor_pending_atom; -+Atom decor_delete_pixmap_atom; - - Atom net_wm_state_atom; - Atom net_wm_state_modal_atom; -@@ -103,6 +106,7 @@ - GtkWidget *switcher_label; - - GHashTable *frame_table; -+GHashTable *destroyed_pixmaps_table; - GtkWidget *action_menu = NULL; - gboolean action_menu_mapped = FALSE; - decor_color_t _title_color[2]; -@@ -305,6 +309,10 @@ - net_wm_state_atom = XInternAtom (xdisplay,"_NET_WM_STATE", 0); - net_wm_state_modal_atom = XInternAtom (xdisplay, "_NET_WM_STATE_MODAL", 0); - -+ decor_request_atom = XInternAtom (xdisplay, "_COMPIZ_DECOR_REQUEST", 0); -+ decor_pending_atom = XInternAtom (xdisplay, "_COMPIZ_DECOR_PENDING", 0); -+ decor_delete_pixmap_atom = XInternAtom (xdisplay, "_COMPIZ_DECOR_DELETE_PIXMAP", 0); -+ - status = decor_acquire_dm_session (xdisplay, - gdk_screen_get_number (gdkscreen), - "gwd", replace, &dm_sn_timestamp); -@@ -390,6 +398,7 @@ - xformat_rgb = XRenderFindStandardFormat (xdisplay, PictStandardRGB24); - - frame_table = g_hash_table_new (NULL, NULL); -+ destroyed_pixmaps_table = g_hash_table_new_full (NULL, NULL, NULL, g_object_unref); - - if (!create_tooltip_window ()) - { - -=== modified file 'gtk/window-decorator/gtk-window-decorator.h' ---- old/gtk/window-decorator/gtk-window-decorator.h 2012-03-30 07:01:48 +0000 -+++ new/gtk/window-decorator/gtk-window-decorator.h 2012-06-15 16:41:34 +0000 -@@ -306,6 +306,9 @@ - extern Atom toolkit_action_force_quit_dialog_atom; - extern Atom net_wm_state_atom; - extern Atom net_wm_state_modal_atom; -+extern Atom decor_request_atom; -+extern Atom decor_pending_atom; -+extern Atom decor_delete_pixmap_atom; - - extern Time dm_sn_timestamp; - -@@ -511,6 +514,7 @@ - - /* list of all decorations */ - extern GHashTable *frame_table; -+extern GHashTable *destroyed_pixmaps_table; - - /* action menu */ - extern GtkWidget *action_menu; -@@ -628,9 +632,13 @@ - void - destroy_bare_frame (); - -+/* Don't use directly */ - gboolean - update_window_decoration_size (WnckWindow *win); - -+gboolean -+request_update_window_decoration_size (WnckWindow *win); -+ - void - update_window_decoration_name (WnckWindow *win); - - -=== modified file 'gtk/window-decorator/wnck.c' ---- old/gtk/window-decorator/wnck.c 2012-03-30 07:01:48 +0000 -+++ new/gtk/window-decorator/wnck.c 2012-06-15 16:41:34 +0000 -@@ -80,7 +80,7 @@ - - if (d->decorated) - { -- if (!update_window_decoration_size (win)) -+ if (!request_update_window_decoration_size (win)) - queue_decor_draw (d); - } - } -@@ -102,7 +102,7 @@ - d->client_width = width; - d->client_height = height; - -- update_window_decoration_size (win); -+ request_update_window_decoration_size (win); - update_event_windows (win); - } - } -@@ -128,7 +128,7 @@ - if (d->decorated) - { - update_window_decoration_state (win); -- if (!update_window_decoration_size (win)) -+ if (!request_update_window_decoration_size (win)) - queue_decor_draw (d); - - update_event_windows (win); -@@ -143,7 +143,7 @@ - if (d->decorated) - { - update_window_decoration_actions (win); -- if (!update_window_decoration_size (win)) -+ if (!request_update_window_decoration_size (win)) - queue_decor_draw (d); - - update_event_windows (win); -@@ -422,7 +422,7 @@ - update_window_decoration_state (win); - update_window_decoration_actions (win); - update_window_decoration_icon (win); -- update_window_decoration_size (win); -+ request_update_window_decoration_size (win); - - update_event_windows (win); - } -@@ -585,7 +585,7 @@ - if (win) - { - d = g_object_get_data (G_OBJECT (win), "decor"); -- if (d && d->pixmap) -+ if (d) - { - d->active = wnck_window_is_active (win); - -@@ -642,8 +642,9 @@ - * then we need to redraw the decoration anyways - * since the image would have changed */ - if (d->win != NULL && -- !update_window_decoration_size (d->win) && -- d->decorated) -+ !request_update_window_decoration_size (d->win) && -+ d->decorated && -+ d->pixmap) - queue_decor_draw (d); - - } -@@ -653,7 +654,7 @@ - if (win) - { - d = g_object_get_data (G_OBJECT (win), "decor"); -- if (d && d->pixmap) -+ if (d) - { - d->active = wnck_window_is_active (win); - -@@ -710,8 +711,9 @@ - * then we need to redraw the decoration anyways - * since the image would have changed */ - if (d->win != NULL && -- !update_window_decoration_size (d->win) && -- d->decorated) -+ !request_update_window_decoration_size (d->win) && -+ d->decorated && -+ d->pixmap) - queue_decor_draw (d); - - } - -=== modified file 'include/decoration.h' ---- old/include/decoration.h 2012-02-09 07:48:57 +0000 -+++ new/include/decoration.h 2012-06-15 16:41:34 +0000 -@@ -492,6 +492,24 @@ - XEvent *event, - Time dm_sn_timestamp); - -+int -+decor_post_pending (Display *xdisplay, -+ Window client, -+ unsigned int frame_state, -+ unsigned int frame_type, -+ unsigned int frame_actions); -+ -+int -+decor_post_delete_pixmap (Display *xdisplay, -+ Pixmap pixmap); -+ -+int -+decor_post_generate_request (Display *xdisplay, -+ Window client, -+ unsigned int frame_type, -+ unsigned int frame_state, -+ unsigned int frame_actions); -+ - #ifdef __cplusplus - } - #endif - -=== modified file 'libdecoration/decoration.c' ---- old/libdecoration/decoration.c 2012-02-27 06:43:04 +0000 -+++ new/libdecoration/decoration.c 2012-06-15 16:41:34 +0000 -@@ -2877,6 +2877,92 @@ - } - - int -+decor_post_pending (Display *xdisplay, -+ Window client, -+ unsigned int frame_state, -+ unsigned int frame_type, -+ unsigned int frame_actions) -+{ -+ XEvent event; -+ -+ Atom decor_pending = XInternAtom (xdisplay, "_COMPIZ_DECOR_PENDING", FALSE); -+ -+ /* Send a client message indicating that a new -+ * decoration can be generated for this window -+ */ -+ event.xclient.type = ClientMessage; -+ event.xclient.window = client; -+ event.xclient.message_type = decor_pending; -+ event.xclient.format = 32; -+ event.xclient.data.l[0] = frame_type; -+ event.xclient.data.l[1] = frame_state; -+ event.xclient.data.l[2] = frame_actions; -+ event.xclient.data.l[3] = 0; -+ event.xclient.data.l[4] = 0; -+ -+ XSendEvent (xdisplay, DefaultRootWindow (xdisplay), 0, -+ StructureNotifyMask, &event); -+ -+ return 1; -+} -+ -+int -+decor_post_generate_request (Display *xdisplay, -+ Window client, -+ unsigned int frame_type, -+ unsigned int frame_state, -+ unsigned int frame_actions) -+{ -+ XEvent event; -+ -+ Atom decor_request = XInternAtom (xdisplay, "_COMPIZ_DECOR_REQUEST", FALSE); -+ -+ /* Send a client message indicating that a new -+ * decoration can be generated for this window -+ */ -+ event.xclient.type = ClientMessage; -+ event.xclient.window = client; -+ event.xclient.message_type = decor_request; -+ event.xclient.format = 32; -+ event.xclient.data.l[0] = frame_type; -+ event.xclient.data.l[1] = frame_state; -+ event.xclient.data.l[2] = frame_actions; -+ event.xclient.data.l[3] = 0; -+ event.xclient.data.l[4] = 0; -+ -+ XSendEvent (xdisplay, DefaultRootWindow (xdisplay), 0, -+ StructureNotifyMask, &event); -+ -+ return 1; -+} -+ -+int -+decor_post_delete_pixmap (Display *xdisplay, -+ Pixmap pixmap) -+{ -+ XEvent event; -+ -+ Atom decor_delete_pixmap = XInternAtom (xdisplay, "_COMPIZ_DECOR_DELETE_PIXMAP", FALSE); -+ -+ /* Send a client message indicating that a new -+ * decoration can be generated for this window -+ */ -+ event.xclient.type = ClientMessage; -+ event.xclient.window = DefaultRootWindow (xdisplay); -+ event.xclient.message_type = decor_delete_pixmap; -+ event.xclient.format = 32; -+ event.xclient.data.l[0] = pixmap; -+ event.xclient.data.l[1] = 0; -+ event.xclient.data.l[2] = 0; -+ event.xclient.data.l[3] = 0; -+ event.xclient.data.l[4] = 0; -+ -+ XSendEvent (xdisplay, DefaultRootWindow (xdisplay), 0, -+ StructureNotifyMask, &event); -+ -+ return 1; -+} -+int - decor_acquire_dm_session (Display *xdisplay, - int screen, - const char *name, - -=== modified file 'plugins/decor/CMakeLists.txt' ---- old/plugins/decor/CMakeLists.txt 2012-03-30 14:29:18 +0000 -+++ new/plugins/decor/CMakeLists.txt 2012-06-15 16:41:34 +0000 -@@ -4,10 +4,12 @@ - include (CompizCommon) - - include_directories (${CMAKE_CURRENT_SOURCE_DIR}/src/clip-groups/include/) -+include_directories (${CMAKE_CURRENT_SOURCE_DIR}/src/pixmap-requests/include/) - --compiz_plugin(decor PLUGINDEPS composite opengl LIBRARIES decoration compiz_decor_clip_groups) -+compiz_plugin(decor PLUGINDEPS composite opengl LIBRARIES decoration compiz_decor_clip_groups compiz_decor_pixmap_requests) - - add_subdirectory (src/clip-groups) -+add_subdirectory (src/pixmap-requests) - - if (COMPIZ_BUILD_WITH_RPATH AND NOT COMPIZ_DISABLE_PLUGIN_DECOR) - - -=== modified file 'plugins/decor/src/decor.cpp' ---- old/plugins/decor/src/decor.cpp 2012-04-23 05:50:23 +0000 -+++ new/plugins/decor/src/decor.cpp 2012-06-15 16:41:34 +0000 -@@ -303,7 +303,6 @@ - } - - static bool bindFailed; -- - /* - * DecorTexture::DecorTexture - * -@@ -314,7 +313,7 @@ - * for this pixmap - */ - --DecorTexture::DecorTexture (Pixmap pixmap) : -+DecorTexture::DecorTexture (DecorPixmapInterface::Ptr pixmap) : - status (true), - refCount (1), - pixmap (pixmap), -@@ -324,7 +323,7 @@ - Window root; - int i; - -- if (!XGetGeometry (screen->dpy (), pixmap, &root, -+ if (!XGetGeometry (screen->dpy (), pixmap->getPixmap (), &root, - &i, &i, &width, &height, &ui, &depth)) - { - status = false; -@@ -332,7 +331,7 @@ - } - - bindFailed = false; -- textures = GLTexture::bindPixmapToTexture (pixmap, width, height, depth); -+ textures = GLTexture::bindPixmapToTexture (pixmap->getPixmap (), width, height, depth); - if (textures.size () != 1) - { - bindFailed = true; -@@ -343,7 +342,7 @@ - if (!DecorScreen::get (screen)->optionGetMipmap ()) - textures[0]->setMipmap (false); - -- damage = XDamageCreate (screen->dpy (), pixmap, -+ damage = XDamageCreate (screen->dpy (), pixmap->getPixmap (), - XDamageReportRawRectangles); - } - -@@ -378,13 +377,16 @@ - return NULL; - - foreach (DecorTexture *t, textures) -- if (t->pixmap == pixmap) -+ if (t->pixmap->getPixmap () == pixmap) - { - t->refCount++; - return t; - } - -- DecorTexture *texture = new DecorTexture (pixmap); -+ X11PixmapDeletor::Ptr dl = boost::make_shared (screen->dpy ()); -+ DecorPixmap::Ptr pm = boost::make_shared (pixmap, dl); -+ -+ DecorTexture *texture = new DecorTexture (boost::shared_static_cast (pm)); - - if (!texture->status) - { -@@ -520,7 +522,8 @@ - long *prop, - unsigned int size, - unsigned int type, -- unsigned int nOffset) -+ unsigned int nOffset, -+ DecorPixmapRequestorInterface *requestor) - { - unsigned int frameType, frameState, frameActions; - Pixmap pixmap = None; -@@ -568,7 +571,7 @@ - throw std::exception (); - } - -- return Decoration::Ptr (new Decoration (type, border, input, maxBorder, maxInput, frameType, frameState, frameActions, minWidth, minHeight, pixmap, quad, nQuad)); -+ return Decoration::Ptr (new Decoration (type, border, input, maxBorder, maxInput, frameType, frameState, frameActions, minWidth, minHeight, pixmap, quad, nQuad, id, requestor)); - } - - Decoration::Decoration (int type, -@@ -583,7 +586,9 @@ - unsigned int minHeight, - Pixmap pixmap, - const boost::shared_array &quad, -- unsigned int nQuad) : -+ unsigned int nQuad, -+ Window owner, -+ DecorPixmapRequestorInterface *requestor) : - texture (DecorScreen::get (screen)->getTexture (pixmap)), - border (border.left, border.right, border.top, border.bottom), - input (input.left, input.right, input.top, input.bottom), -@@ -596,7 +601,9 @@ - frameActions (frameActions), - quad (quad), - nQuad (nQuad), -- type (type) -+ type (type), -+ updateState (0), -+ mPixmapReceiver (requestor, this) - { - int left, right, top, bottom; - int x1, y1, x2, y2; -@@ -657,6 +664,30 @@ - DecorScreen::get (screen)->releaseTexture (texture); - } - -+DecorPixmapReceiverInterface & -+Decoration::receiverInterface () -+{ -+ return mPixmapReceiver; -+} -+ -+unsigned int -+Decoration::getFrameType () const -+{ -+ return frameType; -+} -+ -+unsigned int -+Decoration::getFrameState () const -+{ -+ return frameState; -+} -+ -+unsigned int -+Decoration::getFrameActions () const -+{ -+ return frameActions; -+} -+ - /* - * DecorationList is a class which allows multiple decorations - * to be stored in a list and read from a window property, which -@@ -692,7 +723,8 @@ - - bool - DecorationList::updateDecoration (Window id, -- Atom decorAtom) -+ Atom decorAtom, -+ DecorPixmapRequestorInterface *requestor) - { - unsigned long n, nleft; - unsigned char *data; -@@ -701,6 +733,12 @@ - int result, format; - unsigned int type; - -+ /* Dispatch any new updates */ -+ foreach (const Decoration::Ptr &d, mList) -+ { -+ d->mPixmapReceiver.update (); -+ } -+ - result = XGetWindowProperty (screen->dpy (), id, - decorAtom, 0L, - PROP_HEADER_SIZE + 6 * (BASE_PROP_SIZE + -@@ -770,7 +808,9 @@ - maxBorder.top = d->maxBorder.top; - maxBorder.bottom = d->maxBorder.bottom; - -- int num = decor_match_pixmap (prop, n, &d->texture->pixmap, &input, &border, &maxInput, &maxBorder, -+ Pixmap pm = d->texture->pixmap->getPixmap (); -+ -+ int num = decor_match_pixmap (prop, n, &pm, &input, &border, &maxInput, &maxBorder, - d->minWidth, d->minHeight, d->frameType, d->frameState, d->frameActions, - d->quad.get (), d->nQuad); - if (num != -1) -@@ -788,7 +828,7 @@ - try - { - std::list ::iterator it = mList.begin (); -- Decoration::Ptr d = Decoration::create (id, prop, n, type, i); -+ Decoration::Ptr d = Decoration::create (id, prop, n, type, i, requestor); - - /* Try to replace an existing decoration */ - for (; it != mList.end (); it++) -@@ -873,7 +913,7 @@ - { - bindFailed = false; - -- decor.updateDecoration (window->id (), dScreen->winDecorAtom); -+ decor.updateDecoration (window->id (), dScreen->winDecorAtom, &mRequestor); - if (bindFailed) - pixmapFailed = true; - else -@@ -1230,6 +1270,22 @@ - return (decorActions == 0); - } - -+DecorationInterface::Ptr -+DecorationList::findMatchingDecoration (unsigned int frameType, -+ unsigned int frameState, -+ unsigned int frameActions) -+{ -+ foreach (const Decoration::Ptr &d, mList) -+ { -+ if (d->frameType == frameType && -+ d->frameState == frameState && -+ d->frameActions == frameActions) -+ return boost::shared_static_cast (d); -+ } -+ -+ return DecorationInterface::Ptr (); -+} -+ - /* - * DecorationList::findMatchingDecoration - * -@@ -2053,7 +2109,7 @@ - { - for (i = 0; i < DECOR_NUM; i++) - { -- decor[i].updateDecoration (screen->root (), decorAtom[i]); -+ decor[i].updateDecoration (screen->root (), decorAtom[i], &mRequestor); - } - } - else -@@ -2261,6 +2317,7 @@ - isSwitcher = false; - } - -+ - /* - * DecorScreen::handleEvent - * -@@ -2295,6 +2352,18 @@ - if (w) - DecorWindow::get (w)->update (true); - } -+ /* A decoration is pending creation, allow it to be created */ -+ if (event->xclient.message_type == decorPendingAtom) -+ { -+ CompWindow *w = screen->findWindow (event->xclient.window); -+ -+ if (w) -+ { -+ DecorWindow *dw = DecorWindow::get (w); -+ -+ dw->mRequestor.handlePending (event->xclient.data.l); -+ } -+ } - default: - /* Check for damage events. If the output or input window - * or a texture is updated then damage output extents. -@@ -2309,7 +2378,7 @@ - - foreach (DecorTexture *t, textures) - { -- if (t->pixmap == de->drawable) -+ if (t->pixmap->getPixmap () == de->drawable) - { - foreach (CompWindow *w, screen->windows ()) - { -@@ -2368,7 +2437,6 @@ - { - DECOR_WINDOW (w); - dw->updateDecoration (); -- - dw->update (true); - } - } -@@ -2401,7 +2469,8 @@ - if (event->xproperty.atom == decorAtom[i]) - { - decor[i].updateDecoration (screen->root (), -- decorAtom[i]); -+ decorAtom[i], -+ &mRequestor); - - foreach (CompWindow *w, screen->windows ()) - DecorWindow::get (w)->update (true); -@@ -2935,8 +3004,11 @@ - 0, - None, - boost::shared_array (NULL), -- 0)), -- mMenusClipGroup (CompMatch ("type=Dock | type=DropdownMenu | type=PopupMenu")) -+ 0, -+ screen->root (), -+ NULL)), -+ mMenusClipGroup (CompMatch ("type=Dock | type=DropdownMenu | type=PopupMenu")), -+ mRequestor (screen->dpy (), screen->root (), &(decor[DECOR_ACTIVE])) - { - supportingDmCheckAtom = - XInternAtom (s->dpy (), DECOR_SUPPORTING_DM_CHECK_ATOM_NAME, 0); -@@ -2958,6 +3030,10 @@ - XInternAtom (s->dpy (), DECOR_TYPE_WINDOW_ATOM_NAME, 0); - decorSwitchWindowAtom = - XInternAtom (s->dpy (), DECOR_SWITCH_WINDOW_ATOM_NAME, 0); -+ decorPendingAtom = -+ XInternAtom (s->dpy (), "_COMPIZ_DECOR_PENDING", 0); -+ decorRequestAtom = -+ XInternAtom (s->dpy (), "_COMPIZ_DECOR_REQUEST", 0); - requestFrameExtentsAtom = - XInternAtom (s->dpy (), "_NET_REQUEST_FRAME_EXTENTS", 0); - shadowColorAtom = -@@ -3013,7 +3089,8 @@ - frameExtentsRequested (false), - mClipGroup (NULL), - mOutputRegion (window->outputRect ()), -- mInputRegion (window->inputRect ()) -+ mInputRegion (window->inputRect ()), -+ mRequestor (screen->dpy (), w->id (), &decor) - { - WindowInterface::setHandler (window); - - -=== modified file 'plugins/decor/src/decor.h' ---- old/plugins/decor/src/decor.h 2012-04-23 05:50:23 +0000 -+++ new/plugins/decor/src/decor.h 2012-06-15 16:41:34 +0000 -@@ -25,6 +25,7 @@ - - #include - #include -+#include - #include - #include - -@@ -34,6 +35,7 @@ - #include - - #include -+#include - - #include "decor_options.h" - -@@ -76,30 +78,36 @@ - class DecorTexture { - - public: -- DecorTexture (Pixmap pixmap); -+ DecorTexture (DecorPixmapInterface::Ptr pixmap); - ~DecorTexture (); - - public: - bool status; - int refCount; -- Pixmap pixmap; -+ DecorPixmapInterface::Ptr pixmap; - Damage damage; - GLTexture::List textures; - }; - - class DecorWindow; - --class Decoration { -+class Decoration : -+ public DecorationInterface -+{ - - public: - - typedef boost::shared_ptr Ptr; - -+ static const unsigned int UpdateRequested = 1 << 0; -+ static const unsigned int UpdatesPending = 1 << 1; -+ - static Decoration::Ptr create (Window id, - long *prop, - unsigned int size, - unsigned int type, -- unsigned int nOffset); -+ unsigned int nOffset, -+ DecorPixmapRequestorInterface *requestor); - - Decoration (int type, - const decor_extents_t &border, -@@ -113,10 +121,18 @@ - unsigned int minHeight, - Pixmap pixmap, - const boost::shared_array &quad, -- unsigned int nQuad); -+ unsigned int nQuad, -+ Window owner, -+ DecorPixmapRequestorInterface *); - - ~Decoration (); - -+ DecorPixmapReceiverInterface & receiverInterface (); -+ -+ unsigned int getFrameType () const; -+ unsigned int getFrameState () const; -+ unsigned int getFrameActions () const; -+ - public: - int refCount; - DecorTexture *texture; -@@ -133,12 +149,19 @@ - boost::shared_array quad; - int nQuad; - int type; -+ -+ unsigned int updateState; -+ X11DecorPixmapReceiver mPixmapReceiver; - }; - --class DecorationList -+class DecorationList : -+ public DecorationListFindMatchingInterface - { - public: -- bool updateDecoration (Window id, Atom decorAtom); -+ bool updateDecoration (Window id, Atom decorAtom, DecorPixmapRequestorInterface *requestor); -+ DecorationInterface::Ptr findMatchingDecoration(unsigned int frameType, -+ unsigned int frameState, -+ unsigned int frameActions); - const Decoration::Ptr & findMatchingDecoration (CompWindow *w, bool sizeCheck); - void clear () - { -@@ -215,6 +238,8 @@ - Atom shadowColorAtom; - Atom shadowInfoAtom; - Atom decorSwitchWindowAtom; -+ Atom decorPendingAtom; -+ Atom decorRequestAtom; - - Window dmWin; - int dmSupports; -@@ -229,6 +254,7 @@ - CompTimer decoratorStart; - - MatchedDecorClipGroup mMenusClipGroup; -+ X11DecorPixmapRequestor mRequestor; - }; - - class DecorWindow : -@@ -335,6 +361,8 @@ - DecorClipGroupInterface *mClipGroup; - CompRegion mOutputRegion; - CompRegion mInputRegion; -+ -+ X11DecorPixmapRequestor mRequestor; - }; - - class DecorPluginVTable : - -=== added directory 'plugins/decor/src/pixmap-requests' -=== added file 'plugins/decor/src/pixmap-requests/CMakeLists.txt' ---- old/plugins/decor/src/pixmap-requests/CMakeLists.txt 1970-01-01 00:00:00 +0000 -+++ new/plugins/decor/src/pixmap-requests/CMakeLists.txt 2012-06-15 16:41:34 +0000 -@@ -0,0 +1,62 @@ -+pkg_check_modules ( -+ GLIBMM -+ REQUIRED -+ glibmm-2.4 glib-2.0 -+) -+ -+INCLUDE_DIRECTORIES ( -+ ${CMAKE_CURRENT_SOURCE_DIR}/include -+ ${CMAKE_CURRENT_SOURCE_DIR}/src -+ -+ ${compiz_SOURCE_DIR}/src/point/include -+ ${compiz_SOURCE_DIR}/src/rect/include -+ ${compiz_SOURCE_DIR}/src/window/geometry/include -+ ${compiz_SOURCE_DIR}/src/window/geometry-saver/include -+ ${compiz_SOURCE_DIR}/src/window/extents/include -+ ${compiz_SOURCE_DIR}/include -+ -+ ${Boost_INCLUDE_DIRS} -+ -+ ${GLIBMM_INCLUDE_DIRS} -+) -+ -+LINK_DIRECTORIES (${GLIBMM_LIBRARY_DIRS}) -+ -+SET ( -+ PUBLIC_HEADERS -+) -+ -+SET ( -+ PRIVATE_HEADERS -+ ${CMAKE_CURRENT_SOURCE_DIR}/include/pixmap-requests.h -+) -+ -+SET( -+ SRCS -+ ${CMAKE_CURRENT_SOURCE_DIR}/src/pixmap-requests.cpp -+) -+ -+ADD_LIBRARY( -+ compiz_decor_pixmap_requests STATIC -+ -+ ${SRCS} -+ -+ ${PUBLIC_HEADERS} -+ ${PRIVATE_HEADERS} -+) -+ -+if (COMPIZ_BUILD_TESTING) -+ADD_SUBDIRECTORY( ${CMAKE_CURRENT_SOURCE_DIR}/tests ) -+endif (COMPIZ_BUILD_TESTING) -+ -+SET_TARGET_PROPERTIES( -+ compiz_decor_pixmap_requests PROPERTIES -+ PUBLIC_HEADER "${PUBLIC_HEADERS}" -+) -+ -+TARGET_LINK_LIBRARIES( -+ compiz_decor_pixmap_requests -+ -+ compiz_core -+ ${GLIBMM_LIBRARIES} -+) - -=== added directory 'plugins/decor/src/pixmap-requests/include' -=== added file 'plugins/decor/src/pixmap-requests/include/pixmap-requests.h' ---- old/plugins/decor/src/pixmap-requests/include/pixmap-requests.h 1970-01-01 00:00:00 +0000 -+++ new/plugins/decor/src/pixmap-requests/include/pixmap-requests.h 2012-06-15 16:41:34 +0000 -@@ -0,0 +1,188 @@ -+/* -+ * Copyright © 2005 Novell, Inc. -+ * -+ * Permission to use, copy, modify, distribute, and sell this software -+ * and its documentation for any purpose is hereby granted without -+ * fee, provided that the above copyright notice appear in all copies -+ * and that both that copyright notice and this permission notice -+ * appear in supporting documentation, and that the name of -+ * Novell, Inc. not be used in advertising or publicity pertaining to -+ * distribution of the software without specific, written prior permission. -+ * Novell, Inc. makes no representations about the suitability of this -+ * software for any purpose. It is provided "as is" without express or -+ * implied warranty. -+ * -+ * NOVELL, INC. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, -+ * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN -+ * NO EVENT SHALL NOVELL, INC. BE LIABLE FOR ANY SPECIAL, INDIRECT OR -+ * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS -+ * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, -+ * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION -+ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -+ * -+ * Author: David Reveman -+ */ -+ -+#ifndef _COMPIZ_DECOR_PIXMAP_REQUESTS_H -+#define _COMPIZ_DECOR_PIXMAP_REQUESTS_H -+ -+#include -+#include -+#include -+#include -+ -+#include -+ -+class DecorPixmapInterface -+{ -+ public: -+ -+ typedef boost::shared_ptr Ptr; -+ -+ virtual ~DecorPixmapInterface () {}; -+ -+ virtual Pixmap getPixmap () = 0; -+}; -+ -+class DecorPixmapReceiverInterface -+{ -+ public: -+ -+ virtual ~DecorPixmapReceiverInterface () {} -+ -+ virtual void pending () = 0; -+ virtual void update () = 0; -+}; -+ -+/* So far, nothing particularly interesting here -+ * we just need a way to pass around pointers for -+ * testing */ -+class DecorationInterface -+{ -+ public: -+ -+ typedef boost::shared_ptr Ptr; -+ -+ virtual ~DecorationInterface () {} -+ -+ virtual DecorPixmapReceiverInterface & receiverInterface () = 0; -+ virtual unsigned int getFrameType () const = 0; -+ virtual unsigned int getFrameState () const = 0; -+ virtual unsigned int getFrameActions () const = 0; -+}; -+ -+class DecorPixmapDeletionInterface -+{ -+ public: -+ -+ typedef boost::shared_ptr Ptr; -+ -+ virtual ~DecorPixmapDeletionInterface () {} -+ -+ virtual int postDeletePixmap (Pixmap pixmap) = 0; -+}; -+ -+class X11PixmapDeletor : -+ public DecorPixmapDeletionInterface -+{ -+ public: -+ -+ typedef boost::shared_ptr Ptr; -+ -+ X11PixmapDeletor (Display *dpy) : -+ mDisplay (dpy) -+ { -+ } -+ -+ int postDeletePixmap (Pixmap pixmap) { return decor_post_delete_pixmap (mDisplay, pixmap); } -+ -+ private: -+ -+ Display *mDisplay; -+}; -+ -+class DecorPixmap : -+ public DecorPixmapInterface -+{ -+ public: -+ -+ typedef boost::shared_ptr Ptr; -+ -+ DecorPixmap (Pixmap p, DecorPixmapDeletionInterface::Ptr deletor); -+ ~DecorPixmap (); -+ -+ Pixmap getPixmap (); -+ -+ private: -+ -+ Pixmap mPixmap; -+ DecorPixmapDeletionInterface::Ptr mDeletor; -+}; -+ -+class DecorPixmapRequestorInterface -+{ -+ public: -+ -+ virtual ~DecorPixmapRequestorInterface () {} -+ -+ virtual int postGenerateRequest (unsigned int frameType, -+ unsigned int frameState, -+ unsigned int frameActions) = 0; -+ -+ virtual void handlePending (long *data) = 0; -+}; -+ -+class DecorationListFindMatchingInterface -+{ -+ public: -+ -+ virtual ~DecorationListFindMatchingInterface () {} -+ -+ virtual DecorationInterface::Ptr findMatchingDecoration (unsigned int frameType, -+ unsigned int frameState, -+ unsigned int frameActions) = 0; -+}; -+ -+class X11DecorPixmapRequestor : -+ public DecorPixmapRequestorInterface -+{ -+ public: -+ -+ X11DecorPixmapRequestor (Display *dpy, -+ Window xid, -+ DecorationListFindMatchingInterface *listFinder); -+ -+ int postGenerateRequest (unsigned int frameType, -+ unsigned int frameState, -+ unsigned int frameActions); -+ -+ void handlePending (long *data); -+ -+ private: -+ -+ Display *mDpy; -+ Window mWindow; -+ DecorationListFindMatchingInterface *mListFinder; -+}; -+ -+class X11DecorPixmapReceiver : -+ public DecorPixmapReceiverInterface -+{ -+ public: -+ -+ static const unsigned int UpdateRequested = 1 << 0; -+ static const unsigned int UpdatesPending = 1 << 1; -+ -+ X11DecorPixmapReceiver (DecorPixmapRequestorInterface *, -+ DecorationInterface *decor); -+ -+ void pending (); -+ void update (); -+ private: -+ -+ unsigned int mUpdateState; -+ DecorPixmapRequestorInterface *mDecorPixmapRequestor; -+ DecorationInterface *mDecoration; -+}; -+ -+#endif - -=== added directory 'plugins/decor/src/pixmap-requests/src' -=== added file 'plugins/decor/src/pixmap-requests/src/pixmap-requests.cpp' ---- old/plugins/decor/src/pixmap-requests/src/pixmap-requests.cpp 1970-01-01 00:00:00 +0000 -+++ new/plugins/decor/src/pixmap-requests/src/pixmap-requests.cpp 2012-06-15 16:41:34 +0000 -@@ -0,0 +1,93 @@ -+#include "pixmap-requests.h" -+#include -+#include -+ -+#ifndef foreach -+#define foreach BOOST_FOREACH -+#endif -+ -+DecorPixmap::DecorPixmap (Pixmap pixmap, DecorPixmapDeletionInterface::Ptr d) : -+ mPixmap (pixmap), -+ mDeletor (d) -+{ -+} -+ -+DecorPixmap::~DecorPixmap () -+{ -+ mDeletor->postDeletePixmap (mPixmap); -+} -+ -+Pixmap -+DecorPixmap::getPixmap () -+{ -+ return mPixmap; -+} -+ -+X11DecorPixmapReceiver::X11DecorPixmapReceiver (DecorPixmapRequestorInterface *requestor, -+ DecorationInterface *decor) : -+ mUpdateState (0), -+ mDecorPixmapRequestor (requestor), -+ mDecoration (decor) -+{ -+} -+ -+void -+X11DecorPixmapReceiver::pending () -+{ -+ if (mUpdateState & X11DecorPixmapReceiver::UpdateRequested) -+ mUpdateState |= X11DecorPixmapReceiver::UpdatesPending; -+ else -+ { -+ mUpdateState |= X11DecorPixmapReceiver::UpdateRequested; -+ -+ mDecorPixmapRequestor->postGenerateRequest (mDecoration->getFrameType (), -+ mDecoration->getFrameState (), -+ mDecoration->getFrameActions ()); -+ } -+} -+ -+void X11DecorPixmapReceiver::update () -+{ -+ if (mUpdateState & X11DecorPixmapReceiver::UpdatesPending) -+ mDecorPixmapRequestor->postGenerateRequest (mDecoration->getFrameType (), -+ mDecoration->getFrameState (), -+ mDecoration->getFrameActions ()); -+ -+ mUpdateState = 0; -+} -+ -+X11DecorPixmapRequestor::X11DecorPixmapRequestor (Display *dpy, -+ Window window, -+ DecorationListFindMatchingInterface *listFinder) : -+ mDpy (dpy), -+ mWindow (window), -+ mListFinder (listFinder) -+{ -+} -+ -+int -+X11DecorPixmapRequestor::postGenerateRequest (unsigned int frameType, -+ unsigned int frameState, -+ unsigned int frameActions) -+{ -+ return decor_post_generate_request (mDpy, -+ mWindow, -+ frameType, -+ frameState, -+ frameActions); -+} -+ -+void -+X11DecorPixmapRequestor::handlePending (long *data) -+{ -+ DecorationInterface::Ptr d = mListFinder->findMatchingDecoration (static_cast (data[0]), -+ static_cast (data[1]), -+ static_cast (data[2])); -+ -+ if (d) -+ d->receiverInterface ().pending (); -+ else -+ postGenerateRequest (static_cast (data[0]), -+ static_cast (data[1]), -+ static_cast (data[2])); -+} - -=== added directory 'plugins/decor/src/pixmap-requests/tests' -=== added file 'plugins/decor/src/pixmap-requests/tests/CMakeLists.txt' ---- old/plugins/decor/src/pixmap-requests/tests/CMakeLists.txt 1970-01-01 00:00:00 +0000 -+++ new/plugins/decor/src/pixmap-requests/tests/CMakeLists.txt 2012-06-15 16:41:34 +0000 -@@ -0,0 +1,15 @@ -+include_directories(${CMAKE_CURRENT_SOURCE_DIR}) -+ -+add_executable (compiz_test_decor_pixmap_requests -+ ${CMAKE_CURRENT_SOURCE_DIR}/pixmap-requests/src/test-decor-pixmap-requests.cpp) -+ -+target_link_libraries (compiz_test_decor_pixmap_requests -+ compiz_decor_pixmap_requests -+ decoration -+ ${GTEST_BOTH_LIBRARIES} -+ ${GMOCK_LIBRARY} -+ ${GMOCK_MAIN_LIBRARY} -+ ${CMAKE_THREAD_LIBS_INIT} # Link in pthread. -+ ) -+ -+gtest_add_tests (compiz_test_decor_pixmap_requests "" ${CMAKE_CURRENT_SOURCE_DIR}/pixmap-requests/src/test-decor-pixmap-requests.cpp) - -=== added directory 'plugins/decor/src/pixmap-requests/tests/pixmap-requests' -=== added directory 'plugins/decor/src/pixmap-requests/tests/pixmap-requests/src' -=== added file 'plugins/decor/src/pixmap-requests/tests/pixmap-requests/src/test-decor-pixmap-requests.cpp' ---- old/plugins/decor/src/pixmap-requests/tests/pixmap-requests/src/test-decor-pixmap-requests.cpp 1970-01-01 00:00:00 +0000 -+++ new/plugins/decor/src/pixmap-requests/tests/pixmap-requests/src/test-decor-pixmap-requests.cpp 2012-06-15 16:41:34 +0000 -@@ -0,0 +1,160 @@ -+/* -+ * Copyright © 2012 Canonical Ltd. -+ * -+ * Permission to use, copy, modify, distribute, and sell this software -+ * and its documentation for any purpose is hereby granted without -+ * fee, provided that the above copyright notice appear in all copies -+ * and that both that copyright notice and this permission notice -+ * appear in supporting documentation, and that the name of -+ * Canonical Ltd. not be used in advertising or publicity pertaining to -+ * distribution of the software without specific, written prior permission. -+ * Canonical Ltd. makes no representations about the suitability of this -+ * software for any purpose. It is provided "as is" without express or -+ * implied warranty. -+ * -+ * CANONICAL, LTD. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, -+ * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN -+ * NO EVENT SHALL CANONICAL, LTD. BE LIABLE FOR ANY SPECIAL, INDIRECT OR -+ * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS -+ * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, -+ * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION -+ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -+ * -+ * Authored by: Sam Spilsbury -+ */ -+ -+#include -+#include -+#include -+#include "pixmap-requests.h" -+ -+using ::testing::Return; -+ -+class DecorPixmapRequestsTest : -+ public ::testing::Test -+{ -+}; -+ -+class MockDecorPixmapDeletor : -+ public DecorPixmapDeletionInterface -+{ -+ public: -+ -+ MOCK_METHOD1 (postDeletePixmap, int (Pixmap p)); -+}; -+ -+class MockDecorPixmapReceiver : -+ public DecorPixmapReceiverInterface -+{ -+ public: -+ -+ MOCK_METHOD0 (pending, void ()); -+ MOCK_METHOD0 (update, void ()); -+}; -+ -+class MockDecoration : -+ public DecorationInterface -+{ -+ public: -+ -+ MOCK_METHOD0 (receiverInterface, DecorPixmapReceiverInterface & ()); -+ MOCK_CONST_METHOD0 (getFrameType, unsigned int ()); -+ MOCK_CONST_METHOD0 (getFrameState, unsigned int ()); -+ MOCK_CONST_METHOD0 (getFrameActions, unsigned int ()); -+}; -+ -+class MockDecorationListFindMatching : -+ public DecorationListFindMatchingInterface -+{ -+ public: -+ -+ MOCK_METHOD3 (findMatchingDecoration, DecorationInterface::Ptr (unsigned int, unsigned int, unsigned int)); -+}; -+ -+class MockDecorPixmapRequestor : -+ public DecorPixmapRequestorInterface -+{ -+ public: -+ -+ MOCK_METHOD3 (postGenerateRequest, int (unsigned int, unsigned int, unsigned int)); -+ MOCK_METHOD1 (handlePending, void (long *)); -+}; -+ -+TEST(DecorPixmapRequestsTest, TestDestroyPixmapDeletes) -+{ -+ boost::shared_ptr mockDeletor = boost::make_shared (); -+ DecorPixmap pm (1, boost::shared_static_cast (mockDeletor)); -+ -+ EXPECT_CALL (*(mockDeletor.get ()), postDeletePixmap (1)).WillOnce (Return (1)); -+} -+ -+TEST(DecorPixmapRequestsTest, TestPendingGeneratesRequest) -+{ -+ MockDecorPixmapRequestor mockRequestor; -+ MockDecoration mockDecoration; -+ X11DecorPixmapReceiver receiver (&mockRequestor, &mockDecoration); -+ -+ EXPECT_CALL (mockDecoration, getFrameActions ()).WillOnce (Return (3)); -+ EXPECT_CALL (mockDecoration, getFrameState ()).WillOnce (Return (2)); -+ EXPECT_CALL (mockDecoration, getFrameType ()).WillOnce (Return (1)); -+ -+ EXPECT_CALL (mockRequestor, postGenerateRequest (1, 2, 3)); -+ -+ receiver.pending (); -+} -+ -+TEST(DecorPixmapRequestsTest, TestPendingGeneratesOnlyOneRequest) -+{ -+ MockDecorPixmapRequestor mockRequestor; -+ MockDecoration mockDecoration; -+ X11DecorPixmapReceiver receiver (&mockRequestor, &mockDecoration); -+ -+ EXPECT_CALL (mockDecoration, getFrameActions ()).WillOnce (Return (3)); -+ EXPECT_CALL (mockDecoration, getFrameState ()).WillOnce (Return (2)); -+ EXPECT_CALL (mockDecoration, getFrameType ()).WillOnce (Return (1)); -+ -+ EXPECT_CALL (mockRequestor, postGenerateRequest (1, 2, 3)); -+ -+ receiver.pending (); -+ receiver.pending (); -+} -+ -+TEST(DecorPixmapRequestsTest, TestUpdateGeneratesRequestIfNewOnePending) -+{ -+ MockDecorPixmapRequestor mockRequestor; -+ MockDecoration mockDecoration; -+ X11DecorPixmapReceiver receiver (&mockRequestor, &mockDecoration); -+ -+ EXPECT_CALL (mockDecoration, getFrameActions ()).WillOnce (Return (3)); -+ EXPECT_CALL (mockDecoration, getFrameState ()).WillOnce (Return (2)); -+ EXPECT_CALL (mockDecoration, getFrameType ()).WillOnce (Return (1)); -+ -+ EXPECT_CALL (mockRequestor, postGenerateRequest (1, 2, 3)); -+ -+ receiver.pending (); -+ receiver.pending (); -+ -+ EXPECT_CALL (mockDecoration, getFrameActions ()).WillOnce (Return (3)); -+ EXPECT_CALL (mockDecoration, getFrameState ()).WillOnce (Return (2)); -+ EXPECT_CALL (mockDecoration, getFrameType ()).WillOnce (Return (1)); -+ -+ EXPECT_CALL (mockRequestor, postGenerateRequest (1, 2, 3)); -+ -+ receiver.update (); -+} -+ -+TEST(DecorPixmapRequestsTest, TestUpdateGeneratesNoRequestIfNoNewOnePending) -+{ -+ MockDecorPixmapRequestor mockRequestor; -+ MockDecoration mockDecoration; -+ X11DecorPixmapReceiver receiver (&mockRequestor, &mockDecoration); -+ -+ EXPECT_CALL (mockDecoration, getFrameActions ()).WillOnce (Return (3)); -+ EXPECT_CALL (mockDecoration, getFrameState ()).WillOnce (Return (2)); -+ EXPECT_CALL (mockDecoration, getFrameType ()).WillOnce (Return (1)); -+ -+ EXPECT_CALL (mockRequestor, postGenerateRequest (1, 2, 3)); -+ -+ receiver.pending (); -+ receiver.update (); -+} - diff -Nru compiz-0.9.7.8/debian/patches/fix_963794.patch compiz-0.9.7.8/debian/patches/fix_963794.patch --- compiz-0.9.7.8/debian/patches/fix_963794.patch 2012-06-25 11:17:26.000000000 +0000 +++ compiz-0.9.7.8/debian/patches/fix_963794.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,16 +0,0 @@ -=== modified file 'gtk/window-decorator/events.c' ---- old/gtk/window-decorator/events.c 2012-06-15 16:41:34 +0000 -+++ new/gtk/window-decorator/events.c 2012-06-20 11:00:59 +0000 -@@ -998,7 +998,10 @@ - decor_t *d = g_object_get_data (G_OBJECT (win), "decor"); - gboolean decorated = FALSE; - -- if (get_mwm_prop (xid) & (MWM_DECOR_ALL | MWM_DECOR_TITLE)) -+ /* Only decorations that are actually bound to windows can be decorated -+ * ignore cases where a broken application which shouldn't be decorated -+ * sets the decoration hint */ -+ if (get_mwm_prop (xid) & (MWM_DECOR_ALL | MWM_DECOR_TITLE) && d->win) - decorated = TRUE; - - if (decorated != d->decorated) - diff -Nru compiz-0.9.7.8/debian/patches/fix_993608.patch compiz-0.9.7.8/debian/patches/fix_993608.patch --- compiz-0.9.7.8/debian/patches/fix_993608.patch 2012-06-25 11:17:26.000000000 +0000 +++ compiz-0.9.7.8/debian/patches/fix_993608.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,18 +0,0 @@ -=== modified file 'cmake/FindCompiz.cmake' ---- old/cmake/FindCompiz.cmake 2011-02-24 02:29:00 +0000 -+++ new/cmake/FindCompiz.cmake 2012-06-19 15:55:12 +0000 -@@ -74,6 +74,13 @@ - # look for compiz - pkg_check_modules (COMPIZ ${_req} "compiz${_comp_ver}") - -+ # COMPIZ_PREFIX is not set by default on all machines. The CMake docs -+ # seem to vagely suggest this is normal in some cases for -+ # pkg_check_modules. -+ if (NOT COMPIZ_PREFIX) -+ set (COMPIZ_PREFIX ${CMAKE_INSTALL_PREFIX}) -+ endif () -+ - # is the CompizDefaults module installed? - find_path(_compiz_def_macro CompizDefaults.cmake ${COMPIZ_PREFIX}/share/compiz/cmake) - - diff -Nru compiz-0.9.7.8/debian/patches/series compiz-0.9.7.8/debian/patches/series --- compiz-0.9.7.8/debian/patches/series 2012-06-25 11:17:26.000000000 +0000 +++ compiz-0.9.7.8/debian/patches/series 2012-04-27 06:30:08.000000000 +0000 @@ -1,10 +1,3 @@ ubuntu-config.patch ccp_plugin.patch workaround_broken_drivers.patch -fix_929989.patch -fix_993608.patch -fix_963794.patch -fix_1005569.patch -fix_1007754.patch -fix_1009338.patch -fix_1006335.patch