1
diff --git a/metadata/fade.xml.in b/metadata/fade.xml.in
2
index cfe0661..2f18e30 100644
3
--- a/metadata/fade.xml.in
4
+++ b/metadata/fade.xml.in
6
<_short>Fading Windows</_short>
7
<_long>Fade in windows when mapped and fade out windows when unmapped</_long>
10
+ <plugin>regex</plugin>
12
+ <relation type="after">
13
+ <plugin>regex</plugin>
15
<relation type="before">
17
<plugin>scale</plugin>
18
diff --git a/plugins/fade.c b/plugins/fade.c
19
index 7412e57..23ff18a 100644
22
@@ -37,6 +37,8 @@ typedef struct _FadeDisplay {
23
HandleEventProc handleEvent;
24
MatchExpHandlerChangedProc matchExpHandlerChanged;
26
+ Bool suppressMinimizeOpenClose;
27
+ CompMatch alwaysFadeWindowMatch;
30
#define FADE_SCREEN_OPTION_FADE_SPEED 0
31
@@ -394,6 +396,22 @@ fadeRemoveDisplayModal (CompDisplay *d,
35
+/* Returns whether this window should be faded
36
+ * on open and close events. */
38
+isFadeWinForOpenClose (CompWindow *w)
40
+ FADE_DISPLAY (w->screen->display);
41
+ FADE_SCREEN (w->screen);
43
+ if (fs->opt[FADE_SCREEN_OPTION_MINIMIZE_OPEN_CLOSE].value.b &&
44
+ !fd->suppressMinimizeOpenClose)
48
+ return matchEval (&fd->alwaysFadeWindowMatch, w);
52
fadeHandleEvent (CompDisplay *d,
54
@@ -409,10 +427,8 @@ fadeHandleEvent (CompDisplay *d,
56
FADE_SCREEN (w->screen);
58
- if (!fs->opt[FADE_SCREEN_OPTION_MINIMIZE_OPEN_CLOSE].value.b)
61
- if (w->texture->pixmap && matchEval (&fs->match, w))
62
+ if (w->texture->pixmap && isFadeWinForOpenClose (w) &&
63
+ matchEval (&fs->match, w))
67
@@ -439,10 +455,10 @@ fadeHandleEvent (CompDisplay *d,
69
fw->shaded = w->shaded;
71
- if (!fs->opt[FADE_SCREEN_OPTION_MINIMIZE_OPEN_CLOSE].value.b)
74
- if (!fw->shaded && w->texture->pixmap && matchEval (&fs->match, w))
75
+ if (fs->opt[FADE_SCREEN_OPTION_MINIMIZE_OPEN_CLOSE].value.b &&
76
+ !fd->suppressMinimizeOpenClose &&
77
+ !fw->shaded && w->texture->pixmap &&
78
+ matchEval (&fs->match, w))
80
if (fw->opacity == 0xffff)
82
@@ -462,13 +478,13 @@ fadeHandleEvent (CompDisplay *d,
83
w = findWindowAtDisplay (d, event->xmap.window);
86
- FADE_SCREEN(w->screen);
88
- if (!fs->opt[FADE_SCREEN_OPTION_MINIMIZE_OPEN_CLOSE].value.b)
92
+ FADE_SCREEN (w->screen);
94
+ if (fs->opt[FADE_SCREEN_OPTION_MINIMIZE_OPEN_CLOSE].value.b &&
95
+ !fd->suppressMinimizeOpenClose)
99
if (w->state & CompWindowStateDisplayModalMask)
100
fadeAddDisplayModal (d, w);
102
@@ -575,7 +591,7 @@ fadeDamageWindowRect (CompWindow *w,
104
else if (matchEval (&fs->match, w))
106
- if (fs->opt[FADE_SCREEN_OPTION_MINIMIZE_OPEN_CLOSE].value.b)
107
+ if (isFadeWinForOpenClose (w))
111
@@ -661,6 +677,16 @@ fadeInitDisplay (CompPlugin *p,
113
fd->displayModals = 0;
115
+ fd->suppressMinimizeOpenClose = (findActivePlugin ("animation") != NULL);
117
+ /* Always fade opening and closing of screen-dimming layer of
118
+ logout window and gksu. */
119
+ matchInit (&fd->alwaysFadeWindowMatch);
120
+ matchAddExp (&fd->alwaysFadeWindowMatch, 0, "title=gksu");
121
+ matchAddExp (&fd->alwaysFadeWindowMatch, 0, "title=x-session-manager");
122
+ matchAddExp (&fd->alwaysFadeWindowMatch, 0, "title=gnome-session");
123
+ matchUpdate (d, &fd->alwaysFadeWindowMatch);
125
WRAP (fd, d, handleEvent, fadeHandleEvent);
126
WRAP (fd, d, matchExpHandlerChanged, fadeMatchExpHandlerChanged);
128
@@ -677,6 +703,8 @@ fadeFiniDisplay (CompPlugin *p,
130
freeScreenPrivateIndex (d, fd->screenPrivateIndex);
132
+ matchFini (&fd->alwaysFadeWindowMatch);
134
UNWRAP (fd, d, handleEvent);
135
UNWRAP (fd, d, matchExpHandlerChanged);