[Libreoffice-commits] .: 9 commits -

Jan Holesovsky kendy at kemper.freedesktop.org
Tue Jun 7 07:40:39 PDT 2011


 0 files changed

New commits:
commit a0887d92c04bc52b0085d9d564ec57b37dbba9b7
Merge: 52c9f63... 125a64c...
Author: Jan Holesovsky <kendy at suse.cz>
Date:   Tue Jun 7 16:40:16 2011 +0200

    Merge remote-tracking branch 'origin/libreoffice-3-4'
    
    Conflicts:
    	tools/source/fsys/urlobj.cxx
    	vcl/source/window/toolbox.cxx

commit 125a64ce0a9fb96093b42e9960b8dd9cd17a3367
Author: Michael Meeks <michael.meeks at novell.com>
Date:   Tue May 24 14:50:19 2011 +0100

    revert previous patch for now.

diff --git a/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx b/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx
index 292d632..31980a0 100644
--- a/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx
+++ b/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx
@@ -1082,12 +1082,11 @@ sal_Bool GtkSalGraphics::getNativeControlRegion(  ControlType nType,
     return( returnVal );
 }
 
+
 /************************************************************************
  * Individual control drawing functions
  ************************************************************************/
-
-sal_Bool GtkSalGraphics::NWPaintGTKButtonReal(
-            GtkWidget* button,
+sal_Bool GtkSalGraphics::NWPaintGTKButton(
             GdkDrawable* gdkDrawable,
             ControlType, ControlPart,
             const Rectangle& rControlRectangle,
@@ -1107,33 +1106,18 @@ sal_Bool GtkSalGraphics::NWPaintGTKButtonReal(
     GdkRectangle	clipRect;
 
     NWEnsureGTKButton( m_nScreen );
-    NWEnsureGTKToolbar( m_nScreen );
     NWConvertVCLStateToGTKState( nState, &stateType, &shadowType );
-    NWSetWidgetState( gWidgetData[m_nScreen].gBtnWidget, nState, stateType );
 
     x = rControlRectangle.Left();
     y = rControlRectangle.Top();
     w = rControlRectangle.GetWidth();
     h = rControlRectangle.GetHeight();
 
-    gint internal_padding = 0;
-    if(GTK_IS_TOOL_ITEM(button))
-    {
-        gtk_widget_style_get (GTK_WIDGET (gWidgetData[m_nScreen].gToolbarWidget),
-                "internal-padding", &internal_padding,
-                NULL);
-        x += internal_padding/2;
-        w -= internal_padding;
-        stateType = GTK_STATE_PRELIGHT;
-    }
-
     // Grab some button style attributes
-    gtk_widget_style_get( button,    "focus-line-width",    &focusWidth,
-                                "focus-padding",     &focusPad,
-                                 "interior_focus",    &interiorFocus,
-                                (char *)NULL );
-    gtk_widget_style_get( gWidgetData[m_nScreen].gBtnWidget,
-                                "default_border",    &pBorder,
+    gtk_widget_style_get( gWidgetData[m_nScreen].gBtnWidget,	"focus-line-width",	&focusWidth,
+                                "focus-padding", 	&focusPad,
+                                 "interior_focus",	&interiorFocus,
+                                "default_border",	&pBorder,
                                 (char *)NULL );
 
     // Make sure the border values exist, otherwise use some defaults
@@ -1148,6 +1132,8 @@ sal_Bool GtkSalGraphics::NWPaintGTKButtonReal(
     if ( (w < 16) || (h < 16) )
         bDrawFocus = sal_False;
 
+    NWSetWidgetState( gWidgetData[m_nScreen].gBtnWidget, nState, stateType );
+
     gint xi = x, yi = y, wi = w, hi = h;
     if ( (nState & CTRL_STATE_DEFAULT) && bDrawFocus )
     {
@@ -1164,6 +1150,7 @@ sal_Bool GtkSalGraphics::NWPaintGTKButtonReal(
         wi -= 2 * (focusWidth + focusPad);
         hi -= 2 * (focusWidth + focusPad);
     }
+
     for( clipList::const_iterator it = rClipList.begin(); it != rClipList.end(); ++it)
     {
         clipRect.x = it->Left();
@@ -1172,50 +1159,27 @@ sal_Bool GtkSalGraphics::NWPaintGTKButtonReal(
         clipRect.height = it->GetHeight();
 
         // Buttons must paint opaque since some themes have alpha-channel enabled buttons
-        if(button == gWidgetData[m_nScreen].gToolbarButtonWidget)
-        {
-            gtk_paint_box( gWidgetData[m_nScreen].gToolbarWidget->style, gdkDrawable, GTK_STATE_NORMAL, GTK_SHADOW_NONE,
-                                &clipRect, gWidgetData[m_nScreen].gToolbarWidget, "toolbar", x, y, w, h );
-        }
-        else
+        gtk_paint_flat_box( m_pWindow->style, gdkDrawable, GTK_STATE_NORMAL, GTK_SHADOW_NONE,
+                            &clipRect, m_pWindow, "base", x, y, w, h );
+
+        if ( (nState & CTRL_STATE_DEFAULT) && (GTK_BUTTON(gWidgetData[m_nScreen].gBtnWidget)->relief == GTK_RELIEF_NORMAL) )
         {
-            gtk_paint_box( m_pWindow->style, gdkDrawable, GTK_STATE_NORMAL, GTK_SHADOW_NONE,
-                                &clipRect, m_pWindow, "base", x, y, w, h );
+            gtk_paint_box( gWidgetData[m_nScreen].gBtnWidget->style, gdkDrawable, GTK_STATE_NORMAL, GTK_SHADOW_IN,
+                           &clipRect, gWidgetData[m_nScreen].gBtnWidget, "buttondefault", x, y, w, h );
         }
 
-        if ( (nState & CTRL_STATE_DEFAULT) && GTK_IS_BUTTON(button) )
+        if ( (GTK_BUTTON(gWidgetData[m_nScreen].gBtnWidget)->relief != GTK_RELIEF_NONE)
+            || (nState & CTRL_STATE_PRESSED)
+            || (nState & CTRL_STATE_ROLLOVER) )
         {
-            gtk_paint_box( button->style, gdkDrawable, GTK_STATE_NORMAL, GTK_SHADOW_IN,
-                           &clipRect, button, "buttondefault", x, y, w, h );
+            gtk_paint_box( gWidgetData[m_nScreen].gBtnWidget->style, gdkDrawable, stateType, shadowType,
+                           &clipRect, gWidgetData[m_nScreen].gBtnWidget, "button", xi, yi, wi, hi );
         }
-        /* don't draw "button", because it can be a tool_button, and
-         * it causes some weird things, so, the default button is
-         * just fine */
-        gtk_paint_box( gWidgetData[m_nScreen].gBtnWidget->style, gdkDrawable, stateType, shadowType,
-                       &clipRect, gWidgetData[m_nScreen].gBtnWidget, "button", xi, yi, wi, hi );
     }
 
     return( sal_True );
 }
 
-sal_Bool GtkSalGraphics::NWPaintGTKButton(
-            GdkDrawable* gdkDrawable,
-            ControlType type, ControlPart part,
-            const Rectangle& rControlRectangle,
-            const clipList& rClipList,
-            ControlState nState, const ImplControlValue& value,
-            const OUString& string)
-{
-        return NWPaintGTKButtonReal(
-            gWidgetData[m_nScreen].gBtnWidget,
-            gdkDrawable,
-            type, part,
-            rControlRectangle,
-            rClipList,
-            nState, value,
-            string );
-}
-
 static Rectangle NWGetButtonArea( int nScreen,
                                   ControlType, ControlPart, Rectangle aAreaRect, ControlState nState,
                                   const ImplControlValue&, const OUString& )
@@ -1900,10 +1864,7 @@ static void NWPaintOneEditBox(	int nScreen,
     }
     NWSetWidgetState( widget, nState, stateType );
 
-    /* This doesn't seem to be necessary, and it causes some weird glitch in
-     * murrine (with the elementary theme for instance) but it fixes some issue
-     * with Orta, so... */
-    gtk_paint_flat_box( pBGWidget->style, gdkDrawable, stateType, GTK_SHADOW_NONE,
+    gtk_paint_box( pBGWidget->style, gdkDrawable, stateType, GTK_SHADOW_NONE,
                         gdkRect, pBGWidget, "entry_bg",
                         aEditBoxRect.Left(), aEditBoxRect.Top(),
                         aEditBoxRect.GetWidth(), aEditBoxRect.GetHeight() );
@@ -2471,7 +2432,7 @@ sal_Bool GtkSalGraphics::NWPaintGTKToolbar(
             const Rectangle& rControlRectangle,
             const clipList& rClipList,
             ControlState nState, const ImplControlValue& aValue,
-            const OUString& string)
+            const OUString& )
 {
     GtkStateType	stateType;
     GtkShadowType	shadowType;
@@ -2529,12 +2490,22 @@ sal_Bool GtkSalGraphics::NWPaintGTKToolbar(
     // handle button
     else if( nPart == PART_BUTTON )
     {
-        bPaintButton = (nState & CTRL_STATE_PRESSED)
+        bPaintButton =
+            (GTK_BUTTON(pButtonWidget)->relief != GTK_RELIEF_NONE)
+            || (nState & CTRL_STATE_PRESSED)
             || (nState & CTRL_STATE_ROLLOVER);
         if( aValue.getTristateVal() == BUTTONVALUE_ON )
         {
-                if(!(nState & CTRL_STATE_ROLLOVER))
-            nState |= CTRL_STATE_PRESSED;
+            pButtonWidget = gWidgetData[m_nScreen].gToolbarToggleWidget;
+            shadowType = GTK_SHADOW_IN;
+            stateType = GTK_STATE_ACTIVE;
+            // special case stateType value for depressed toggle buttons
+            // cf. gtk+/gtk/gtktogglebutton.c (gtk_toggle_button_update_state)
+            if( (nState & (CTRL_STATE_ROLLOVER|CTRL_STATE_PRESSED)) )
+            {
+                stateType = GTK_STATE_PRELIGHT;
+                shadowType = GTK_SHADOW_OUT;
+            }
             bPaintButton = true;
         }
         else
@@ -2542,81 +2513,78 @@ sal_Bool GtkSalGraphics::NWPaintGTKToolbar(
 
         NWSetWidgetState( pButtonWidget, nState, stateType );
         gtk_widget_ensure_style( pButtonWidget );
-        if(bPaintButton)
-            NWPaintGTKButtonReal(pButtonWidget, gdkDrawable, 0, 0, rControlRectangle, rClipList, nState, aValue, string);
     }
 
-    if( nPart != PART_BUTTON )
+    for( clipList::const_iterator it = rClipList.begin(); it != rClipList.end(); ++it )
     {
-        for( clipList::const_iterator it = rClipList.begin(); it != rClipList.end(); ++it )
-        {
-            clipRect.x = it->Left();
-            clipRect.y = it->Top();
-            clipRect.width = it->GetWidth();
-            clipRect.height = it->GetHeight();
+        clipRect.x = it->Left();
+        clipRect.y = it->Top();
+        clipRect.width = it->GetWidth();
+        clipRect.height = it->GetHeight();
 
-            // draw toolbar
-            if( nPart == PART_DRAW_BACKGROUND_HORZ || nPart == PART_DRAW_BACKGROUND_VERT )
+        // draw toolbar
+        if( nPart == PART_DRAW_BACKGROUND_HORZ || nPart == PART_DRAW_BACKGROUND_VERT )
+        {
+            gtk_paint_flat_box( gWidgetData[m_nScreen].gToolbarWidget->style,
+                                gdkDrawable,
+                                (GtkStateType)GTK_STATE_NORMAL,
+                                GTK_SHADOW_NONE,
+                                &clipRect,
+                                gWidgetData[m_nScreen].gToolbarWidget,
+                                "base",
+                                x, y, w, h );
+            gtk_paint_box( gWidgetData[m_nScreen].gToolbarWidget->style,
+                           gdkDrawable,
+                           stateType,
+                           shadowType,
+                           &clipRect,
+                           gWidgetData[m_nScreen].gToolbarWidget,
+                           "toolbar",
+                           x, y, w, h );
+        }
+        // draw grip
+        else if( nPart == PART_THUMB_HORZ || nPart == PART_THUMB_VERT )
+        {
+            gtk_paint_handle( gWidgetData[m_nScreen].gHandleBoxWidget->style,
+                              gdkDrawable,
+                              GTK_STATE_NORMAL,
+                              GTK_SHADOW_OUT,
+                              &clipRect,
+                              gWidgetData[m_nScreen].gHandleBoxWidget,
+                              "handlebox",
+                              g_x, g_y, g_w, g_h,
+                              nPart == PART_THUMB_HORZ ?
+                              GTK_ORIENTATION_HORIZONTAL :
+                              GTK_ORIENTATION_VERTICAL
+                              );
+        }
+        // draw button
+        else if( nPart == PART_BUTTON )
+        {
+            if( bPaintButton )
             {
-                gtk_paint_flat_box( gWidgetData[m_nScreen].gToolbarWidget->style,
-                                    gdkDrawable,
-                                    (GtkStateType)GTK_STATE_NORMAL,
-                                    GTK_SHADOW_NONE,
-                                    &clipRect,
-                                    gWidgetData[m_nScreen].gToolbarWidget,
-                                    "base",
-                                    x, y, w, h );
-                gtk_paint_box( gWidgetData[m_nScreen].gToolbarWidget->style,
-                               gdkDrawable,
+                gtk_paint_box( pButtonWidget->style, gdkDrawable,
                                stateType,
                                shadowType,
                                &clipRect,
-                               gWidgetData[m_nScreen].gToolbarWidget,
-                               "toolbar",
-                               x, y, w, h );
-            }
-            // draw grip
-            else if( nPart == PART_THUMB_HORZ || nPart == PART_THUMB_VERT )
-            {
-                gtk_paint_handle( gWidgetData[m_nScreen].gHandleBoxWidget->style,
-                                  gdkDrawable,
-                                  GTK_STATE_NORMAL,
-                                  GTK_SHADOW_OUT,
-                                  &clipRect,
-                                  gWidgetData[m_nScreen].gHandleBoxWidget,
-                                  "handlebox",
-                                  g_x, g_y, g_w, g_h,
-                                  nPart == PART_THUMB_HORZ ?
-                                  GTK_ORIENTATION_HORIZONTAL :
-                                  GTK_ORIENTATION_VERTICAL
-                                  );
-            }
-            else if(nPart == PART_SEPARATOR )
-            {
-                gint separator_height, separator_width, wide_separators;
-
-                gtk_widget_style_get (gWidgetData[m_nScreen].gVSeparator,
-                                      "wide-separators",  &wide_separators,
-                                      "separator-width",  &separator_width,
-                                      "separator-height", &separator_height,
-                                      NULL);
-                if (wide_separators)
-                    gtk_paint_box (gWidgetData[m_nScreen].gVSeparator->style, gdkDrawable,
-                               GTK_STATE_NORMAL, GTK_SHADOW_ETCHED_OUT,
-                               &clipRect, gWidgetData[m_nScreen].gVSeparator, "vseparator",
-                               x + (w - separator_width) / 2,
-                               y + 7,
-                               separator_width,
-                               h - 14);
-                else
-                    gtk_paint_vline (gWidgetData[m_nScreen].gVSeparator->style, gdkDrawable,
-                                 GTK_STATE_NORMAL,
-                                 &clipRect, gWidgetData[m_nScreen].gVSeparator, "vseparator",
-                                 y + 7,
-                                 y + h - 7,
-                                 x + w/2 - 1);
+                               pButtonWidget, "button", x, y, w, h );
             }
         }
+        else if(nPart == PART_SEPARATOR )
+        {
+            gtk_paint_vline( gWidgetData[m_nScreen].gVSeparator->style,
+                              gdkDrawable,
+                              GTK_STATE_NORMAL,
+                              &clipRect,
+                              gWidgetData[m_nScreen].gVSeparator,
+                              "vseparator",
+                              y + 4, y + h - 8 /* -2 and -4 is a dirty
+                                                * hack, to fit most gtk
+                                                * style, but it must be
+                                                * fixed, FIXME */,
+                              x
+                              );
+        }
     }
 
     return( sal_True );
@@ -3622,8 +3590,8 @@ void GtkSalGraphics::updateSettings( AllSettings& rSettings )
 GdkPixmap* GtkSalGraphics::NWGetPixmapFromScreen( Rectangle srcRect )
 {
     // Create a new pixmap to hold the composite of the window background and the control
-    GdkPixmap * pPixmap        = gdk_pixmap_new( GDK_DRAWABLE(GetGdkWindow()), srcRect.GetWidth(), srcRect.GetHeight(), -1 );
-    GdkGC *     pPixmapGC      = gdk_gc_new( pPixmap );
+    GdkPixmap * pPixmap		= gdk_pixmap_new( GDK_DRAWABLE(GetGdkWindow()), srcRect.GetWidth(), srcRect.GetHeight(), -1 );
+    GdkGC *	 pPixmapGC	= gdk_gc_new( pPixmap );
 
     if( !pPixmap || !pPixmapGC )
     {
@@ -3922,9 +3890,9 @@ static void NWEnsureGTKToolbar( int nScreen )
     {
         gWidgetData[nScreen].gToolbarWidget = gtk_toolbar_new();
         NWAddWidgetToCacheWindow( gWidgetData[nScreen].gToolbarWidget, nScreen );
-        gWidgetData[nScreen].gToolbarButtonWidget = GTK_WIDGET(gtk_button_new());
-        gWidgetData[nScreen].gToolbarToggleWidget = GTK_WIDGET(gtk_toggle_tool_button_new());
-        gWidgetData[nScreen].gVSeparator = GTK_WIDGET(gtk_separator_tool_item_new());
+        gWidgetData[nScreen].gToolbarButtonWidget = gtk_button_new();
+        gWidgetData[nScreen].gToolbarToggleWidget = gtk_toggle_button_new();
+        gWidgetData[nScreen].gVSeparator = gtk_vseparator_new();
         NWAddWidgetToCacheWindow( gWidgetData[nScreen].gVSeparator, nScreen );
 
         GtkReliefStyle aRelief = GTK_RELIEF_NORMAL;
diff --git a/vcl/unx/inc/plugins/gtk/gtkgdi.hxx b/vcl/unx/inc/plugins/gtk/gtkgdi.hxx
index 4e4091c..2aaafc5 100644
--- a/vcl/unx/inc/plugins/gtk/gtkgdi.hxx
+++ b/vcl/unx/inc/plugins/gtk/gtkgdi.hxx
@@ -95,11 +95,6 @@ protected:
     GdkPixmap* NWGetPixmapFromScreen( Rectangle srcRect );
     sal_Bool NWRenderPixmapToScreen( GdkPixmap*	pPixmap, Rectangle dstRect );
 
-    sal_Bool NWPaintGTKButtonReal( GtkWidget* button, GdkDrawable* gdkDrawable, ControlType nType, ControlPart nPart,
-                           const Rectangle& rControlRectangle,
-                           const clipList& rClipList,
-                           ControlState nState, const ImplControlValue& aValue,
-                           const OUString& rCaption );
     sal_Bool NWPaintGTKButton( GdkDrawable* gdkDrawable, ControlType nType, ControlPart nPart,
                            const Rectangle& rControlRectangle,
                            const clipList& rClipList,
commit dd6e9386b157fb2e9fca4ffb4c69ebfc069ccf90
Author: Lucas Baudin <xapantu at gmail.com>
Date:   Sun May 22 11:04:58 2011 +0200

    Fix some visual glitch with GTK+
    
    - Fix separators, they weren't properly aligned, and they didn't use
      gtk_paint_box when needed some gtk themes/engine draw lines with box ^^
      (for 3d appearance for instance)
    - Fix pressed toolbar buttons state: it wasn't drawn correctly
    - Fix toolbar buttons background: window background was paint, but the
      background was the toolbar, so, now, the background of the toolbar is paint
    - Use gtk_paint_box instead of gtk_paint_flat_box for buttondefault, it wasn't
      correct and caused some weird things in the corners
    - Code cleanup: remove a function call which set the widgets flags, it is
      useless (and could cause some segfaults) since we must specify widget state
      and shadow in gtk_paint_(flat_)box).
    - Code cleanup: remove duplicated code, toolbar button are now drawn using the
      same function as normal buttons

diff --git a/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx b/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx
index 31980a0..292d632 100644
--- a/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx
+++ b/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx
@@ -1082,11 +1082,12 @@ sal_Bool GtkSalGraphics::getNativeControlRegion(  ControlType nType,
     return( returnVal );
 }
 
-
 /************************************************************************
  * Individual control drawing functions
  ************************************************************************/
-sal_Bool GtkSalGraphics::NWPaintGTKButton(
+
+sal_Bool GtkSalGraphics::NWPaintGTKButtonReal(
+            GtkWidget* button,
             GdkDrawable* gdkDrawable,
             ControlType, ControlPart,
             const Rectangle& rControlRectangle,
@@ -1106,18 +1107,33 @@ sal_Bool GtkSalGraphics::NWPaintGTKButton(
     GdkRectangle	clipRect;
 
     NWEnsureGTKButton( m_nScreen );
+    NWEnsureGTKToolbar( m_nScreen );
     NWConvertVCLStateToGTKState( nState, &stateType, &shadowType );
+    NWSetWidgetState( gWidgetData[m_nScreen].gBtnWidget, nState, stateType );
 
     x = rControlRectangle.Left();
     y = rControlRectangle.Top();
     w = rControlRectangle.GetWidth();
     h = rControlRectangle.GetHeight();
 
+    gint internal_padding = 0;
+    if(GTK_IS_TOOL_ITEM(button))
+    {
+        gtk_widget_style_get (GTK_WIDGET (gWidgetData[m_nScreen].gToolbarWidget),
+                "internal-padding", &internal_padding,
+                NULL);
+        x += internal_padding/2;
+        w -= internal_padding;
+        stateType = GTK_STATE_PRELIGHT;
+    }
+
     // Grab some button style attributes
-    gtk_widget_style_get( gWidgetData[m_nScreen].gBtnWidget,	"focus-line-width",	&focusWidth,
-                                "focus-padding", 	&focusPad,
-                                 "interior_focus",	&interiorFocus,
-                                "default_border",	&pBorder,
+    gtk_widget_style_get( button,    "focus-line-width",    &focusWidth,
+                                "focus-padding",     &focusPad,
+                                 "interior_focus",    &interiorFocus,
+                                (char *)NULL );
+    gtk_widget_style_get( gWidgetData[m_nScreen].gBtnWidget,
+                                "default_border",    &pBorder,
                                 (char *)NULL );
 
     // Make sure the border values exist, otherwise use some defaults
@@ -1132,8 +1148,6 @@ sal_Bool GtkSalGraphics::NWPaintGTKButton(
     if ( (w < 16) || (h < 16) )
         bDrawFocus = sal_False;
 
-    NWSetWidgetState( gWidgetData[m_nScreen].gBtnWidget, nState, stateType );
-
     gint xi = x, yi = y, wi = w, hi = h;
     if ( (nState & CTRL_STATE_DEFAULT) && bDrawFocus )
     {
@@ -1150,7 +1164,6 @@ sal_Bool GtkSalGraphics::NWPaintGTKButton(
         wi -= 2 * (focusWidth + focusPad);
         hi -= 2 * (focusWidth + focusPad);
     }
-
     for( clipList::const_iterator it = rClipList.begin(); it != rClipList.end(); ++it)
     {
         clipRect.x = it->Left();
@@ -1159,27 +1172,50 @@ sal_Bool GtkSalGraphics::NWPaintGTKButton(
         clipRect.height = it->GetHeight();
 
         // Buttons must paint opaque since some themes have alpha-channel enabled buttons
-        gtk_paint_flat_box( m_pWindow->style, gdkDrawable, GTK_STATE_NORMAL, GTK_SHADOW_NONE,
-                            &clipRect, m_pWindow, "base", x, y, w, h );
-
-        if ( (nState & CTRL_STATE_DEFAULT) && (GTK_BUTTON(gWidgetData[m_nScreen].gBtnWidget)->relief == GTK_RELIEF_NORMAL) )
+        if(button == gWidgetData[m_nScreen].gToolbarButtonWidget)
+        {
+            gtk_paint_box( gWidgetData[m_nScreen].gToolbarWidget->style, gdkDrawable, GTK_STATE_NORMAL, GTK_SHADOW_NONE,
+                                &clipRect, gWidgetData[m_nScreen].gToolbarWidget, "toolbar", x, y, w, h );
+        }
+        else
         {
-            gtk_paint_box( gWidgetData[m_nScreen].gBtnWidget->style, gdkDrawable, GTK_STATE_NORMAL, GTK_SHADOW_IN,
-                           &clipRect, gWidgetData[m_nScreen].gBtnWidget, "buttondefault", x, y, w, h );
+            gtk_paint_box( m_pWindow->style, gdkDrawable, GTK_STATE_NORMAL, GTK_SHADOW_NONE,
+                                &clipRect, m_pWindow, "base", x, y, w, h );
         }
 
-        if ( (GTK_BUTTON(gWidgetData[m_nScreen].gBtnWidget)->relief != GTK_RELIEF_NONE)
-            || (nState & CTRL_STATE_PRESSED)
-            || (nState & CTRL_STATE_ROLLOVER) )
+        if ( (nState & CTRL_STATE_DEFAULT) && GTK_IS_BUTTON(button) )
         {
-            gtk_paint_box( gWidgetData[m_nScreen].gBtnWidget->style, gdkDrawable, stateType, shadowType,
-                           &clipRect, gWidgetData[m_nScreen].gBtnWidget, "button", xi, yi, wi, hi );
+            gtk_paint_box( button->style, gdkDrawable, GTK_STATE_NORMAL, GTK_SHADOW_IN,
+                           &clipRect, button, "buttondefault", x, y, w, h );
         }
+        /* don't draw "button", because it can be a tool_button, and
+         * it causes some weird things, so, the default button is
+         * just fine */
+        gtk_paint_box( gWidgetData[m_nScreen].gBtnWidget->style, gdkDrawable, stateType, shadowType,
+                       &clipRect, gWidgetData[m_nScreen].gBtnWidget, "button", xi, yi, wi, hi );
     }
 
     return( sal_True );
 }
 
+sal_Bool GtkSalGraphics::NWPaintGTKButton(
+            GdkDrawable* gdkDrawable,
+            ControlType type, ControlPart part,
+            const Rectangle& rControlRectangle,
+            const clipList& rClipList,
+            ControlState nState, const ImplControlValue& value,
+            const OUString& string)
+{
+        return NWPaintGTKButtonReal(
+            gWidgetData[m_nScreen].gBtnWidget,
+            gdkDrawable,
+            type, part,
+            rControlRectangle,
+            rClipList,
+            nState, value,
+            string );
+}
+
 static Rectangle NWGetButtonArea( int nScreen,
                                   ControlType, ControlPart, Rectangle aAreaRect, ControlState nState,
                                   const ImplControlValue&, const OUString& )
@@ -1864,7 +1900,10 @@ static void NWPaintOneEditBox(	int nScreen,
     }
     NWSetWidgetState( widget, nState, stateType );
 
-    gtk_paint_box( pBGWidget->style, gdkDrawable, stateType, GTK_SHADOW_NONE,
+    /* This doesn't seem to be necessary, and it causes some weird glitch in
+     * murrine (with the elementary theme for instance) but it fixes some issue
+     * with Orta, so... */
+    gtk_paint_flat_box( pBGWidget->style, gdkDrawable, stateType, GTK_SHADOW_NONE,
                         gdkRect, pBGWidget, "entry_bg",
                         aEditBoxRect.Left(), aEditBoxRect.Top(),
                         aEditBoxRect.GetWidth(), aEditBoxRect.GetHeight() );
@@ -2432,7 +2471,7 @@ sal_Bool GtkSalGraphics::NWPaintGTKToolbar(
             const Rectangle& rControlRectangle,
             const clipList& rClipList,
             ControlState nState, const ImplControlValue& aValue,
-            const OUString& )
+            const OUString& string)
 {
     GtkStateType	stateType;
     GtkShadowType	shadowType;
@@ -2490,22 +2529,12 @@ sal_Bool GtkSalGraphics::NWPaintGTKToolbar(
     // handle button
     else if( nPart == PART_BUTTON )
     {
-        bPaintButton =
-            (GTK_BUTTON(pButtonWidget)->relief != GTK_RELIEF_NONE)
-            || (nState & CTRL_STATE_PRESSED)
+        bPaintButton = (nState & CTRL_STATE_PRESSED)
             || (nState & CTRL_STATE_ROLLOVER);
         if( aValue.getTristateVal() == BUTTONVALUE_ON )
         {
-            pButtonWidget = gWidgetData[m_nScreen].gToolbarToggleWidget;
-            shadowType = GTK_SHADOW_IN;
-            stateType = GTK_STATE_ACTIVE;
-            // special case stateType value for depressed toggle buttons
-            // cf. gtk+/gtk/gtktogglebutton.c (gtk_toggle_button_update_state)
-            if( (nState & (CTRL_STATE_ROLLOVER|CTRL_STATE_PRESSED)) )
-            {
-                stateType = GTK_STATE_PRELIGHT;
-                shadowType = GTK_SHADOW_OUT;
-            }
+                if(!(nState & CTRL_STATE_ROLLOVER))
+            nState |= CTRL_STATE_PRESSED;
             bPaintButton = true;
         }
         else
@@ -2513,77 +2542,80 @@ sal_Bool GtkSalGraphics::NWPaintGTKToolbar(
 
         NWSetWidgetState( pButtonWidget, nState, stateType );
         gtk_widget_ensure_style( pButtonWidget );
+        if(bPaintButton)
+            NWPaintGTKButtonReal(pButtonWidget, gdkDrawable, 0, 0, rControlRectangle, rClipList, nState, aValue, string);
     }
 
-    for( clipList::const_iterator it = rClipList.begin(); it != rClipList.end(); ++it )
+    if( nPart != PART_BUTTON )
     {
-        clipRect.x = it->Left();
-        clipRect.y = it->Top();
-        clipRect.width = it->GetWidth();
-        clipRect.height = it->GetHeight();
-
-        // draw toolbar
-        if( nPart == PART_DRAW_BACKGROUND_HORZ || nPart == PART_DRAW_BACKGROUND_VERT )
-        {
-            gtk_paint_flat_box( gWidgetData[m_nScreen].gToolbarWidget->style,
-                                gdkDrawable,
-                                (GtkStateType)GTK_STATE_NORMAL,
-                                GTK_SHADOW_NONE,
-                                &clipRect,
-                                gWidgetData[m_nScreen].gToolbarWidget,
-                                "base",
-                                x, y, w, h );
-            gtk_paint_box( gWidgetData[m_nScreen].gToolbarWidget->style,
-                           gdkDrawable,
-                           stateType,
-                           shadowType,
-                           &clipRect,
-                           gWidgetData[m_nScreen].gToolbarWidget,
-                           "toolbar",
-                           x, y, w, h );
-        }
-        // draw grip
-        else if( nPart == PART_THUMB_HORZ || nPart == PART_THUMB_VERT )
-        {
-            gtk_paint_handle( gWidgetData[m_nScreen].gHandleBoxWidget->style,
-                              gdkDrawable,
-                              GTK_STATE_NORMAL,
-                              GTK_SHADOW_OUT,
-                              &clipRect,
-                              gWidgetData[m_nScreen].gHandleBoxWidget,
-                              "handlebox",
-                              g_x, g_y, g_w, g_h,
-                              nPart == PART_THUMB_HORZ ?
-                              GTK_ORIENTATION_HORIZONTAL :
-                              GTK_ORIENTATION_VERTICAL
-                              );
-        }
-        // draw button
-        else if( nPart == PART_BUTTON )
+        for( clipList::const_iterator it = rClipList.begin(); it != rClipList.end(); ++it )
         {
-            if( bPaintButton )
+            clipRect.x = it->Left();
+            clipRect.y = it->Top();
+            clipRect.width = it->GetWidth();
+            clipRect.height = it->GetHeight();
+
+            // draw toolbar
+            if( nPart == PART_DRAW_BACKGROUND_HORZ || nPart == PART_DRAW_BACKGROUND_VERT )
             {
-                gtk_paint_box( pButtonWidget->style, gdkDrawable,
+                gtk_paint_flat_box( gWidgetData[m_nScreen].gToolbarWidget->style,
+                                    gdkDrawable,
+                                    (GtkStateType)GTK_STATE_NORMAL,
+                                    GTK_SHADOW_NONE,
+                                    &clipRect,
+                                    gWidgetData[m_nScreen].gToolbarWidget,
+                                    "base",
+                                    x, y, w, h );
+                gtk_paint_box( gWidgetData[m_nScreen].gToolbarWidget->style,
+                               gdkDrawable,
                                stateType,
                                shadowType,
                                &clipRect,
-                               pButtonWidget, "button", x, y, w, h );
+                               gWidgetData[m_nScreen].gToolbarWidget,
+                               "toolbar",
+                               x, y, w, h );
+            }
+            // draw grip
+            else if( nPart == PART_THUMB_HORZ || nPart == PART_THUMB_VERT )
+            {
+                gtk_paint_handle( gWidgetData[m_nScreen].gHandleBoxWidget->style,
+                                  gdkDrawable,
+                                  GTK_STATE_NORMAL,
+                                  GTK_SHADOW_OUT,
+                                  &clipRect,
+                                  gWidgetData[m_nScreen].gHandleBoxWidget,
+                                  "handlebox",
+                                  g_x, g_y, g_w, g_h,
+                                  nPart == PART_THUMB_HORZ ?
+                                  GTK_ORIENTATION_HORIZONTAL :
+                                  GTK_ORIENTATION_VERTICAL
+                                  );
+            }
+            else if(nPart == PART_SEPARATOR )
+            {
+                gint separator_height, separator_width, wide_separators;
+
+                gtk_widget_style_get (gWidgetData[m_nScreen].gVSeparator,
+                                      "wide-separators",  &wide_separators,
+                                      "separator-width",  &separator_width,
+                                      "separator-height", &separator_height,
+                                      NULL);
+                if (wide_separators)
+                    gtk_paint_box (gWidgetData[m_nScreen].gVSeparator->style, gdkDrawable,
+                               GTK_STATE_NORMAL, GTK_SHADOW_ETCHED_OUT,
+                               &clipRect, gWidgetData[m_nScreen].gVSeparator, "vseparator",
+                               x + (w - separator_width) / 2,
+                               y + 7,
+                               separator_width,
+                               h - 14);
+                else
+                    gtk_paint_vline (gWidgetData[m_nScreen].gVSeparator->style, gdkDrawable,
+                                 GTK_STATE_NORMAL,
+                                 &clipRect, gWidgetData[m_nScreen].gVSeparator, "vseparator",
+                                 y + 7,
+                                 y + h - 7,
+                                 x + w/2 - 1);
             }
-        }
-        else if(nPart == PART_SEPARATOR )
-        {
-            gtk_paint_vline( gWidgetData[m_nScreen].gVSeparator->style,
-                              gdkDrawable,
-                              GTK_STATE_NORMAL,
-                              &clipRect,
-                              gWidgetData[m_nScreen].gVSeparator,
-                              "vseparator",
-                              y + 4, y + h - 8 /* -2 and -4 is a dirty
-                                                * hack, to fit most gtk
-                                                * style, but it must be
-                                                * fixed, FIXME */,
-                              x
-                              );
         }
     }
 
@@ -3590,8 +3622,8 @@ void GtkSalGraphics::updateSettings( AllSettings& rSettings )
 GdkPixmap* GtkSalGraphics::NWGetPixmapFromScreen( Rectangle srcRect )
 {
     // Create a new pixmap to hold the composite of the window background and the control
-    GdkPixmap * pPixmap		= gdk_pixmap_new( GDK_DRAWABLE(GetGdkWindow()), srcRect.GetWidth(), srcRect.GetHeight(), -1 );
-    GdkGC *	 pPixmapGC	= gdk_gc_new( pPixmap );
+    GdkPixmap * pPixmap        = gdk_pixmap_new( GDK_DRAWABLE(GetGdkWindow()), srcRect.GetWidth(), srcRect.GetHeight(), -1 );
+    GdkGC *     pPixmapGC      = gdk_gc_new( pPixmap );
 
     if( !pPixmap || !pPixmapGC )
     {
@@ -3890,9 +3922,9 @@ static void NWEnsureGTKToolbar( int nScreen )
     {
         gWidgetData[nScreen].gToolbarWidget = gtk_toolbar_new();
         NWAddWidgetToCacheWindow( gWidgetData[nScreen].gToolbarWidget, nScreen );
-        gWidgetData[nScreen].gToolbarButtonWidget = gtk_button_new();
-        gWidgetData[nScreen].gToolbarToggleWidget = gtk_toggle_button_new();
-        gWidgetData[nScreen].gVSeparator = gtk_vseparator_new();
+        gWidgetData[nScreen].gToolbarButtonWidget = GTK_WIDGET(gtk_button_new());
+        gWidgetData[nScreen].gToolbarToggleWidget = GTK_WIDGET(gtk_toggle_tool_button_new());
+        gWidgetData[nScreen].gVSeparator = GTK_WIDGET(gtk_separator_tool_item_new());
         NWAddWidgetToCacheWindow( gWidgetData[nScreen].gVSeparator, nScreen );
 
         GtkReliefStyle aRelief = GTK_RELIEF_NORMAL;
diff --git a/vcl/unx/inc/plugins/gtk/gtkgdi.hxx b/vcl/unx/inc/plugins/gtk/gtkgdi.hxx
index 2aaafc5..4e4091c 100644
--- a/vcl/unx/inc/plugins/gtk/gtkgdi.hxx
+++ b/vcl/unx/inc/plugins/gtk/gtkgdi.hxx
@@ -95,6 +95,11 @@ protected:
     GdkPixmap* NWGetPixmapFromScreen( Rectangle srcRect );
     sal_Bool NWRenderPixmapToScreen( GdkPixmap*	pPixmap, Rectangle dstRect );
 
+    sal_Bool NWPaintGTKButtonReal( GtkWidget* button, GdkDrawable* gdkDrawable, ControlType nType, ControlPart nPart,
+                           const Rectangle& rControlRectangle,
+                           const clipList& rClipList,
+                           ControlState nState, const ImplControlValue& aValue,
+                           const OUString& rCaption );
     sal_Bool NWPaintGTKButton( GdkDrawable* gdkDrawable, ControlType nType, ControlPart nPart,
                            const Rectangle& rControlRectangle,
                            const clipList& rClipList,
commit 6a5fc45bb00dbe99b257be2aa5a81deeb6ced1ca
Author: Kohei Yoshida <kyoshida at novell.com>
Date:   Fri May 20 09:47:43 2011 +0000

    fdo#36690: Don't broadcast setting changes during painting of button.
    
    Calling SetSettings() when the output device is Window causes it to
    broadcast data change.  PushButton::Draw() in fact calls this method
    when the button contains colors, which ends up broadcasting its change
    via Window::DataChanged call.  But depending on the output device
    this DataChanged call may end up painting it again, which basically
    causes a recursive loop.
    
    The solution is to make sure OutputDevice::SetSettings() is called ( which only
     changes the settings without doing anything else ) and *not* and derived
    classes 'SetSettings()' method
    
    Signed-off-by: Noel Power <noel.power at novell.com>

diff --git a/vcl/source/control/button.cxx b/vcl/source/control/button.cxx
index c77d14a..6932cdb 100644
--- a/vcl/source/control/button.cxx
+++ b/vcl/source/control/button.cxx
@@ -1522,7 +1522,7 @@ void PushButton::Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize,
         else
             aStyleSettings.SetFaceColor( GetSettings().GetStyleSettings().GetFaceColor() );
         aSettings.SetStyleSettings( aStyleSettings );
-        pDev->SetSettings( aSettings );
+        pDev->OutputDevice::SetSettings( aSettings );
     }
     pDev->SetTextFillColor();
 
commit f71529593fc6e16554602638d100d02ac03bee75
Author: Noel Power <noel.power at novell.com>
Date:   Fri May 20 11:06:46 2011 +0100

    Revert "fdo#36690: Don't broadcast setting changes during painting of button."
    
    This reverts commit 829d4abd5eda9b03c5d4518f43efc4444bc63935.

diff --git a/vcl/source/control/button.cxx b/vcl/source/control/button.cxx
index 6932cdb..c77d14a 100644
--- a/vcl/source/control/button.cxx
+++ b/vcl/source/control/button.cxx
@@ -1522,7 +1522,7 @@ void PushButton::Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize,
         else
             aStyleSettings.SetFaceColor( GetSettings().GetStyleSettings().GetFaceColor() );
         aSettings.SetStyleSettings( aStyleSettings );
-        pDev->OutputDevice::SetSettings( aSettings );
+        pDev->SetSettings( aSettings );
     }
     pDev->SetTextFillColor();
 
commit fc1301e5940dbb38ed10719f87b44848f0aa65db
Author: Lucas Baudin <xapantu at gmail.com>
Date:   Fri May 20 13:01:11 2011 +0300

    Fix a bug about presssed button state (fdo#36613)
    
    Signed-off-by: Tor Lillqvist <tlillqvist at novell.com>

diff --git a/vcl/source/window/toolbox.cxx b/vcl/source/window/toolbox.cxx
index 0897047..a8e1cfb 100644
--- a/vcl/source/window/toolbox.cxx
+++ b/vcl/source/window/toolbox.cxx
@@ -3494,7 +3494,8 @@ void ToolBox::ImplDrawItem( sal_uInt16 nPos, sal_Bool bHighlight, sal_Bool bPain
     MetricVector* pVector = bLayout ? &mpData->m_pLayoutData->m_aUnicodeBoundRects : NULL;
     String* pDisplayText = bLayout ? &mpData->m_pLayoutData->m_aDisplayText : NULL;
     
-    bHighlight = bHighlight && pItem->mbEnabled;
+    if(!pItem->mbEnabled)
+        bHighlight = 0;
 
     // Falls Rechteck ausserhalb des sichbaren Bereichs liegt
     if ( pItem->maRect.IsEmpty() )
commit 829d4abd5eda9b03c5d4518f43efc4444bc63935
Author: Noel Power <noel.power at novell.com>
Date:   Fri May 20 10:47:43 2011 +0100

    fdo#36690: Don't broadcast setting changes during painting of button.
    
    Calling SetSettings() when the output device is Window causes it to
    broadcast data change.  PushButton::Draw() in fact calls this method
    when the button contains colors, which ends up broadcasting its change
    via Window::DataChanged call.  But depending on the output device
    this DataChanged call may end up painting it again, which basically
    causes a recursive loop.
    
    The solution is to make sure OutputDevice::SetSettings() is called ( which only
     changes the settings without doing anything else ) and *not* and derived
    classes 'SetSettings()' method
    
    Signed-off-by: Noel Power <noel.power at novell.com>

diff --git a/vcl/source/control/button.cxx b/vcl/source/control/button.cxx
index c77d14a..6932cdb 100644
--- a/vcl/source/control/button.cxx
+++ b/vcl/source/control/button.cxx
@@ -1522,7 +1522,7 @@ void PushButton::Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize,
         else
             aStyleSettings.SetFaceColor( GetSettings().GetStyleSettings().GetFaceColor() );
         aSettings.SetStyleSettings( aStyleSettings );
-        pDev->SetSettings( aSettings );
+        pDev->OutputDevice::SetSettings( aSettings );
     }
     pDev->SetTextFillColor();
 
commit 30428e1b7088df9b61a18c9b47557669cb542622
Author: Cédric Bosdonnat <cedric.bosdonnat.ooo at free.fr>
Date:   Thu May 19 17:00:35 2011 +0200

    fdo#36615: Fixed the prefix recognition in URLs... that list is sorted.

diff --git a/tools/source/fsys/urlobj.cxx b/tools/source/fsys/urlobj.cxx
index 40c2a5f..f3a4a37 100644
--- a/tools/source/fsys/urlobj.cxx
+++ b/tools/source/fsys/urlobj.cxx
@@ -2165,6 +2165,7 @@ INetURLObject::getPrefix(sal_Unicode const *& rBegin,
               INET_PROT_PRIV_SOFFICE, PrefixInfo::INTERNAL },
             { "private:trashcan:", "staroffice.trashcan:",
               INET_PROT_PRIV_SOFFICE, PrefixInfo::INTERNAL },
+            { "sftp:", 0, INET_PROT_SFTP, PrefixInfo::OFFICIAL },
             { "slot:", "staroffice.slot:", INET_PROT_SLOT,
               PrefixInfo::INTERNAL },
             { "smb:", 0, INET_PROT_SMB, PrefixInfo::OFFICIAL },
@@ -2217,8 +2218,7 @@ INetURLObject::getPrefix(sal_Unicode const *& rBegin,
             { "vnd.sun.star.tdoc:", 0, INET_PROT_VND_SUN_STAR_TDOC,
               PrefixInfo::OFFICIAL },
             { "vnd.sun.star.webdav:", 0, INET_PROT_VND_SUN_STAR_WEBDAV,
-              PrefixInfo::OFFICIAL },
-            { "sftp:", 0, INET_PROT_SFTP, PrefixInfo::OFFICIAL } };
+              PrefixInfo::OFFICIAL } };
 
     PrefixInfo const * pFirst = aMap + 1;
     PrefixInfo const * pLast = aMap + sizeof aMap / sizeof (PrefixInfo) - 1;
commit eaccbc2c2c81341a6eaf71dc59fba95a9e13051e
Author: Michael Meeks <michael.meeks at novell.com>
Date:   Wed May 18 06:21:50 2011 +0100

    fix gtk FMR on shutdown - fdo#37302
    
    Signed-off-by: Kohei Yoshida <kyoshida at novell.com>

diff --git a/vcl/unx/gtk/app/gtkdata.cxx b/vcl/unx/gtk/app/gtkdata.cxx
index 98fd914..c38876b 100644
--- a/vcl/unx/gtk/app/gtkdata.cxx
+++ b/vcl/unx/gtk/app/gtkdata.cxx
@@ -71,6 +71,15 @@ using ::rtl::OUString;
 /***************************************************************************
  * class GtkDisplay                                                        *
  ***************************************************************************/
+extern "C" {
+GdkFilterReturn call_filterGdkEvent( GdkXEvent* sys_event,
+                                     GdkEvent* event,
+                                     gpointer data )
+{
+    GtkSalDisplay *pDisplay = (GtkSalDisplay *)data;
+    return pDisplay->filterGdkEvent( sys_event, event );
+}
+}
 
 GtkSalDisplay::GtkSalDisplay( GdkDisplay* pDisplay )
             : SalDisplay( gdk_x11_display_get_xdisplay( pDisplay ) ),
@@ -81,10 +90,14 @@ GtkSalDisplay::GtkSalDisplay( GdkDisplay* pDisplay )
     for(int i = 0; i < POINTER_COUNT; i++)
         m_aCursors[ i ] = NULL;
     Init ();
+
+    gdk_window_add_filter( NULL, call_filterGdkEvent, this );
 }
 
 GtkSalDisplay::~GtkSalDisplay()
 {
+    gdk_window_remove_filter( NULL, call_filterGdkEvent, this );
+
     if( !m_bStartupCompleted )
         gdk_notify_startup_complete();
     doDestruct();
@@ -107,12 +120,6 @@ void GtkSalDisplay::deregisterFrame( SalFrame* pFrame )
 }
 
 extern "C" {
-GdkFilterReturn call_filterGdkEvent( GdkXEvent* sys_event,
-                                     GdkEvent* event,
-                                     gpointer data )
-{
-    return GtkSalDisplay::filterGdkEvent( sys_event, event, data );
-}
 
 void signalKeysChanged( GdkKeymap*, gpointer data )
 {
@@ -135,13 +142,10 @@ void signalMonitorsChanged( GdkScreen* pScreen, gpointer data )
 }
 
 GdkFilterReturn GtkSalDisplay::filterGdkEvent( GdkXEvent* sys_event,
-                                               GdkEvent*,
-                                               gpointer data )
+                                               GdkEvent* )
 {
     GdkFilterReturn aFilterReturn = GDK_FILTER_CONTINUE;
-
     XEvent *pEvent = (XEvent *)sys_event;
-    GtkSalDisplay *pDisplay = (GtkSalDisplay *)data;
 
     // dispatch all XEvents to event callback
     if( GetSalData()->m_pInstance->
@@ -150,7 +154,7 @@ GdkFilterReturn GtkSalDisplay::filterGdkEvent( GdkXEvent* sys_event,
 
     GTK_YIELD_GRAB();
 
-    if (pDisplay->GetDisplay() == pEvent->xany.display )
+    if (GetDisplay() == pEvent->xany.display )
     {
         // #i53471# gtk has no callback mechanism that lets us be notified
         // when settings (as in XSETTING and opposed to styles) are changed.
@@ -158,16 +162,16 @@ GdkFilterReturn GtkSalDisplay::filterGdkEvent( GdkXEvent* sys_event,
         // these should be rare enough so that we can assume that the settings
         // actually change when a corresponding PropertyNotify occurs
         if( pEvent->type == PropertyNotify &&
-            pEvent->xproperty.atom == pDisplay->getWMAdaptor()->getAtom( WMAdaptor::XSETTINGS ) &&
-            ! pDisplay->m_aFrames.empty()
+            pEvent->xproperty.atom == getWMAdaptor()->getAtom( WMAdaptor::XSETTINGS ) &&
+            ! m_aFrames.empty()
            )
         {
-            pDisplay->SendInternalEvent( pDisplay->m_aFrames.front(), NULL, SALEVENT_SETTINGSCHANGED );
+            SendInternalEvent( m_aFrames.front(), NULL, SALEVENT_SETTINGSCHANGED );
         }
         // let's see if one of our frames wants to swallow these events
         // get the frame
-        for( std::list< SalFrame* >::const_iterator it = pDisplay->m_aFrames.begin();
-                 it != pDisplay->m_aFrames.end(); ++it )
+        for( std::list< SalFrame* >::const_iterator it = m_aFrames.begin();
+                 it != m_aFrames.end(); ++it )
         {
             GtkSalFrame* pFrame = static_cast<GtkSalFrame*>(*it);
             if( (GdkNativeWindow)pFrame->GetSystemData()->aWindow == pEvent->xany.window ||
@@ -686,8 +690,6 @@ void GtkXLib::Init()
 
     m_pGtkSalDisplay = new GtkSalDisplay( pGdkDisp );
 
-    gdk_window_add_filter( NULL, call_filterGdkEvent, m_pGtkSalDisplay );
-
     PushXErrorLevel( true );
     SalI18N_KeyboardExtension *pKbdExtension = new SalI18N_KeyboardExtension( pDisp );
     XSync( pDisp, False );
diff --git a/vcl/unx/inc/plugins/gtk/gtkdata.hxx b/vcl/unx/inc/plugins/gtk/gtkdata.hxx
index 90bc80a..93443f9 100644
--- a/vcl/unx/inc/plugins/gtk/gtkdata.hxx
+++ b/vcl/unx/inc/plugins/gtk/gtkdata.hxx
@@ -78,9 +78,8 @@ public:
 
     virtual int GetDefaultMonitorNumber() const;
 
-    static GdkFilterReturn filterGdkEvent( GdkXEvent* sys_event,
-                                           GdkEvent* event,
-                                           gpointer data );
+    GdkFilterReturn filterGdkEvent( GdkXEvent* sys_event,
+                                    GdkEvent* event );
     inline bool HasMoreEvents()     { return m_aUserEvents.size() > 1; }
     inline void EventGuardAcquire() { osl_acquireMutex( hEventGuard_ ); }
     inline void EventGuardRelease() { osl_releaseMutex( hEventGuard_ ); }


More information about the Libreoffice-commits mailing list