[Libreoffice-commits] core.git: vcl/inc vcl/unx

vjinoch elianoss at gmail.com
Fri Apr 12 10:04:52 PDT 2013


 vcl/inc/unx/gtk/gtkinst.hxx           |   22 ++--------------------
 vcl/unx/gtk/app/gtkdata.cxx           |    2 --
 vcl/unx/gtk/window/gloactiongroup.cxx |    4 ----
 vcl/unx/gtk/window/gtkframe.cxx       |   25 -------------------------
 vcl/unx/gtk/window/gtkobject.cxx      |    3 ---
 vcl/unx/gtk/window/gtksalmenu.cxx     |    2 --
 6 files changed, 2 insertions(+), 56 deletions(-)

New commits:
commit a1cd39a17216d78b4f335e6301786e205be14d0d
Author: vjinoch <elianoss at gmail.com>
Date:   Fri Apr 12 17:19:44 2013 +0200

    fdo#60690 - Remove all calls t GTK_YIELD_GRAB because it does nothing.
    
    Change-Id: I76e76ec5fc85d8e1fd673a45b3e54163ca7643f3

diff --git a/vcl/inc/unx/gtk/gtkinst.hxx b/vcl/inc/unx/gtk/gtkinst.hxx
index eb65318..6e35833 100644
--- a/vcl/inc/unx/gtk/gtkinst.hxx
+++ b/vcl/inc/unx/gtk/gtkinst.hxx
@@ -39,36 +39,18 @@ class GenPspGraphics;
 class GtkYieldMutex : public SalYieldMutex
 {
     std::list<sal_uLong> aYieldStack;
+
 public:
                         GtkYieldMutex();
     virtual void        acquire();
     virtual void        release();
     virtual sal_Bool    tryToAcquire()  { return SalYieldMutex::tryToAcquire(); }
 
-    virtual int         Grab()          { return 0; };
-    virtual void        Ungrab(int )    {};
-
     void ThreadsEnter();
     void ThreadsLeave();
-
-    class GtkYieldGuard
-    {
-        GtkYieldMutex*  m_pMutex;
-        int             m_nGrab;
-    public:
-        GtkYieldGuard( GtkYieldMutex* pMutex )
-                : m_pMutex( pMutex )
-        {
-            m_nGrab = m_pMutex->Grab();
-        }
-        ~GtkYieldGuard()
-        {
-            m_pMutex->Ungrab( m_nGrab );
-        }
-    };
 };
 
-#define GTK_YIELD_GRAB() GtkYieldMutex::GtkYieldGuard aLocalGtkYieldGuard( static_cast<GtkYieldMutex*>(GetSalData()->m_pInstance->GetYieldMutex()) )
+
 
 class GtkSalTimer;
 #if GTK_CHECK_VERSION(3,0,0)
diff --git a/vcl/unx/gtk/app/gtkdata.cxx b/vcl/unx/gtk/app/gtkdata.cxx
index dac0f28..59eb593 100644
--- a/vcl/unx/gtk/app/gtkdata.cxx
+++ b/vcl/unx/gtk/app/gtkdata.cxx
@@ -136,8 +136,6 @@ GdkFilterReturn GtkSalDisplay::filterGdkEvent( GdkXEvent* sys_event,
         CallEventCallback( pEvent, sizeof( XEvent ) ) )
         aFilterReturn = GDK_FILTER_REMOVE;
 
