summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSam Spilsbury <smspillaz@gmail.com>2010-09-26 23:07:01 +0800
committerSam Spilsbury <smspillaz@gmail.com>2010-09-26 23:07:01 +0800
commit7e19a481a12d59ef81f73e659c3ed434876ecb9e (patch)
treef755cd0d1684709d062974d74f8fc1c440591c38
parent7f1e319b0e0246a3fdf5106ef93ef58b3fabb48d (diff)
parent0e2518440b1c299ac749c465552fac6ccc89c6f2 (diff)
downloadworkarounds-7e19a481a12d59ef81f73e659c3ed434876ecb9e.tar.gz
workarounds-7e19a481a12d59ef81f73e659c3ed434876ecb9e.tar.bz2
Merge branch 'master' of git+ssh://git.opencompositing.org/git/compiz/plugins/workarounds
-rw-r--r--src/workarounds.cpp84
-rw-r--r--src/workarounds.h6
-rw-r--r--workarounds.xml.in1
3 files changed, 75 insertions, 16 deletions
diff --git a/src/workarounds.cpp b/src/workarounds.cpp
index 94b07d4..7282c46 100644
--- a/src/workarounds.cpp
+++ b/src/workarounds.cpp
@@ -169,6 +169,7 @@ WorkaroundsWindow::isGroupTransient (Window clientLeader)
return false;
}
+
void
WorkaroundsWindow::minimize ()
@@ -176,7 +177,7 @@ WorkaroundsWindow::minimize ()
if (!window->managed ())
return;
- if (!window->minimized ())
+ if (!isMinimized)
{
WORKAROUNDS_SCREEN (screen);
@@ -185,7 +186,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 +198,8 @@ WorkaroundsWindow::minimize ()
w->unminimize ();
}
+ window->windowNotify (CompWindowNotifyHide);
+
setVisibility (false);
/* HACK ATTACK */
@@ -205,7 +211,6 @@ WorkaroundsWindow::minimize ()
Atoms::wmState, Atoms::wmState,
32, PropModeReplace, (unsigned char *) data, 2);
-
propTemplate.at (0).set (enabled);
ws->inputDisabledAtom.updateProperty (window->id (),
propTemplate,
@@ -218,7 +223,7 @@ WorkaroundsWindow::minimize ()
void
WorkaroundsWindow::unminimize ()
-{
+{
if (isMinimized)
{
WORKAROUNDS_SCREEN (screen);
@@ -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);
}
@@ -311,24 +332,27 @@ WorkaroundsScreen::checkFunctions (bool checkWindow, bool checkScreen)
screen->handleEventSetEnabled (this, false);
}
- if (optionGetLegacyFullscreen () && checkWindow)
+ if (checkWindow)
{
+ bool legacyFullscreen = optionGetLegacyFullscreen ();
+ bool keepMinimized = optionGetKeepMinimizedWindows ();
+
foreach (CompWindow *w, screen->windows ())
{
WORKAROUNDS_WINDOW (w);
- ww->window->getAllowedActionsSetEnabled (ww, true);
- ww->window->resizeNotifySetEnabled (ww, true);
- }
- }
- else if (checkWindow)
- {
- foreach (CompWindow *w, screen->windows ())
- {
- WORKAROUNDS_WINDOW (w);
+ bool m = ww->window->minimized ();
+
+ ww->window->getAllowedActionsSetEnabled (ww, legacyFullscreen);
+ ww->window->resizeNotifySetEnabled (ww, legacyFullscreen);
- ww->window->getAllowedActionsSetEnabled (ww, false);
- ww->window->resizeNotifySetEnabled (ww, false);
+ if (m)
+ ww->window->unminimize ();
+ ww->window->minimizeSetEnabled (ww, keepMinimized);
+ ww->window->unminimizeSetEnabled (ww, keepMinimized);
+ ww->window->minimizedSetEnabled (ww, keepMinimized);
+ if (m)
+ ww->window->minimize ();
}
}
}
@@ -843,6 +867,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_animation", 16) == 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);
diff --git a/workarounds.xml.in b/workarounds.xml.in
index a7ad260..b7bd2c6 100644
--- a/workarounds.xml.in
+++ b/workarounds.xml.in
@@ -10,6 +10,7 @@
<plugin>composite</plugin>
<plugin>opengl</plugin>
<plugin>decor</plugin>
+ <plugin>animation</plugin>
</relation>
<requirement>
<plugin>composite</plugin>