dtsession: split ShowWaitState into Enter and LeaveWaitState
This commit is contained in:
@@ -428,7 +428,7 @@ main (int argc, char **argv)
|
||||
/*
|
||||
* Put the program into a wait state
|
||||
*/
|
||||
ShowWaitState(True);
|
||||
EnterWaitState();
|
||||
|
||||
InitErrorHandler();
|
||||
|
||||
@@ -491,7 +491,7 @@ main (int argc, char **argv)
|
||||
XSelectInput(smGD.display, smGD.topLevelWindow,
|
||||
windAtt.your_event_mask | PropertyChangeMask);
|
||||
|
||||
ShowWaitState(False);
|
||||
LeaveWaitState();
|
||||
|
||||
/*
|
||||
* Register for events
|
||||
|
||||
@@ -340,7 +340,7 @@ CompleteSave (void)
|
||||
* Start a wait state - don't want anything to happen while
|
||||
* ICCC clients are being saved
|
||||
*/
|
||||
ShowWaitState(True);
|
||||
EnterWaitState();
|
||||
|
||||
resSpec = (char *) SM_MALLOC(resSize * sizeof(char));
|
||||
if (resSpec==NULL)
|
||||
@@ -350,7 +350,7 @@ CompleteSave (void)
|
||||
}
|
||||
|
||||
if (!WriteClientDatabase ()) {
|
||||
ShowWaitState(False);
|
||||
LeaveWaitState();
|
||||
SM_FREE(resSpec);
|
||||
return (-1);
|
||||
}
|
||||
@@ -381,7 +381,7 @@ CompleteSave (void)
|
||||
*/
|
||||
if(OutputResource())
|
||||
{
|
||||
ShowWaitState(False);
|
||||
LeaveWaitState();
|
||||
SM_FREE(resSpec);
|
||||
return(-1);
|
||||
}
|
||||
@@ -398,7 +398,7 @@ CompleteSave (void)
|
||||
|
||||
PruneSessionDirectory ();
|
||||
|
||||
ShowWaitState(False);
|
||||
LeaveWaitState();
|
||||
|
||||
return(0);
|
||||
}
|
||||
|
||||
@@ -1389,8 +1389,8 @@ DialogUp(
|
||||
|
||||
/*************************************<->*************************************
|
||||
*
|
||||
* ShowWaitState (flag)
|
||||
*
|
||||
* EnterWaitState (void)
|
||||
* LeaveWaitState (void)
|
||||
*
|
||||
* Description:
|
||||
* -----------
|
||||
@@ -1399,7 +1399,7 @@ DialogUp(
|
||||
*
|
||||
* Inputs:
|
||||
* ------
|
||||
* flag = TRUE for Enter, FALSE for Leave.
|
||||
* None.
|
||||
*
|
||||
*
|
||||
* Outputs:
|
||||
@@ -1414,25 +1414,24 @@ DialogUp(
|
||||
*************************************<->***********************************/
|
||||
|
||||
void
|
||||
ShowWaitState(
|
||||
Boolean flag )
|
||||
{
|
||||
if (flag)
|
||||
EnterWaitState(void)
|
||||
{
|
||||
XGrabPointer (smGD.display, DefaultRootWindow(smGD.display), FALSE,
|
||||
0, GrabModeAsync, GrabModeAsync, None,
|
||||
smGD.waitCursor, CurrentTime);
|
||||
XGrabKeyboard (smGD.display, DefaultRootWindow(smGD.display), FALSE,
|
||||
GrabModeAsync, GrabModeAsync, CurrentTime);
|
||||
}
|
||||
else
|
||||
{
|
||||
XUngrabPointer (smGD.display, CurrentTime);
|
||||
XUngrabKeyboard (smGD.display, CurrentTime);
|
||||
}
|
||||
XSync(smGD.display,0);
|
||||
}
|
||||
|
||||
void LeaveWaitState(void){
|
||||
XUngrabPointer (smGD.display, CurrentTime);
|
||||
XUngrabKeyboard (smGD.display, CurrentTime);
|
||||
XSync(smGD.display, 0);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/*************************************<->*************************************
|
||||
*
|
||||
|
||||
@@ -104,7 +104,8 @@ extern int WarnMsgFailure( void ) ;
|
||||
extern Widget CreateLockDialogWithCover( Widget ) ;
|
||||
extern Widget CreateCoverDialog( int, Boolean ) ;
|
||||
extern void ImmediateExit( int, Tt_message, Boolean ) ;
|
||||
extern void ShowWaitState( Boolean ) ;
|
||||
extern void EnterWaitState();
|
||||
extern void LeaveWaitState();
|
||||
extern Boolean InitCursorInfo( void ) ;
|
||||
extern void UpdatePasswdField( int );
|
||||
extern int WarnNoStartup( void );
|
||||
|
||||
@@ -803,9 +803,9 @@ SaveYourselfReqProc (
|
||||
* appropriate location.
|
||||
*/
|
||||
if (notify) {
|
||||
ShowWaitState(True);
|
||||
EnterWaitState();
|
||||
NotifyProxyClients ();
|
||||
ShowWaitState(False);
|
||||
LeaveWaitState();
|
||||
}
|
||||
|
||||
for (pClientRec = connectedList; pClientRec != NULL;
|
||||
|
||||
@@ -898,6 +898,7 @@ void ConfirmAction (WmScreenData *pSD, int nbr)
|
||||
|
||||
void EnterWaitState(void)
|
||||
{
|
||||
if (!waitCursor)
|
||||
waitCursor = _DtGetHourGlassCursor(DISPLAY);
|
||||
|
||||
XGrabPointer (DISPLAY, DefaultRootWindow(DISPLAY), FALSE,
|
||||
|
||||
Reference in New Issue
Block a user