summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSam Spilsbury <smspillaz@gmail.com>2010-08-17 23:25:39 +0800
committerSam Spilsbury <smspillaz@gmail.com>2010-08-17 23:25:39 +0800
commite74f916ae74f8a5a27942cc3f622eab4de037670 (patch)
treef65d6f83cda356c6e3cf8041837ea36ebb134760
parenta29441f8c4ccb3f1ecf56dfdc7ae185bd72f126d (diff)
downloadworkarounds-e74f916ae74f8a5a27942cc3f622eab4de037670.tar.gz
workarounds-e74f916ae74f8a5a27942cc3f622eab4de037670.tar.bz2
Enter correct notifications and also don't paint with NO_CORE_INSTANCE_MASK if animations are active
-rw-r--r--src/workarounds.cpp51
-rw-r--r--src/workarounds.h6
2 files changed, 56 insertions, 1 deletions
diff --git a/src/workarounds.cpp b/src/workarounds.cpp
index 7965c60..78a4316 100644
--- a/src/workarounds.cpp
+++ b/src/workarounds.cpp
@@ -185,7 +185,10 @@ WorkaroundsWindow::minimize ()
CompOption::Vector propTemplate = ws->inputDisabledAtom.getReadTemplate ();
CompOption::Value enabled = CompOption::Value (true);
+ screen->handleCompizEventSetEnabled (ws, true);
+
window->windowNotify (CompWindowNotifyMinimize);
+ window->changeState (window->state () | CompWindowStateHiddenMask);
foreach (CompWindow *w, screen->windows ())
{
@@ -194,6 +197,8 @@ WorkaroundsWindow::minimize ()
w->unminimize ();
}
+ window->windowNotify (CompWindowNotifyHide);
+
setVisibility (false);
/* HACK ATTACK */
@@ -229,9 +234,12 @@ WorkaroundsWindow::unminimize ()
CompOption::Value enabled = CompOption::Value (false);
window->windowNotify (CompWindowNotifyUnminimize);
+ window->changeState (window->state () & ~CompWindowStateHiddenMask);
isMinimized = false;
+ window->windowNotify (CompWindowNotifyShow);
+
setVisibility (true);
foreach (CompWindow *w, screen->windows ())
@@ -270,7 +278,20 @@ WorkaroundsWindow::glPaint (const GLWindowPaintAttrib &attrib,
unsigned int mask)
{
if (isMinimized)
- mask |= PAINT_WINDOW_NO_CORE_INSTANCE_MASK;
+ {
+ WORKAROUNDS_SCREEN (screen);
+ bool doMask = true;
+
+ foreach (CompWindow *w, ws->minimizingWindows)
+ {
+ if (w->id () == window->id ())
+ doMask = false;
+ break;
+ }
+
+ if (doMask)
+ mask |= PAINT_WINDOW_NO_CORE_INSTANCE_MASK;
+ }
return gWindow->glPaint (attrib, transform, region, mask);
}
@@ -843,6 +864,34 @@ WorkaroundsScreen::optionChanged (CompOption *opt,
}
void
+WorkaroundsScreen::handleCompizEvent (const char *pluginName,
+ const char *eventName,
+ CompOption::Vector &o)
+{
+ if (strncmp (pluginName, "animation", 9) == 0 &&
+ strncmp (eventName, "window_activate", 15) == 0)
+ {
+ if (CompOption::getStringOptionNamed (o, "type", "") == "minimize")
+ {
+ CompWindow *w = screen->findWindow (CompOption::getIntOptionNamed (
+ o, "window", 0));
+ if (w)
+ {
+ if (CompOption::getBoolOptionNamed (o, "active", false))
+ minimizingWindows.push_back (w);
+ else
+ minimizingWindows.remove (w);
+ }
+ }
+ }
+
+ if (!CompOption::getBoolOptionNamed (o, "active", false))
+ screen->handleCompizEventSetEnabled (this, false);
+
+ screen->handleCompizEvent (pluginName, eventName, o);
+}
+
+void
WorkaroundsScreen::handleEvent (XEvent *event)
{
CompWindow *w;
diff --git a/src/workarounds.h b/src/workarounds.h
index c110a59..678b8c9 100644
--- a/src/workarounds.h
+++ b/src/workarounds.h
@@ -60,6 +60,7 @@ class WorkaroundsScreen :
Atom roleAtom;
std::list <Window> mfwList;
+ CompWindowList minimizingWindows;
PropertyWriter inputDisabledAtom;
@@ -83,6 +84,11 @@ class WorkaroundsScreen :
const CompRegion &,
CompOutput *,
unsigned int );
+
+ void
+ handleCompizEvent (const char *pluginName,
+ const char *eventName,
+ CompOption::Vector &o);
void
addToFullscreenList (CompWindow *w);