-    GTK_YIELD_GRAB();
-
     if (GetDisplay() == pEvent->xany.display )
     {
         // #i53471# gtk has no callback mechanism that lets us be notified
diff --git a/vcl/unx/gtk/window/gloactiongroup.cxx b/vcl/unx/gtk/window/gloactiongroup.cxx
index f2effd7..cce66c8 100644
--- a/vcl/unx/gtk/window/gloactiongroup.cxx
+++ b/vcl/unx/gtk/window/gloactiongroup.cxx
@@ -166,8 +166,6 @@ g_lo_action_group_perform_submenu_action (GLOActionGroup *group,
                                           const gchar    *action_name,
                                           GVariant       *state)
 {
-    GTK_YIELD_GRAB();
-
     GtkSalFrame* pFrame = group->priv->frame;
 
     if (pFrame == NULL)
@@ -239,8 +237,6 @@ g_lo_action_group_activate (GActionGroup *group,
                             const gchar  *action_name,
                             GVariant     *parameter)
 {
-    GTK_YIELD_GRAB();
-
     GLOActionGroup *lo_group = G_LO_ACTION_GROUP (group);
     GtkSalFrame *pFrame = lo_group->priv->frame;
 
diff --git a/vcl/unx/gtk/window/gtkframe.cxx b/vcl/unx/gtk/window/gtkframe.cxx
index efd6c13..5b039ff 100644
--- a/vcl/unx/gtk/window/gtkframe.cxx
+++ b/vcl/unx/gtk/window/gtkframe.cxx
@@ -2957,8 +2957,6 @@ gboolean GtkSalFrame::signalButton( GtkWidget*, GdkEventButton* pEvent, gpointer
             gdk_display_pointer_ungrab( pThis->getGdkDisplay(), GDK_CURRENT_TIME );
     }
 
-    GTK_YIELD_GRAB();
-
     if( pThis->m_bWindowIsGtkPlug &&
         pEvent->type == GDK_BUTTON_PRESS &&
         pEvent->button == 1 )
@@ -3028,8 +3026,6 @@ gboolean GtkSalFrame::signalScroll( GtkWidget*, GdkEvent* pEvent, gpointer frame
     aEvent.mnCode           = GetMouseModCode( pSEvent->state );
     aEvent.mbHorz           = (pSEvent->direction == GDK_SCROLL_LEFT || pSEvent->direction == GDK_SCROLL_RIGHT);
 
-    GTK_YIELD_GRAB();
-
     // --- RTL --- (mirror mouse pos)
     if( Application::GetSettings().GetLayoutRTL() )
         aEvent.mnX = pThis->maGeometry.nWidth-1-aEvent.mnX;
@@ -3050,9 +3046,6 @@ gboolean GtkSalFrame::signalMotion( GtkWidget*, GdkEventMotion* pEvent, gpointer
     aEvent.mnCode   = GetMouseModCode( pEvent->state );
     aEvent.mnButton = 0;
 
-
-    GTK_YIELD_GRAB();
-
     // --- RTL --- (mirror mouse pos)
     if( Application::GetSettings().GetLayoutRTL() )
         aEvent.mnX = pThis->maGeometry.nWidth-1-aEvent.mnX;
@@ -3094,7 +3087,6 @@ gboolean GtkSalFrame::signalCrossing( GtkWidget*, GdkEventCrossing* pEvent, gpoi
     aEvent.mnCode   = GetMouseModCode( pEvent->state );
     aEvent.mnButton = 0;
 
-    GTK_YIELD_GRAB();
     pThis->CallCallback( (pEvent->type == GDK_ENTER_NOTIFY) ? SALEVENT_MOUSEMOVE : SALEVENT_MOUSELEAVE, &aEvent );
 
     return sal_True;
@@ -3245,8 +3237,6 @@ gboolean GtkSalFrame::signalDraw( GtkWidget*, cairo_t *cr, gpointer frame )
     double x1 = 0.0, y1 = 0.0, x2 = 0.0, y2 = 0.0;
     cairo_clip_extents (cr, &x1, &y1, &x2, &y2);
 
-    GTK_YIELD_GRAB();
-
     if (debugQueuePureRedraw > 0)
     {
         debugQueuePureRedraw--;
@@ -3289,7 +3279,6 @@ gboolean GtkSalFrame::signalExpose( GtkWidget*, GdkEventExpose* pEvent, gpointer
 
     struct SalPaintEvent aEvent( pEvent->area.x, pEvent->area.y, pEvent->area.width, pEvent->area.height );
 
-    GTK_YIELD_GRAB();
     pThis->CallCallback( SALEVENT_PAINT, &aEvent );
 
     return sal_False;
@@ -3299,8 +3288,6 @@ gboolean GtkSalFrame::signalFocus( GtkWidget*, GdkEventFocus* pEvent, gpointer f
 {
     GtkSalFrame* pThis = (GtkSalFrame*)frame;
 
-    GTK_YIELD_GRAB();
-
     X11SalInstance *pSalInstance =
         static_cast< X11SalInstance* >(GetSalData()->m_pInstance);
 
@@ -3336,8 +3323,6 @@ gboolean GtkSalFrame::signalMap( GtkWidget *pWidget, GdkEvent*, gpointer frame )
 {
     GtkSalFrame* pThis = (GtkSalFrame*)frame;
 
-    GTK_YIELD_GRAB();
-
     bool bSetFocus = pThis->m_bSetFocusOnMap;
     pThis->m_bSetFocusOnMap = false;
 
@@ -3365,7 +3350,6 @@ gboolean GtkSalFrame::signalUnmap( GtkWidget*, GdkEvent*, gpointer frame )
 {
     GtkSalFrame* pThis = (GtkSalFrame*)frame;
 
-    GTK_YIELD_GRAB();
     pThis->CallCallback( SALEVENT_RESIZE, NULL );
 
     return sal_False;
@@ -3445,7 +3429,6 @@ gboolean GtkSalFrame::signalConfigure( GtkWidget*, GdkEventConfigure* pEvent, gp
     if( bSized )
         pThis->AllocateFrame();
 
-    GTK_YIELD_GRAB();
     if( bMoved && bSized )
         pThis->CallCallback( SALEVENT_MOVERESIZE, NULL );
     else if( bMoved )
@@ -3467,7 +3450,6 @@ gboolean GtkSalFrame::signalKey( GtkWidget*, GdkEventKey* pEvent, gpointer frame
         if( pThis->m_pIMHandler->handleKeyEvent( pEvent ) )
             return sal_True;
     }
-    GTK_YIELD_GRAB();
 
     // handle modifiers
     if( pEvent->keyval == GDK_Shift_L || pEvent->keyval == GDK_Shift_R ||
@@ -3577,7 +3559,6 @@ gboolean GtkSalFrame::signalDelete( GtkWidget*, GdkEvent*, gpointer frame )
 {
     GtkSalFrame* pThis = (GtkSalFrame*)frame;
 
-    GTK_YIELD_GRAB();
     pThis->CallCallback( SALEVENT_CLOSE, NULL );
 
     return sal_True;
@@ -3948,10 +3929,7 @@ void GtkSalFrame::IMHandler::signalIMCommit( GtkIMContext* CONTEXT_ARG, gchar* p
 
     SolarMutexGuard aGuard;
     vcl::DeletionListener aDel( pThis->m_pFrame );
-    // open a block that will end the GTK_YIELD_GRAB before calling preedit changed again
     {
-        GTK_YIELD_GRAB();
-
         const bool bWasPreedit =
             (pThis->m_aInputEvent.mpTextAttr != 0) ||
             pThis->m_bPreeditJustChanged;
@@ -4115,8 +4093,6 @@ void GtkSalFrame::IMHandler::signalIMPreeditChanged( GtkIMContext*, gpointer im_
     g_free( pText );
     pango_attr_list_unref( pAttrs );
 
-    GTK_YIELD_GRAB();
-
     SolarMutexGuard aGuard;
     vcl::DeletionListener aDel( pThis->m_pFrame );
 
@@ -4134,7 +4110,6 @@ void GtkSalFrame::IMHandler::signalIMPreeditStart( GtkIMContext*, gpointer /*im_
 void GtkSalFrame::IMHandler::signalIMPreeditEnd( GtkIMContext*, gpointer im_handler )
 {
     GtkSalFrame::IMHandler* pThis = (GtkSalFrame::IMHandler*)im_handler;
-    GTK_YIELD_GRAB();
 
     pThis->m_bPreeditJustChanged = true;
 
diff --git a/vcl/unx/gtk/window/gtkobject.cxx b/vcl/unx/gtk/window/gtkobject.cxx
index 809c212..b0fa39a 100644
--- a/vcl/unx/gtk/window/gtkobject.cxx
+++ b/vcl/unx/gtk/window/gtkobject.cxx
@@ -178,7 +178,6 @@ gboolean GtkSalObject::signalButton( GtkWidget*, GdkEventButton* pEvent, gpointe
 
     if( pEvent->type == GDK_BUTTON_PRESS )
     {
-        GTK_YIELD_GRAB();
         pThis->CallCallback( SALOBJ_EVENT_TOTOP, NULL );
     }
 
@@ -189,8 +188,6 @@ gboolean GtkSalObject::signalFocus( GtkWidget*, GdkEventFocus* pEvent, gpointer
 {
     GtkSalObject* pThis = (GtkSalObject*)object;
 
-    GTK_YIELD_GRAB();
-
     pThis->CallCallback( pEvent->in ? SALOBJ_EVENT_GETFOCUS : SALOBJ_EVENT_LOSEFOCUS, NULL );
 
     return FALSE;
diff --git a/vcl/unx/gtk/window/gtksalmenu.cxx b/vcl/unx/gtk/window/gtksalmenu.cxx
index 688fda4..5ca2e47 100644
--- a/vcl/unx/gtk/window/gtksalmenu.cxx
+++ b/vcl/unx/gtk/window/gtksalmenu.cxx
@@ -403,7 +403,6 @@ GtkSalMenu::GtkSalMenu( sal_Bool bMenuBar ) :
 GtkSalMenu::~GtkSalMenu()
 {
     SolarMutexGuard aGuard;
-    //GTK_YIELD_GRAB();
 
     if ( mbMenuBar == sal_True )
     {
@@ -457,7 +456,6 @@ void GtkSalMenu::SetSubMenu( SalMenuItem* pSalMenuItem, SalMenu* pSubMenu, unsig
 void GtkSalMenu::SetFrame( const SalFrame* pFrame )
 {
     SolarMutexGuard aGuard;
-    GTK_YIELD_GRAB();
 
     assert(mbMenuBar);
     SAL_INFO("vcl.unity", "GtkSalMenu set to frame");


More information about the Libreoffice-commits mailing list