diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2012-06-19 15:23:58 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2012-06-20 14:44:05 +0200 |
commit | c0823c29a053011daa563183d7bc46add9b88eec (patch) | |
tree | 7330c5135e27474d980588c6e2612cc2850eed24 /vcl | |
parent | 5c9872de884bcc3f1ec7cd6901b9440eec270d6d (diff) |
pOldStyleSaveFrame is never set anyway
...so rip out all the corresponding, apparently obsolete, functionality.
Change-Id: Ie1ca3fcf7f729464e4c11070caafc90a34da2d68
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/inc/unx/salframe.h | 5 | ||||
-rw-r--r-- | vcl/inc/unx/wmadaptor.hxx | 1 | ||||
-rw-r--r-- | vcl/unx/generic/app/sm.cxx | 25 | ||||
-rw-r--r-- | vcl/unx/generic/app/wmadaptor.cxx | 1 | ||||
-rw-r--r-- | vcl/unx/generic/window/salframe.cxx | 104 |
5 files changed, 5 insertions, 131 deletions
diff --git a/vcl/inc/unx/salframe.h b/vcl/inc/unx/salframe.h index f03f0e5b8f5d..cced9d6d9a23 100644 --- a/vcl/inc/unx/salframe.h +++ b/vcl/inc/unx/salframe.h @@ -64,8 +64,6 @@ class VCLPLUG_GEN_PUBLIC X11SalFrame : public SalFrame friend class vcl_sal::NetWMAdaptor; friend class vcl_sal::GnomeWMAdaptor; - static X11SalFrame* s_pSaveYourselfFrame; - X11SalFrame* mpParent; // pointer to parent frame // which should never obscur this frame bool mbTransientForRoot; @@ -167,8 +165,6 @@ class VCLPLUG_GEN_PUBLIC X11SalFrame : public SalFrame DECL_LINK( HandleAlwaysOnTopRaise, void* ); - void passOnSaveYourSelf(); - void createNewWindow( XLIB_Window aParent, SalX11Screen nXScreen = SalX11Screen( -1 ) ); void updateScreenNumber(); @@ -278,7 +274,6 @@ public: // done setting up the clipregion virtual void EndSetClipRegion(); - static void SaveYourselfDone( SalFrame* ); static Bool checkKeyReleaseForRepeat( Display*, XEvent*, XPointer pX11SalFrame ); /// @internal diff --git a/vcl/inc/unx/wmadaptor.hxx b/vcl/inc/unx/wmadaptor.hxx index 5848c6549c46..810c339f6854 100644 --- a/vcl/inc/unx/wmadaptor.hxx +++ b/vcl/inc/unx/wmadaptor.hxx @@ -106,7 +106,6 @@ public: WM_PROTOCOLS, WM_DELETE_WINDOW, WM_TAKE_FOCUS, - WM_SAVE_YOURSELF, WM_CLIENT_LEADER, WM_COMMAND, WM_LOCALE_NAME, diff --git a/vcl/unx/generic/app/sm.cxx b/vcl/unx/generic/app/sm.cxx index 8ba6e9cd2082..185e550355cf 100644 --- a/vcl/unx/generic/app/sm.cxx +++ b/vcl/unx/generic/app/sm.cxx @@ -63,8 +63,10 @@ namespace { class IceSalSession : public SalSession { public: - IceSalSession(); - virtual ~IceSalSession(); + IceSalSession() {} + +private: + virtual ~IceSalSession() {} virtual void queryInteraction(); virtual void interactionDone(); @@ -81,20 +83,6 @@ SalSession* X11SalInstance::CreateSalSession() return p; } -/* - * class IceSalSession - */ - -static X11SalFrame* pOldStyleSaveFrame = NULL; - -IceSalSession::IceSalSession() -{ -} - -IceSalSession::~IceSalSession() -{ -} - void IceSalSession::queryInteraction() { if( ! SessionManagerClient::queryInteraction() ) @@ -112,11 +100,6 @@ void IceSalSession::interactionDone() void IceSalSession::saveDone() { SessionManagerClient::saveDone(); - if( pOldStyleSaveFrame ) - { - // note: does nothing if not running in generic plugin - X11SalFrame::SaveYourselfDone( pOldStyleSaveFrame ); - } } bool IceSalSession::cancelShutdown() diff --git a/vcl/unx/generic/app/wmadaptor.cxx b/vcl/unx/generic/app/wmadaptor.cxx index 8b9b2783e617..a0791e03cac1 100644 --- a/vcl/unx/generic/app/wmadaptor.cxx +++ b/vcl/unx/generic/app/wmadaptor.cxx @@ -171,7 +171,6 @@ static const WMAdaptorProtocol aAtomTab[] = { "WM_PROTOCOLS", WMAdaptor::WM_PROTOCOLS }, { "WM_DELETE_WINDOW", WMAdaptor::WM_DELETE_WINDOW }, { "WM_TAKE_FOCUS", WMAdaptor::WM_TAKE_FOCUS }, - { "WM_SAVE_YOURSELF", WMAdaptor::WM_SAVE_YOURSELF }, { "WM_COMMAND", WMAdaptor::WM_COMMAND }, { "WM_CLIENT_LEADER", WMAdaptor::WM_CLIENT_LEADER }, { "WM_LOCALE_NAME", WMAdaptor::WM_LOCALE_NAME }, diff --git a/vcl/unx/generic/window/salframe.cxx b/vcl/unx/generic/window/salframe.cxx index 549616ca8c17..0a76ff3169eb 100644 --- a/vcl/unx/generic/window/salframe.cxx +++ b/vcl/unx/generic/window/salframe.cxx @@ -108,8 +108,6 @@ static XLIB_Window hPresentationWindow = None, hPresFocusWindow = None; static ::std::list< XLIB_Window > aPresentationReparentList; static int nVisibleFloats = 0; -X11SalFrame* X11SalFrame::s_pSaveYourselfFrame = NULL; - // -=-= C++ statics =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= // -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= static void doReparentPresentationDialogues( SalDisplay* pDisplay ) @@ -530,17 +528,11 @@ void X11SalFrame::Init( sal_uLong nSalFrameStyle, SalX11Screen nXScreen, SystemP { XSetWMHints( GetXDisplay(), mhWindow, &Hints ); // WM Protocols && internals - Atom a[4]; + Atom a[3]; int n = 0; a[n++] = pDisplay_->getWMAdaptor()->getAtom( WMAdaptor::WM_DELETE_WINDOW ); if( pDisplay_->getWMAdaptor()->getAtom( WMAdaptor::NET_WM_PING ) ) a[n++] = pDisplay_->getWMAdaptor()->getAtom( WMAdaptor::NET_WM_PING ); - if( ! s_pSaveYourselfFrame && ! mpParent) - { - // at all times have only one frame with SaveYourself - a[n++] = pDisplay_->getWMAdaptor()->getAtom( WMAdaptor::WM_SAVE_YOURSELF ); - s_pSaveYourselfFrame = this; - } if( (nSalFrameStyle & SAL_FRAME_STYLE_OWNERDRAWDECORATION) ) a[n++] = pDisplay_->getWMAdaptor()->getAtom( WMAdaptor::WM_TAKE_FOCUS ); XSetWMProtocols( GetXDisplay(), GetShellWindow(), a, n ); @@ -731,39 +723,6 @@ X11SalFrame::X11SalFrame( SalFrame *pParent, sal_uLong nSalFrameStyle, Init( nSalFrameStyle, GetDisplay()->GetDefaultXScreen(), pSystemParent ); } -// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= - -void X11SalFrame::passOnSaveYourSelf() -{ - if( this == s_pSaveYourselfFrame ) - { - // pass on SaveYourself - const X11SalFrame* pFrame = NULL; - const std::list< SalFrame* >& rFrames = GetDisplay()->getFrames(); - std::list< SalFrame* >::const_iterator it = rFrames.begin(); - while( it != rFrames.end() ) - { - pFrame = static_cast< const X11SalFrame* >(*it); - if( ! ( IsChildWindow() || pFrame->mpParent ) - && pFrame != s_pSaveYourselfFrame ) - break; - ++it; - } - - s_pSaveYourselfFrame = (it != rFrames.end() ) ? const_cast<X11SalFrame*>(pFrame) : NULL; - if( s_pSaveYourselfFrame ) - { - Atom a[4]; - int n = 0; - a[n++] = pDisplay_->getWMAdaptor()->getAtom( WMAdaptor::WM_DELETE_WINDOW ); - a[n++] = pDisplay_->getWMAdaptor()->getAtom( WMAdaptor::WM_SAVE_YOURSELF ); - if( pDisplay_->getWMAdaptor()->getAtom( WMAdaptor::NET_WM_PING ) ) - a[n++] = pDisplay_->getWMAdaptor()->getAtom( WMAdaptor::NET_WM_PING ); - XSetWMProtocols( GetXDisplay(), s_pSaveYourselfFrame->GetShellWindow(), a, n ); - } - } -} - X11SalFrame::~X11SalFrame() { notifyDelete(); @@ -842,8 +801,6 @@ X11SalFrame::~X11SalFrame() && ++sit == GetDisplay()->getFrames().end() ) vcl::I18NStatus::free(); } - - passOnSaveYourSelf(); } // -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= @@ -2637,8 +2594,6 @@ void X11SalFrame::createNewWindow( XLIB_Window aNewParent, SalX11Screen nXScreen XDestroyWindow( GetXDisplay(), mhWindow ); mhWindow = None; - passOnSaveYourSelf(); - // now init with new parent again if ( aParentData.aWindow != None ) Init( nStyle_ | SAL_FRAME_STYLE_PLUG, nXScreen, &aParentData ); @@ -4001,23 +3956,6 @@ long X11SalFrame::HandleClientMessage( XClientMessageEvent *pEvent ) "ownerdraw" : "NON OWNERDRAW" ); #endif } - else if( (Atom)pEvent->data.l[0] == rWMAdaptor.getAtom( WMAdaptor::WM_SAVE_YOURSELF ) ) - { - if( this == s_pSaveYourselfFrame ) - { - rtl::OString aExec(rtl::OUStringToOString(SessionManagerClient::getExecName(), osl_getThreadTextEncoding())); - const char* argv[2]; - argv[0] = "/bin/sh"; - argv[1] = const_cast<char*>(aExec.getStr()); - #if OSL_DEBUG_LEVEL > 1 - fprintf( stderr, "SaveYourself request, setting command: %s %s\n", argv[0], argv[1] ); - #endif - XSetCommand( GetXDisplay(), GetShellWindow(), (char**)argv, 2 ); - } - else - // can only happen in race between WM and window closing - XChangeProperty( GetXDisplay(), GetShellWindow(), rWMAdaptor.getAtom( WMAdaptor::WM_COMMAND ), XA_STRING, 8, PropModeReplace, (unsigned char*)"", 0 ); - } } } else if( pEvent->message_type == rWMAdaptor.getAtom( WMAdaptor::XEMBED ) && @@ -4040,46 +3978,6 @@ long X11SalFrame::HandleClientMessage( XClientMessageEvent *pEvent ) return 0; } -void X11SalFrame::SaveYourselfDone( SalFrame* pSaveFrame ) -{ - // session save was done, inform dtwm - if( s_pSaveYourselfFrame && pSaveFrame ) - { - rtl::OString aExec(rtl::OUStringToOString(SessionManagerClient::getExecName(), osl_getThreadTextEncoding())); - const char* argv[2]; - argv[0] = "/bin/sh"; - argv[1] = const_cast<char*>(aExec.getStr()); -#if OSL_DEBUG_LEVEL > 1 - fprintf( stderr, "SaveYourself request, setting command: %s %s\n", argv[0], argv[1] ); -#endif - XSetCommand( s_pSaveYourselfFrame->GetXDisplay(), - s_pSaveYourselfFrame->GetShellWindow(), - (char**)argv, 2 ); - if( pSaveFrame != s_pSaveYourselfFrame ) - { - // check if it still exists - const X11SalFrame* pFrame = NULL; - const std::list< SalFrame* >& rFrames = static_cast<X11SalFrame*>(pSaveFrame)->GetDisplay()->getFrames(); - std::list< SalFrame* >::const_iterator it = rFrames.begin(); - while( it != rFrames.end() ) - { - pFrame = static_cast< const X11SalFrame* >(*it); - if( pFrame == pSaveFrame ) - break; - ++it; - } - if( pFrame == pSaveFrame ) - { - const WMAdaptor& rWMAdaptor( *pFrame->pDisplay_->getWMAdaptor() ); - XChangeProperty( pFrame->GetXDisplay(), - pFrame->GetShellWindow(), - rWMAdaptor.getAtom( WMAdaptor::WM_COMMAND ), XA_STRING, 8, PropModeReplace, (unsigned char*)"", 0 ); - } - } - s_pSaveYourselfFrame->ShutDown(); - } -} - // -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= extern "C" |