diff options
author | Michael Meeks <michael.meeks@suse.com> | 2011-09-28 18:09:40 +0100 |
---|---|---|
committer | Michael Meeks <michael.meeks@suse.com> | 2011-10-25 13:41:45 +0100 |
commit | a39f4e5b57f5e518cc1ba09d5801da07b52fbaa5 (patch) | |
tree | 8189fc63babce04b01b15ca5aa46816a7e956caa | |
parent | 0fd37a71d3dc81064c8bae45048deb841bfe77f1 (diff) |
gtk3: substantial re-work and cleanup of event handling
Implement SalTimer ourselves rather more cleanly
Remove nasty GtkXLib cruft inherited from X backend
Merge and cleanup most Yield / mainloop bits into GtkData
-rw-r--r-- | vcl/inc/unx/gtk/gtkdata.hxx | 64 | ||||
-rw-r--r-- | vcl/inc/unx/gtk/gtkframe.hxx | 1 | ||||
-rw-r--r-- | vcl/inc/unx/gtk/gtkinst.hxx | 1 | ||||
-rw-r--r-- | vcl/unx/gtk/app/gtkdata.cxx | 417 | ||||
-rw-r--r-- | vcl/unx/gtk/app/gtkinst.cxx | 12 | ||||
-rw-r--r-- | vcl/unx/gtk/window/gtkframe.cxx | 21 |
6 files changed, 168 insertions, 348 deletions
diff --git a/vcl/inc/unx/gtk/gtkdata.hxx b/vcl/inc/unx/gtk/gtkdata.hxx index b2c5127fa41b..22491f466278 100644 --- a/vcl/inc/unx/gtk/gtkdata.hxx +++ b/vcl/inc/unx/gtk/gtkdata.hxx @@ -42,2 +42,3 @@ #include <osl/conditn.h> +#include "saltimer.hxx" @@ -45,3 +46,2 @@ -class GtkXLib; class GtkSalDisplay; @@ -81,41 +81,23 @@ inline void widget_set_can_default(GtkWidget *widget, gboolean can_default) -class GtkXLib : public SalXLib +class GtkSalTimer : public SalTimer { - GtkSalDisplay *m_pGtkSalDisplay; - std::list<GSource *> m_aSources; - GSource *m_pTimeout; - GSource *m_pUserEvent; - oslMutex m_aDispatchMutex; - oslCondition m_aDispatchCondition; - XIOErrorHandler m_aOrigGTKXIOErrorHandler; - + GSource *m_pTimeout; public: - static gboolean timeoutFn(gpointer data); - static gboolean userEventFn(gpointer data); - - GtkXLib(); - virtual ~GtkXLib(); - - virtual void Init(); - virtual void Yield( bool bWait, bool bHandleAllCurrentEvents ); - virtual void Insert( int fd, void* data, - YieldFunc pending, - YieldFunc queued, - YieldFunc handle ); - virtual void Remove( int fd ); - - virtual void StartTimer( sal_uLong nMS ); - virtual void StopTimer(); - virtual void Wakeup(); - virtual void PostUserEvent(); + GtkSalTimer(); + ~GtkSalTimer(); + sal_uLong m_nTimeoutMS; + virtual void Start( sal_uLong nMS ); + virtual void Stop(); }; -#if GTK_CHECK_VERSION(3,0,0) class GtkData : public SalData -#else -class GtkData : public X11SalData -#endif { + oslMutex m_aDispatchMutex; + oslCondition m_aDispatchCondition; + GSource *m_pUserEvent; + + GtkSalDisplay *m_pGtkSalDisplay; + public: - GtkData() {} + GtkData(); virtual ~GtkData(); @@ -127,8 +109,8 @@ public: - GtkSalDisplay *pDisplay; - GtkSalDisplay *GetDisplay() { return pDisplay; } -#if GTK_CHECK_VERSION(3,0,0) - GtkXLib *pXLib_; - SalXLib *GetLib() { return pXLib_; } -#endif + static gboolean userEventFn( gpointer data ); + + void PostUserEvent(); + void Yield( bool bWait, bool bHandleAllCurrentEvents ); + GtkSalDisplay *GetDisplay() { return m_pGtkSalDisplay; } + inline GdkDisplay *GetGdkDisplay(); }; @@ -212,3 +194,3 @@ public: std::list< SalUserEvent > m_aUserEvents; - guint32 GetLastUserEventTime( bool b ) { return GDK_CURRENT_TIME; } // horrible hack + guint32 GetLastUserEventTime( bool /* b */ ) { return GDK_CURRENT_TIME; } // horrible hack #endif @@ -216,2 +198,4 @@ public: +inline GdkDisplay *GtkData::GetGdkDisplay() { return m_pGtkSalDisplay->GetGdkDisplay(); } + diff --git a/vcl/inc/unx/gtk/gtkframe.hxx b/vcl/inc/unx/gtk/gtkframe.hxx index 36a5c5dbfb6a..2be332448c4d 100644 --- a/vcl/inc/unx/gtk/gtkframe.hxx +++ b/vcl/inc/unx/gtk/gtkframe.hxx @@ -182,2 +182,3 @@ class GtkSalFrame : public SalFrame, basebmp::BitmapDeviceDamageTracker GtkWidget* m_pWindow; + guint m_nIdleFullScreen; #if GTK_CHECK_VERSION(3,0,0) diff --git a/vcl/inc/unx/gtk/gtkinst.hxx b/vcl/inc/unx/gtk/gtkinst.hxx index 5e7eff7f7f74..d8602e3312f0 100644 --- a/vcl/inc/unx/gtk/gtkinst.hxx +++ b/vcl/inc/unx/gtk/gtkinst.hxx @@ -102,2 +102,3 @@ public: virtual SalSystem* CreateSalSystem(); + virtual SalTimer* CreateSalTimer(); virtual void AddToRecentDocumentList(const rtl::OUString& rFileUrl, const rtl::OUString& rMimeType); diff --git a/vcl/unx/gtk/app/gtkdata.cxx b/vcl/unx/gtk/app/gtkdata.cxx index d04f01317986..07b59f28a633 100644 --- a/vcl/unx/gtk/app/gtkdata.cxx +++ b/vcl/unx/gtk/app/gtkdata.cxx @@ -130,7 +130,3 @@ void GtkSalDisplay::errorTrapPush() { -#if GTK_CHECK_VERSION(3,0,0) gdk_error_trap_push (); -#else - GetXLib()->PushXErrorLevel( true ); -#endif } @@ -139,7 +135,6 @@ void GtkSalDisplay::errorTrapPop() { -#if GTK_CHECK_VERSION(3,0,0) - gdk_error_trap_pop_ignored (); +#if !GTK_CHECK_VERSION(3,0,0) + gdk_error_trap_pop (); #else - XSync( GetDisplay(), False ); - GetXLib()->PopXErrorLevel(); + gdk_error_trap_pop_ignored (); // faster #endif @@ -579,27 +574,24 @@ int GtkSalDisplay::CaptureMouse( SalFrame* pSFrame ) -/*************************************************************************** - * class GtkXLib * - ***************************************************************************/ -GtkXLib::GtkXLib() +/********************************************************************** + * class GtkData * + **********************************************************************/ + +GtkData::GtkData() { -#if OSL_DEBUG_LEVEL > 1 - fprintf( stderr, "GtkXLib::GtkXLib()\n" ); -#endif - m_pGtkSalDisplay = NULL; - m_pTimeout = NULL; - m_nTimeoutMS = 0; m_pUserEvent = NULL; - m_aDispatchCondition = osl_createCondition(); m_aDispatchMutex = osl_createMutex(); - m_aOrigGTKXIOErrorHandler = NULL; + m_aDispatchCondition = osl_createCondition(); } -GtkXLib::~GtkXLib() +GtkData::~GtkData() { -#if OSL_DEBUG_LEVEL > 1 - fprintf( stderr, "GtkXLib::~GtkXLib()\n" ); -#endif Yield( true, true ); - StopTimer(); + g_warning ("TESTME: We used to have a stop-timer here, but the central code should do this"); + + if (m_pUserEvent) + { + g_source_destroy (m_pUserEvent); + g_source_unref (m_pUserEvent); + } // sanity check: at this point nobody should be yielding, but wake them @@ -609,8 +601,57 @@ GtkXLib::~GtkXLib() osl_destroyMutex( m_aDispatchMutex ); +} + +void GtkData::Yield( bool bWait, bool bHandleAllCurrentEvents ) +{ + /* #i33212# only enter g_main_context_iteration in one thread at any one + * time, else one of them potentially will never end as long as there is + * another thread in in there. Having only one yieldin thread actually dispatch + * fits the vcl event model (see e.g. the generic plugin). + */ + bool bDispatchThread = false; + gboolean wasEvent = FALSE; + { + // release YieldMutex (and re-acquire at block end) + YieldMutexReleaser aReleaser; + if( osl_tryToAcquireMutex( m_aDispatchMutex ) ) + bDispatchThread = true; + else if( ! bWait ) + return; // someone else is waiting already, return + + + if( bDispatchThread ) + { + int nMaxEvents = bHandleAllCurrentEvents ? 100 : 1; + gboolean wasOneEvent = TRUE; + while( nMaxEvents-- && wasOneEvent ) + { + wasOneEvent = g_main_context_iteration( NULL, FALSE ); + if( wasOneEvent ) + wasEvent = TRUE; + } + if( bWait && ! wasEvent ) + wasEvent = g_main_context_iteration( NULL, TRUE ); + } + else if( bWait ) + { + /* #i41693# in case the dispatch thread hangs in join + * for this thread the condition will never be set + * workaround: timeout of 1 second a emergency exit + */ + // we are the dispatch thread + osl_resetCondition( m_aDispatchCondition ); + TimeValue aValue = { 1, 0 }; + osl_waitCondition( m_aDispatchCondition, &aValue ); + } + } - PopXErrorLevel(); - XSetIOErrorHandler (m_aOrigGTKXIOErrorHandler); + if( bDispatchThread ) + { + osl_releaseMutex( m_aDispatchMutex ); + if( wasEvent ) + osl_setCondition( m_aDispatchCondition ); // trigger non dispatch thread yields + } } -void GtkXLib::Init() +void GtkData::Init() { @@ -618,3 +659,3 @@ void GtkXLib::Init() #if OSL_DEBUG_LEVEL > 1 - fprintf( stderr, "GtkXLib::Init()\n" ); + fprintf( stderr, "GtkMainloop::Init()\n" ); #endif @@ -675,7 +716,2 @@ void GtkXLib::Init() -#if !GTK_CHECK_VERSION(3,0,0) - // gtk_init_check sets XError/XIOError handlers, ours are inferior: so use them ! (hmm) - m_aOrigGTKXIOErrorHandler = XSetIOErrorHandler ( (XIOErrorHandler)X11SalData::XIOErrorHdl ); -#endif - for (i = 0; i < nParams; i++ ) @@ -720,3 +756,2 @@ void GtkXLib::Init() m_pGtkSalDisplay = new GtkSalDisplay( pGdkDisp ); - GetGtkSalData()->pDisplay = m_pGtkSalDisplay; @@ -725,7 +760,8 @@ void GtkXLib::Init() - m_pGtkSalDisplay->errorTrapPush(); + gdk_error_trap_push(); SalI18N_KeyboardExtension *pKbdExtension = new SalI18N_KeyboardExtension( pDisp ); - XSync( pDisp, False ); - pKbdExtension->UseExtension( ! HasXErrorOccurred() ); - m_pGtkSalDisplay->errorTrapPop(); + bool bErrorOccured = gdk_error_trap_pop() != 0; + gdk_error_trap_push(); + pKbdExtension->UseExtension( bErrorOccured ); + gdk_error_trap_pop(); m_pGtkSalDisplay->SetKbdExtension( pKbdExtension ); @@ -754,42 +790,35 @@ void GtkXLib::Init() -extern "C" +GtkSalTimer::GtkSalTimer() + : m_pTimeout( 0 ) { - gboolean call_timeoutFn(gpointer data) - { - return GtkXLib::timeoutFn(data); - } } -gboolean GtkXLib::timeoutFn(gpointer data) +GtkSalTimer::~GtkSalTimer() { - SalData *pSalData = GetSalData(); - GtkXLib *pThis = (GtkXLib *) data; - - pSalData->m_pInstance->GetYieldMutex()->acquire(); + Stop(); +} - if( pThis->m_pTimeout ) +extern "C" +{ + gboolean call_timeoutFn( gpointer pData ) { - g_source_unref (pThis->m_pTimeout); - pThis->m_pTimeout = NULL; - } + GtkSalTimer *pTimer = (GtkSalTimer *)pData; + SalData *pSalData = GetSalData(); - // Auto-restart immediately - pThis->StartTimer( pThis->m_nTimeoutMS ); + osl::SolarGuard aGuard( pSalData->m_pInstance->GetYieldMutex() ); - GetX11SalData()->Timeout(); + pTimer->Start( pTimer->m_nTimeoutMS ); - pSalData->m_pInstance->GetYieldMutex()->release(); + ImplSVData* pSVData = ImplGetSVData(); + if( pSVData->mpSalTimer ) + pSVData->mpSalTimer->CallCallback(); - return FALSE; + return FALSE; + } } -void GtkXLib::StartTimer( sal_uLong nMS ) +void GtkSalTimer::Start( sal_uLong nMS ) { m_nTimeoutMS = nMS; // for restarting - - if (m_pTimeout) - { - g_source_destroy (m_pTimeout); - g_source_unref (m_pTimeout); - } + Stop(); @@ -803,23 +832,10 @@ void GtkXLib::StartTimer( sal_uLong nMS ) g_source_attach (m_pTimeout, g_main_context_default ()); - - SalXLib::StartTimer( nMS ); } -void GtkXLib::StopTimer() -{ - SalXLib::StopTimer(); - - if (m_pTimeout) - { - g_source_destroy (m_pTimeout); - g_source_unref (m_pTimeout); - m_pTimeout = NULL; - } -} - -extern "C" +void GtkSalTimer::Stop() { - gboolean call_userEventFn( gpointer data ) + if( m_pTimeout ) { - return GtkXLib::userEventFn( data ); + g_source_destroy( m_pTimeout ); + g_source_unref( m_pTimeout ); } @@ -827,9 +843,9 @@ extern "C" -gboolean GtkXLib::userEventFn(gpointer data) +gboolean GtkData::userEventFn( gpointer data ) { gboolean bContinue = FALSE; - GtkXLib *pThis = (GtkXLib *) data; + GtkData *pThis = (GtkData *) data; X11SalData *pSalData = GetX11SalData(); - pSalData->m_pInstance->GetYieldMutex()->acquire(); + osl::SolarGuard aGuard( pSalData->m_pInstance->GetYieldMutex() ); @@ -863,4 +879,2 @@ gboolean GtkXLib::userEventFn(gpointer data) - pSalData->m_pInstance->GetYieldMutex()->release(); - return bContinue; @@ -899,3 +913,2 @@ bool GtkSalDisplay::DispatchInternalEvent() -// FIXME: cut/paste from saldisp.cxx - needs some re-factoring love void GtkSalDisplay::SendInternalEvent( SalFrame* pFrame, void* pData, sal_uInt16 nEvent ) @@ -906,4 +919,4 @@ void GtkSalDisplay::SendInternalEvent( SalFrame* pFrame, void* pData, sal_uInt16 - // Notify GtkXLib::Yield() of a pending event. - GetGtkSalData()->pXLib_->PostUserEvent(); + // Notify GtkData::Yield() of a pending event. + GetGtkSalData()->PostUserEvent(); @@ -916,3 +929,2 @@ void GtkSalDisplay::SendInternalEvent( SalFrame* pFrame, void* pData, sal_uInt16 -// FIXME: cut/paste from saldisp.cxx - needs some re-factoring love void GtkSalDisplay::CancelInternalEvent( SalFrame* pFrame, void* pData, sal_uInt16 nEvent ) @@ -939,5 +951,4 @@ void GtkSalDisplay::CancelInternalEvent( SalFrame* pFrame, void* pData, sal_uInt } - else { + else DBG_ASSERT( 1, "SalDisplay::CancelInternalEvent !acquireMutex\n" ); - } } @@ -946,9 +957,18 @@ void GtkSalDisplay::CancelInternalEvent( SalFrame* pFrame, void* pData, sal_uInt +extern "C" { + static gboolean call_userEventFn( void *data ) + { + return GtkData::userEventFn( data ); + } +} + // hEventGuard_ held during this invocation -void GtkXLib::PostUserEvent() +void GtkData::PostUserEvent() { - if( !m_pUserEvent ) // not pending anyway + if (m_pUserEvent) + g_main_context_wakeup (NULL); // really needed ? + else // nothing pending anyway { m_pUserEvent = g_idle_source_new(); - g_source_set_priority( m_pUserEvent, G_PRIORITY_HIGH ); + g_source_set_priority (m_pUserEvent, G_PRIORITY_HIGH); g_source_set_can_recurse (m_pUserEvent, TRUE); @@ -958,207 +978,2 @@ void GtkXLib::PostUserEvent() } - Wakeup(); -} - -void GtkXLib::Wakeup() -{ - g_main_context_wakeup( g_main_context_default () ); -} - -void GtkXLib::Yield( bool bWait, bool bHandleAllCurrentEvents ) -{ - /* #i33212# only enter g_main_context_iteration in one thread at any one - * time, else one of them potentially will never end as long as there is - * another thread in in there. Having only one yieldin thread actually dispatch - * fits the vcl event model (see e.g. the generic plugin). - */ - - bool bDispatchThread = false; - gboolean wasEvent = FALSE; - { - // release YieldMutex (and re-acquire at block end) - YieldMutexReleaser aReleaser; - if( osl_tryToAcquireMutex( m_aDispatchMutex ) ) - bDispatchThread = true; - else if( ! bWait ) - return; // someone else is waiting already, return - - - if( bDispatchThread ) - { - int nMaxEvents = bHandleAllCurrentEvents ? 100 : 1; - gboolean wasOneEvent = TRUE; - while( nMaxEvents-- && wasOneEvent ) - { - wasOneEvent = g_main_context_iteration( NULL, FALSE ); - if( wasOneEvent ) - wasEvent = TRUE; - } - if( bWait && ! wasEvent ) - wasEvent = g_main_context_iteration( NULL, TRUE ); - } - else if( bWait ) - { - /* #i41693# in case the dispatch thread hangs in join - * for this thread the condition will never be set - * workaround: timeout of 1 second a emergency exit - */ - // we are the dispatch thread - osl_resetCondition( m_aDispatchCondition ); - TimeValue aValue = { 1, 0 }; - osl_waitCondition( m_aDispatchCondition, &aValue ); - } - } - - if( bDispatchThread ) - { - osl_releaseMutex( m_aDispatchMutex ); - if( wasEvent ) - osl_setCondition( m_aDispatchCondition ); // trigger non dispatch thread yields - } -} - -extern "C" { - -typedef struct { - GSource source; - - GPollFD pollfd; - GIOCondition condition; - - YieldFunc pending; - YieldFunc handle; - gpointer user_data; -} SalWatch; - -static gboolean -sal_source_prepare (GSource *source, - gint *timeout) -{ - SalWatch *watch = (SalWatch *)source; - - *timeout = -1; - - if (watch->pending && - watch->pending (watch->pollfd.fd, watch->user_data)) { - watch->pollfd.revents |= watch->condition; - return TRUE; - } - - return FALSE; -} - -static gboolean -sal_source_check (GSource *source) -{ - SalWatch *watch = (SalWatch *)source; - - return watch->pollfd.revents & watch->condition; -} - -static gboolean -sal_source_dispatch (GSource *source, - GSourceFunc, - gpointer) -{ - SalData *pSalData = GetSalData(); - SalWatch *watch = (SalWatch *) source; - - pSalData->m_pInstance->GetYieldMutex()->acquire(); - - watch->handle (watch->pollfd.fd, watch->user_data); - - pSalData->m_pInstance->GetYieldMutex()->release(); - - return TRUE; -} - -static void -sal_source_finalize (GSource*) -{ -} - -static GSourceFuncs sal_source_watch_funcs = { - sal_source_prepare, - sal_source_check, - sal_source_dispatch, - sal_source_finalize, - NULL, - NULL -}; - -static GSource * -sal_source_create_watch (int fd, - GIOCondition condition, - YieldFunc pending, - YieldFunc handle, - gpointer user_data) -{ - GSource *source; - SalWatch *watch; - GMainContext *context = g_main_context_default (); - - source = g_source_new (&sal_source_watch_funcs, - sizeof (SalWatch)); - watch = (SalWatch *) source; - - watch->pollfd.fd = fd; - watch->pollfd.events = condition; - watch->condition = condition; - watch->pending = pending; - watch->handle = handle; - watch->user_data = user_data; - - g_source_set_can_recurse (source, TRUE); - g_source_add_poll (source, &watch->pollfd); - g_source_attach (source, context); - - return source; -} - -} // extern "C" - -void GtkXLib::Insert( int nFD, - void *data, - YieldFunc pending, - YieldFunc, - YieldFunc handle ) -{ - GSource *source = sal_source_create_watch - ( nFD, (GIOCondition) ((G_IO_IN|G_IO_PRI) | - (G_IO_ERR|G_IO_HUP|G_IO_NVAL)), - pending, handle, data ); - m_aSources.push_back( source ); -} - -void GtkXLib::Remove( int nFD ) -{ - ::std::list< GSource * >::iterator it; - - for (it = m_aSources.begin(); it != m_aSources.end(); ++it) - { - SalWatch *watch = (SalWatch *) *it; - - if (watch->pollfd.fd == nFD) - { - m_aSources.erase( it ); - - g_source_destroy ((GSource *)watch); - g_source_unref ((GSource *)watch); - return; - } - } -} - -/********************************************************************** - * class GtkData * - **********************************************************************/ - -GtkData::~GtkData() -{ -} - -void GtkData::Init() -{ - pXLib_ = new GtkXLib(); - pXLib_->Init(); } diff --git a/vcl/unx/gtk/app/gtkinst.cxx b/vcl/unx/gtk/app/gtkinst.cxx index dc52d963ed75..25056cad874d 100644 --- a/vcl/unx/gtk/app/gtkinst.cxx +++ b/vcl/unx/gtk/app/gtkinst.cxx @@ -421,2 +421,3 @@ SalVirtualDevice* GtkInstance::CreateVirtualDevice( SalGraphics *pG, #if GTK_CHECK_VERSION(3,0,0) + (void)pG; (void) pGd; SvpSalVirtualDevice* pNew = new SvpSalVirtualDevice( nBitCount ); @@ -438,2 +439,11 @@ SalBitmap* GtkInstance::CreateSalBitmap() +SalTimer* GtkInstance::CreateSalTimer() +{ +#if GTK_CHECK_VERSION(3,0,0) + return new GtkSalTimer(); +#else + return X11SalInstance::CreateSalTimer(); +#endif +} + // FIXME: these should all be in a more generic, shared base of unix's salinst.cxx @@ -488,3 +498,3 @@ void GtkInstance::Yield( bool bWait, bool bHandleAllCurrentEvents ) { - GetGtkSalData()->GetLib()->Yield( bWait, bHandleAllCurrentEvents ); + GetGtkSalData()->Yield( bWait, bHandleAllCurrentEvents ); } diff --git a/vcl/unx/gtk/window/gtkframe.cxx b/vcl/unx/gtk/window/gtkframe.cxx index e48aa15cbfea..cd5059a0b13c 100644 --- a/vcl/unx/gtk/window/gtkframe.cxx +++ b/vcl/unx/gtk/window/gtkframe.cxx @@ -443,2 +443,3 @@ GtkSalFrame::GtkSalFrame( SalFrame* pParent, sal_uLong nStyle ) getDisplay()->registerFrame( this ); + m_nIdleFullScreen = 0; m_nDuringRender = 0; @@ -459,2 +460,3 @@ GtkSalFrame::GtkSalFrame( SystemParentData* pSysData ) m_bDefaultSize = true; + m_nIdleFullScreen = 0; Init( pSysData ); @@ -464,2 +466,4 @@ GtkSalFrame::~GtkSalFrame() { + g_idle_remove_by_data (this); + for( unsigned int i = 0; i < SAL_N_ELEMENTS(m_aGraphics); ++i ) @@ -642,5 +646,5 @@ void GtkSalFrame::InitCommon() //system data - GtkSalDisplay* pDisp = GetGtkSalData()->GetDisplay(); m_aSystemData.nSize = sizeof( SystemChildData ); #if !GTK_CHECK_VERSION(3,0,0) + GtkSalDisplay* pDisp = GetGtkSalData()->GetDisplay(); m_aSystemData.pDisplay = pDisp->GetDisplay(); @@ -2337,3 +2341,3 @@ GdkDisplay *GtkSalFrame::getGdkDisplay() { - return GetGtkSalData()->pDisplay->GetGdkDisplay(); + return GetGtkSalData()->GetGdkDisplay(); } @@ -2342,3 +2346,3 @@ GtkSalDisplay *GtkSalFrame::getDisplay() { - return GetGtkSalData()->pDisplay; + return GetGtkSalData()->GetDisplay(); } @@ -3182,4 +3186,7 @@ gboolean GtkSalFrame::signalFocus( GtkWidget*, GdkEventFocus* pEvent, gpointer f -IMPL_LINK( GtkSalFrame, ImplDelayedFullScreenHdl, void*, EMPTYARG ) +extern "C" { +gboolean implDelayedFullScreenHdl (void *) { + g_warning ("FIXME: nasty delayed full-screen hdl workaround !"); +#if 0 #if !GTK_CHECK_VERSION(3,0,0) @@ -3212,3 +3219,5 @@ IMPL_LINK( GtkSalFrame, ImplDelayedFullScreenHdl, void*, EMPTYARG ) #endif - return 0; +#endif + return FALSE; +} } @@ -3226,3 +3235,3 @@ gboolean GtkSalFrame::signalMap( GtkWidget*, GdkEvent*, gpointer frame ) */ - Application::PostUserEvent( LINK( pThis, GtkSalFrame, ImplDelayedFullScreenHdl ) ); + g_idle_add_full( G_PRIORITY_HIGH, implDelayedFullScreenHdl, pThis, NULL ); } |