Lines 180-185
Link Here
|
180 |
static ::std::list< XLIB_Window > aPresentationReparentList; |
180 |
static ::std::list< XLIB_Window > aPresentationReparentList; |
181 |
static SalFrame* pIntroBitmap = NULL; |
181 |
static SalFrame* pIntroBitmap = NULL; |
182 |
static bool bWasIntroBitmap = false; |
182 |
static bool bWasIntroBitmap = false; |
|
|
183 |
static SalFrame* pSaveYourselfFrame = NULL; |
183 |
static int nVisibleFloats = 0; |
184 |
static int nVisibleFloats = 0; |
184 |
|
185 |
|
185 |
// -=-= C++ statics =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= |
186 |
// -=-= C++ statics =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= |
Lines 452-472
Link Here
|
452 |
|
453 |
|
453 |
if( ! pParentData ) |
454 |
if( ! pParentData ) |
454 |
{ |
455 |
{ |
455 |
XSizeHints* pHints = XAllocSizeHints(); |
|
|
456 |
pHints->flags = PWinGravity | PPosition | PSize; |
457 |
pHints->x = x; |
458 |
pHints->y = y; |
459 |
pHints->width = w; |
460 |
pHints->height = h; |
461 |
pHints->win_gravity = NorthWestGravity; |
462 |
XFree( pHints ); |
463 |
|
464 |
XSetWMHints( GetXDisplay(), mhWindow, &Hints ); |
456 |
XSetWMHints( GetXDisplay(), mhWindow, &Hints ); |
465 |
// WM Protocols && internals |
457 |
// WM Protocols && internals |
|
|
458 |
// All of our top level windows implement the WM_DELETE_WINDOW protocol, |
459 |
// and the whole application should have exactly one window that implements |
460 |
// the WM_SAVE_YOURSELF protocol. |
466 |
Atom a[4]; |
461 |
Atom a[4]; |
467 |
int n = 0; |
462 |
int n = 0; |
468 |
a[n++] = pDisplay_->getWMAdaptor()->getAtom( WMAdaptor::WM_DELETE_WINDOW ); |
463 |
a[n++] = pDisplay_->getWMAdaptor()->getAtom( WMAdaptor::WM_DELETE_WINDOW ); |
469 |
a[n++] = pDisplay_->getWMAdaptor()->getAtom( WMAdaptor::WM_SAVE_YOURSELF ); |
464 |
if ( ! pSaveYourselfFrame ) { |
|
|
465 |
a[n++] = pDisplay_->getWMAdaptor()->getAtom( WMAdaptor::WM_SAVE_YOURSELF ); |
466 |
pSaveYourselfFrame = pFrame_; |
467 |
#ifdef DEBUG |
468 |
printf( "WM_SAVE_YOURSELF window set to XID %#x\n", mhWindow ); |
469 |
#endif |
470 |
} |
470 |
XSetWMProtocols( GetXDisplay(), mhWindow, a, n ); |
471 |
XSetWMProtocols( GetXDisplay(), mhWindow, a, n ); |
471 |
|
472 |
|
472 |
XClassHint* pClass = XAllocClassHint(); |
473 |
XClassHint* pClass = XAllocClassHint(); |
Lines 643-648
Link Here
|
643 |
|
644 |
|
644 |
pTemp->pNextFrame_ = GetNextFrame(); |
645 |
pTemp->pNextFrame_ = GetNextFrame(); |
645 |
} |
646 |
} |
|
|
647 |
|
648 |
/* |
649 |
* In case we just deleted the frame that contained the WM_SAVE_YOURSELF |
650 |
* WM_PROTOCOLS atom for the application, we try to find another |
651 |
* top level window that gets the WM_SAVE_YOURSELF atom. |
652 |
*/ |
653 |
if ( pFrame_ == pSaveYourselfFrame ) |
654 |
{ |
655 |
pSaveYourselfFrame = NULL; |
656 |
|
657 |
SalFrame *pFrameTemp = pSalData->pFirstFrame_; |
658 |
while ( pFrameTemp && pFrameTemp->maFrameData.mpParent != NULL ) |
659 |
pFrameTemp = pFrameTemp->maFrameData.pNextFrame_; |
660 |
|
661 |
if ( pFrameTemp ) |
662 |
{ |
663 |
pSaveYourselfFrame = pFrameTemp; |
664 |
|
665 |
Atom a[4]; |
666 |
int n = 0; |
667 |
a[n++] = pDisplay_->getWMAdaptor()->getAtom( WMAdaptor::WM_DELETE_WINDOW ); |
668 |
a[n++] = pDisplay_->getWMAdaptor()->getAtom( WMAdaptor::WM_SAVE_YOURSELF ); |
669 |
XSetWMProtocols( GetXDisplay(), pFrameTemp->maFrameData.mhWindow, a, n ); |
670 |
|
671 |
#ifdef DEBUG |
672 |
printf( "WM_SAVE_YOURSELF window moved to XID %#x\n", pFrameTemp->maFrameData.mhWindow ); |
673 |
#endif |
674 |
} |
675 |
else |
676 |
{ |
677 |
#ifdef DEBUG |
678 |
printf( "WM_SAVE_YOURSELF window was deleted\n" ); |
679 |
#endif |
680 |
} |
681 |
} |
682 |
|
646 |
/* |
683 |
/* |
647 |
* check if there is only the status frame is left |
684 |
* check if there is only the status frame is left |
648 |
* if so, free it |
685 |
* if so, free it |
Lines 3051-3060
Link Here
|
3051 |
} |
3115 |
} |
3052 |
else if( pEvent->data.l[0] == rWMAdaptor.getAtom( WMAdaptor::WM_SAVE_YOURSELF ) ) |
3116 |
else if( pEvent->data.l[0] == rWMAdaptor.getAtom( WMAdaptor::WM_SAVE_YOURSELF ) ) |
3053 |
{ |
3117 |
{ |
3054 |
SalFrame* pLast = GetSalData()->pFirstFrame_; |
3118 |
if( pFrame_ == pSaveYourselfFrame ) |
3055 |
while( pLast->maFrameData.pNextFrame_ ) |
|
|
3056 |
pLast = pLast->maFrameData.pNextFrame_; |
3057 |
if( pLast == pFrame_ ) |
3058 |
{ |
3119 |
{ |
3059 |
ByteString aExec( SessionManagerClient::getExecName(), osl_getThreadTextEncoding() ); |
3120 |
ByteString aExec( SessionManagerClient::getExecName(), osl_getThreadTextEncoding() ); |
3060 |
char* argv[2]; |
3121 |
char* argv[2]; |