swc

Unnamed repository; edit this file 'description' to name the repository.
git clone git://git.nihaljere.xyz/swc
Log | Files | Refs | README | LICENSE

commit 13e401d19ea75e3a205b55f3ffe656479d86a816
parent 4f398154ca87053c6cb7531f64cdd64bea67cac4
Author: Michael Forney <mforney@mforney.org>
Date:   Sun,  6 Sep 2015 18:54:27 -0700

Add {,de}activate manager callbacks

Diffstat:
Mlibswc/swc.c | 4++++
Mlibswc/swc.h | 10++++++++++
2 files changed, 14 insertions(+), 0 deletions(-)

diff --git a/libswc/swc.c b/libswc/swc.c @@ -97,6 +97,8 @@ swc_activate(void) { swc.active = true; send_event(&swc.event_signal, SWC_EVENT_ACTIVATED, NULL); + if (swc.manager->activate) + swc.manager->activate(); } void @@ -104,6 +106,8 @@ swc_deactivate(void) { swc.active = false; send_event(&swc.event_signal, SWC_EVENT_DEACTIVATED, NULL); + if (swc.manager->deactivate) + swc.manager->deactivate(); } EXPORT bool diff --git a/libswc/swc.h b/libswc/swc.h @@ -301,6 +301,16 @@ struct swc_manager { * Called when a new window is created. */ void (*new_window)(struct swc_window *window); + + /** + * Called when the session gets activated (for example, startup or VT switch). + */ + void (*activate)(); + + /** + * Called when the session gets deactivated. + */ + void (*deactivate)(); }; /**