diff options
author | Danny Baumann <dannybaumann@web.de> | 2008-09-15 17:02:22 +0200 |
---|---|---|
committer | Danny Baumann <dannybaumann@web.de> | 2008-09-15 17:02:22 +0200 |
commit | 61b737fe7c2d1e7d2bb00e87835f03038d4ba497 (patch) | |
tree | 0b8ed5c02a62ac56514da9ef5d518ea41e69d1c6 /plugins | |
parent | 07bfd59f0ff0fe41e4da7b0e7ea6d92286b25b4a (diff) |
Use timer to start decorator.
When starting the decorator from initScreen, user changes to a default decorator command are not reflected correctly. When starting it _only_ from the option change notification, no decorator is started if the default is non-empty and the user never changed it.
Compromise is using a timer and hoping that the configuration plugin has initialized all options at next mainloop iteration time (which is the case for all known configuration plugins).
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/decoration.c | 27 |
1 files changed, 25 insertions, 2 deletions
diff --git a/plugins/decoration.c b/plugins/decoration.c index 920872be..003685f2 100644 --- a/plugins/decoration.c +++ b/plugins/decoration.c @@ -133,6 +133,8 @@ typedef struct _DecorScreen { WindowResizeNotifyProc windowResizeNotify; WindowStateChangeNotifyProc windowStateChangeNotify; + + CompTimeoutHandle decoratorStartHandle; } DecorScreen; typedef struct _DecorWindow { @@ -1123,6 +1125,22 @@ decorGetOutputExtentsForWindow (CompWindow *w, } } +static CompBool +decorStartDecorator (void *closure) +{ + CompScreen *s = (CompScreen *) closure; + + DECOR_DISPLAY (s->display); + DECOR_SCREEN (s); + + ds->decoratorStartHandle = 0; + + if (!ds->dmWin) + runCommand (s, dd->opt[DECOR_DISPLAY_OPTION_COMMAND].value.s); + + return FALSE; +} + static CompOption * decorGetDisplayOptions (CompPlugin *plugin, CompDisplay *display, @@ -1520,7 +1538,8 @@ decorInitScreen (CompPlugin *p, memset (ds->decor, 0, sizeof (ds->decor)); - ds->dmWin = None; + ds->dmWin = None; + ds->decoratorStartHandle = 0; WRAP (ds, s, drawWindow, decorDrawWindow); WRAP (ds, s, damageWindowRect, decorDamageWindowRect); @@ -1534,7 +1553,8 @@ decorInitScreen (CompPlugin *p, decorCheckForDmOnScreen (s, FALSE); if (!ds->dmWin) - runCommand (s, dd->opt[DECOR_DISPLAY_OPTION_COMMAND].value.s); + ds->decoratorStartHandle = compAddTimeout (0, -1, + decorStartDecorator, s); return TRUE; } @@ -1551,6 +1571,9 @@ decorFiniScreen (CompPlugin *p, if (ds->decor[i]) decorReleaseDecoration (s, ds->decor[i]); + if (ds->decoratorStartHandle) + compRemoveTimeout (ds->decoratorStartHandle); + freeWindowPrivateIndex (s, ds->windowPrivateIndex); UNWRAP (ds, s, drawWindow); |