summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorErkin Bahceci <erkinbah@gmail.com>2009-09-13 14:11:20 -0500
committerErkin Bahceci <erkinbah@gmail.com>2009-09-13 14:11:20 -0500
commit6008880ec65d4d8fdffab7e00c0d6c84db54237d (patch)
tree79aa841580108ec52613ee8920f2a80af947270d
parent5766519a880abc92170e4b5e4bdd62bba95bb6cb (diff)
downloadstackswitch-6008880ec65d4d8fdffab7e00c0d6c84db54237d.tar.gz
stackswitch-6008880ec65d4d8fdffab7e00c0d6c84db54237d.tar.bz2
Emit "activate" compiz event on starting/ending.
-rw-r--r--stackswitch.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/stackswitch.c b/stackswitch.c
index 497ae89..496a45d 100644
--- a/stackswitch.c
+++ b/stackswitch.c
@@ -124,6 +124,23 @@ typedef struct _StackswitchWindow {
#define STACKSWITCH_SCREEN(sc) PLUGIN_SCREEN(sc, Stackswitch, s)
#define STACKSWITCH_WINDOW(w) PLUGIN_WINDOW(w, Stackswitch, s)
+static void
+stackswitchActivateEvent (CompScreen *s,
+ Bool activating)
+{
+ CompOption o[2];
+
+ o[0].type = CompOptionTypeInt;
+ o[0].name = "root";
+ o[0].value.i = s->root;
+
+ o[1].type = CompOptionTypeBool;
+ o[1].name = "active";
+ o[1].value.b = activating;
+
+ (*s->display->handleCompizEvent) (s->display, "stackswitch", "activate", o, 2);
+}
+
static Bool
isStackswitchWin (CompWindow *w)
{
@@ -1156,7 +1173,10 @@ stackswitchDonePaintScreen (CompScreen *s)
damageScreen (s);
if (ss->state == StackswitchStateIn)
+ {
ss->state = StackswitchStateNone;
+ stackswitchActivateEvent (s, FALSE);
+ }
else if (ss->state == StackswitchStateOut)
ss->state = StackswitchStateSwitching;
}
@@ -1272,6 +1292,7 @@ stackswitchInitiate (CompScreen *s,
if (ss->grabIndex)
{
ss->state = StackswitchStateOut;
+ stackswitchActivateEvent (s, TRUE);
if (!stackswitchCreateWindowList (s))
return FALSE;