diff options
author | Erkin Bahceci <erkinbah@gmail.com> | 2008-04-07 11:02:12 -0500 |
---|---|---|
committer | Kristian Lyngstol <kristian@nihilus.(none)> | 2009-02-07 02:16:05 +0100 |
commit | 2d00dd0d241768e2b4bce3ef448411804a760ed5 (patch) | |
tree | ec1832301b7720f314e120ecdb45463150995db3 | |
parent | ce6cf1fb06525fe76b0bdba08e1548070f7b88b4 (diff) |
Avoid conflict with Animation by suppressing fading.
-rw-r--r-- | metadata/fade.xml.in | 6 | ||||
-rw-r--r-- | plugins/fade.c | 58 |
2 files changed, 49 insertions, 15 deletions
diff --git a/metadata/fade.xml.in b/metadata/fade.xml.in index 77f1e7ff..06b2d7d4 100644 --- a/metadata/fade.xml.in +++ b/metadata/fade.xml.in @@ -4,6 +4,12 @@ <_long>Fade in windows when mapped and fade out windows when unmapped</_long> <category>Effects</category> <deps> + <requirement> + <plugin>regex</plugin> + </requirement> + <relation type="after"> + <plugin>regex</plugin> + </relation> <relation type="before"> <plugin>cube</plugin> <plugin>scale</plugin> diff --git a/plugins/fade.c b/plugins/fade.c index ac90210e..0e998728 100644 --- a/plugins/fade.c +++ b/plugins/fade.c @@ -37,6 +37,8 @@ typedef struct _FadeDisplay { HandleEventProc handleEvent; MatchExpHandlerChangedProc matchExpHandlerChanged; int displayModals; + Bool suppressMinimizeOpenClose; + CompMatch alwaysFadeWindowMatch; } FadeDisplay; #define FADE_SCREEN_OPTION_FADE_MODE 0 @@ -463,6 +465,22 @@ fadeRemoveDisplayModal (CompDisplay *d, } } +/* Returns whether this window should be faded + * on open and close events. */ +static Bool +isFadeWinForOpenClose (CompWindow *w) +{ + FADE_DISPLAY (w->screen->display); + FADE_SCREEN (w->screen); + + if (fs->opt[FADE_SCREEN_OPTION_MINIMIZE_OPEN_CLOSE].value.b && + !fd->suppressMinimizeOpenClose) + { + return TRUE; + } + return matchEval (&fd->alwaysFadeWindowMatch, w); +} + static void fadeHandleEvent (CompDisplay *d, XEvent *event) @@ -478,10 +496,8 @@ fadeHandleEvent (CompDisplay *d, { FADE_SCREEN (w->screen); - if (!fs->opt[FADE_SCREEN_OPTION_MINIMIZE_OPEN_CLOSE].value.b) - break; - - if (w->texture->pixmap && matchEval (&fs->match, w)) + if (w->texture->pixmap && isFadeWinForOpenClose (w) && + matchEval (&fs->match, w)) { FADE_WINDOW (w); @@ -508,10 +524,10 @@ fadeHandleEvent (CompDisplay *d, fw->shaded = w->shaded; - if (!fs->opt[FADE_SCREEN_OPTION_MINIMIZE_OPEN_CLOSE].value.b) - break; - - if (!fw->shaded && w->texture->pixmap && matchEval (&fs->match, w)) + if (fs->opt[FADE_SCREEN_OPTION_MINIMIZE_OPEN_CLOSE].value.b && + !fd->suppressMinimizeOpenClose && + !fw->shaded && w->texture->pixmap && + matchEval (&fs->match, w)) { if (fw->opacity == 0xffff) fw->opacity = 0xfffe; @@ -531,13 +547,13 @@ fadeHandleEvent (CompDisplay *d, w = findWindowAtDisplay (d, event->xmap.window); if (w) { - FADE_SCREEN(w->screen); - - if (!fs->opt[FADE_SCREEN_OPTION_MINIMIZE_OPEN_CLOSE].value.b) - break; - - fadeWindowStop (w); + FADE_SCREEN (w->screen); + if (fs->opt[FADE_SCREEN_OPTION_MINIMIZE_OPEN_CLOSE].value.b && + !fd->suppressMinimizeOpenClose) + { + fadeWindowStop (w); + } if (w->state & CompWindowStateDisplayModalMask) fadeAddDisplayModal (d, w); } @@ -660,7 +676,7 @@ fadeDamageWindowRect (CompWindow *w, } else if (matchEval (&fs->match, w)) { - if (fs->opt[FADE_SCREEN_OPTION_MINIMIZE_OPEN_CLOSE].value.b) + if (isFadeWinForOpenClose (w)) { fw->opacity = 0; fw->targetOpacity = 0; @@ -747,6 +763,16 @@ fadeInitDisplay (CompPlugin *p, fd->displayModals = 0; + fd->suppressMinimizeOpenClose = (findActivePlugin ("animation") != NULL); + + /* Always fade opening and closing of screen-dimming layer of + logout window and gksu. */ + matchInit (&fd->alwaysFadeWindowMatch); + matchAddExp (&fd->alwaysFadeWindowMatch, 0, "title=gksu"); + matchAddExp (&fd->alwaysFadeWindowMatch, 0, "title=x-session-manager"); + matchAddExp (&fd->alwaysFadeWindowMatch, 0, "title=gnome-session"); + matchUpdate (d, &fd->alwaysFadeWindowMatch); + WRAP (fd, d, handleEvent, fadeHandleEvent); WRAP (fd, d, matchExpHandlerChanged, fadeMatchExpHandlerChanged); @@ -763,6 +789,8 @@ fadeFiniDisplay (CompPlugin *p, freeScreenPrivateIndex (d, fd->screenPrivateIndex); + matchFini (&fd->alwaysFadeWindowMatch); + UNWRAP (fd, d, handleEvent); UNWRAP (fd, d, matchExpHandlerChanged); |