diff options
author | Sam Spilsbury <sam.spilsbury@canonical.com> | 2010-12-04 21:43:30 +0800 |
---|---|---|
committer | Sam Spilsbury <sam.spilsbury@canonical.com> | 2010-12-04 21:43:30 +0800 |
commit | 7672888c79f96e416a52e6787486cf6d555fcb02 (patch) | |
tree | 5a5d83a865442fd8063b76c066d26c3676f86eff /plugins | |
parent | 2d4b54b3b6dcf69ddfe5f0158173bbe63fd87480 (diff) | |
download | compiz-with-glib-mainloop-7672888c79f96e416a52e6787486cf6d555fcb02.tar.gz compiz-with-glib-mainloop-7672888c79f96e416a52e6787486cf6d555fcb02.tar.bz2 |
Fix windows consistently moving by gravity * window decoration extents.
The behaviour from 0.8 was ported to update decoration windows on the window destructor, but because we are moving windows on a timer in order to handle reparenting issues when decorating them, this also causes the time to be destroyed when the CompWindow is, so the windows never actually get moved back into place correctly.
FIXME: Timers should have a referencing system, it does not make sense that we have to preserve their scope
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/decor/src/decor.cpp | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/plugins/decor/src/decor.cpp b/plugins/decor/src/decor.cpp index 60a8810..511d99b 100644 --- a/plugins/decor/src/decor.cpp +++ b/plugins/decor/src/decor.cpp @@ -805,7 +805,21 @@ DecorWindow::update (bool allowDecoration) window->saveWc ().y += moveDy; if (mask) - moveUpdate.start (boost::bind (decorOffsetMove, window, xwc, mask), 0); + { + /* allowDecoration is only false in the case of + * the destructor calling the update function so since it + * is not safe to put the function in a timer (since + * it will get unref'd on the vtable destruction) we + * need to do it immediately + * + * FIXME: CompTimer should really be PIMPL and allow + * refcounting in case we need to keep it alive + */ + if (!allowDecoration) + decorOffsetMove (window, xwc, mask); + else + moveUpdate.start (boost::bind (decorOffsetMove, window, xwc, mask), 0); + } } return true; |