diff --git a/include/compiz-core.h b/include/compiz-core.h index 8aadf7b..d5fcbac 100644 --- a/include/compiz-core.h +++ b/include/compiz-core.h @@ -28,7 +28,7 @@ #include -#define CORE_ABIVERSION 20071103 +#define CORE_ABIVERSION 20080130 #include #include @@ -344,6 +344,24 @@ compObjectFind (CompObject *parent, else \ return (def) +/* session.c */ + +void +initSession (char *smPrevClientId); + +void +closeSession (void); + +typedef void (*SessionSaveYourselfProc) (int saveType, + int interactStyle, + Bool shutdown, + Bool fast); + +typedef void (*SessionDieProc) (void); + +typedef void (*SessionSaveCompleteProc) (void); + +typedef void (*SessionShutdownCancelledProc) (void); /* option.c */ @@ -647,6 +665,11 @@ struct _CompCore { FileWatchAddedProc fileWatchAdded; FileWatchRemovedProc fileWatchRemoved; + + SessionSaveYourselfProc sessionSaveYourself; + SessionDieProc sessionDie; + SessionSaveCompleteProc sessionSaveComplete; + SessionShutdownCancelledProc sessionShutdownCancelled; }; int @@ -3088,15 +3111,6 @@ getPluginDisplayIndex (CompDisplay *d, int *index); -/* session.c */ - -void -initSession (char *smPrevClientId); - -void -closeSession (void); - - /* fragment.c */ #define MAX_FRAGMENT_FUNCTIONS 16 diff --git a/src/session.c b/src/session.c index 0afa6b7..b8a39bd 100644 --- a/src/session.c +++ b/src/session.c @@ -152,6 +152,8 @@ saveYourselfCallback (SmcConn connection, int interact_Style, Bool fast) { + (*core.sessionSaveYourself) (saveType, interact_Style, shutdown, fast); + if (!SmcGetProperties (connection, saveYourselfGotProps, NULL)) SmcSaveYourselfDone (connection, 1); } @@ -160,6 +162,8 @@ static void dieCallback (SmcConn connection, SmPointer clientData) { + (*core.sessionDie) (); + closeSession (); exit (0); } @@ -168,12 +172,14 @@ static void saveCompleteCallback (SmcConn connection, SmPointer clientData) { + (*core.sessionSaveComplete) (); } static void shutdownCancelledCallback (SmcConn connection, SmPointer clientData) { + (*core.sessionShutdownCancelled) (); } void