This is an automated email from the ASF dual-hosted git repository.

jimjag pushed a commit to branch AOO50X
in repository https://gitbox.apache.org/repos/asf/openoffice.git

commit 2f8cc657ee18c03d027f1602f71b13c142366c06
Author: Pedro Giffuni <[email protected]>
AuthorDate: Thu Sep 24 21:11:48 2026 -0500

    vcl: GTK upgrade - replace direct widget struct access with public APIs
    
    Replace direct access to GTK internal struct members (m_pWindow->window,
    ->style) with public GTK2 APIs (gtk_widget_get_window, gtk_widget_get_style)
    through safe accessor methods getGdkWindow() and getXWindow() on 
GtkSalFrame.
    
    - Add getGdkWindow()/getXWindow() accessors on GtkSalFrame with null guards
    - Update GtkSalGraphics::GetGdkWindow() to use gtk_widget_get_window()
    - Remove unused GetGtkWidget() (0 callers)
    - Replace all m_pWindow->window accesses with getGdkWindow()/getXWindow()
    - Replace GTK_WIDGET(m_pWindow)->window with GetGdkWindow()
    - Replace m_pWindow->style with gtk_widget_get_style()
    - Replace m_pSocket->window with gtk_widget_get_window(m_pSocket)
    - Replace GDK_WINDOW_XWINDOW(GTK_WIDGET(pParent->getWindow())->window) with
      pParent->getXWindow()
    - Add DeInit() call before graphics deletion in GraphicsHolder destructor
    - Sync window/drawable when returning existing cached graphics instance
    - Detach/resync all allocated graphics (pGraphics != NULL), not just bInUse,
      in createNewWindow() and moveToScreen()
    - Reset m_pWindow = NULL in GtkSalGraphics destructor
    - Guard gdkDrawable and GetGdkWindow() against NULL to prevent painting when
      widget is unmapped or destroyed
    
    (cherry picked from commit 36a7f761274e9e8303baaeefd1658f24d3b410f1)
---
 main/vcl/inc/unx/gtk/gtkframe.hxx             |  6 ++
 main/vcl/inc/unx/gtk/gtkgdi.hxx               |  3 +-
 main/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx | 12 +++-
 main/vcl/unx/gtk/window/gtkframe.cxx          | 89 +++++++++++++++------------
 main/vcl/unx/gtk/window/gtkobject.cxx         |  8 +--
 5 files changed, 68 insertions(+), 50 deletions(-)

diff --git a/main/vcl/inc/unx/gtk/gtkframe.hxx 
b/main/vcl/inc/unx/gtk/gtkframe.hxx
index a948ffdd2f..465db520a0 100644
--- a/main/vcl/inc/unx/gtk/gtkframe.hxx
+++ b/main/vcl/inc/unx/gtk/gtkframe.hxx
@@ -279,6 +279,12 @@ public:
        GtkSalDisplay*  getDisplay();
        GdkDisplay*             getGdkDisplay();
     GtkWidget* getWindow() const { return m_pWindow; }
+    GdkWindow* getGdkWindow() const { return m_pWindow ? 
gtk_widget_get_window( m_pWindow ) : NULL; }
+    XLIB_Window        getXWindow() const
+    {
+        GdkWindow* pWin = getGdkWindow();
+        return pWin ? GDK_WINDOW_XWINDOW( pWin ) : None;
+    }
     GtkFixed*  getFixedContainer() const { return m_pFixedContainer; }
     GdkWindow* getForeignParent() const { return m_pForeignParent; }
     GdkNativeWindow    getForeignParentWindow() const { return 
m_aForeignParentWindow; }
diff --git a/main/vcl/inc/unx/gtk/gtkgdi.hxx b/main/vcl/inc/unx/gtk/gtkgdi.hxx
index 8a9aca4a06..5f22658cc6 100644
--- a/main/vcl/inc/unx/gtk/gtkgdi.hxx
+++ b/main/vcl/inc/unx/gtk/gtkgdi.hxx
@@ -43,8 +43,7 @@ public:
                               {}
     virtual             ~GtkSalGraphics();
 
-    inline GtkWidget*  GetGtkWidget() const { return m_pWindow; }
-    inline GdkWindow*  GetGdkWindow() const { return m_pWindow->window; }
+    inline GdkWindow*  GetGdkWindow() const { return m_pWindow ? 
gtk_widget_get_window( m_pWindow ) : NULL; }
     inline GtkSalFrame* GetGtkFrame() const { return 
static_cast<GtkSalFrame*>(m_pFrame); }
     void SetWindow( GtkWidget* window ) { m_pWindow = window; }
 
diff --git a/main/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx 
b/main/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx
index bbd90a254b..e5dd8a36c0 100644
--- a/main/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx
+++ b/main/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx
@@ -52,6 +52,7 @@ sal_Bool 
GtkSalGraphics::bNeedButtonStyleAsEditBackgroundWorkaround = sal_False;
 
 GtkSalGraphics::~GtkSalGraphics()
 {
+    m_pWindow = NULL;
 }
 
 
@@ -494,7 +495,7 @@ void GtkSalGraphics::copyBits( const SalTwoRect& rPosAry,
     if( pFrame && m_pWindow )
     {
         /* #i64117# some themes set the background pixmap VERY frequently */
-        GdkWindow* pWin = GTK_WIDGET(m_pWindow)->window;
+        GdkWindow* pWin = GetGdkWindow();
         if( pWin )
         {
             aWin = GDK_WINDOW_XWINDOW(pWin);
@@ -738,6 +739,8 @@ sal_Bool GtkSalGraphics::drawNativeControl( ControlType 
nType,
 
     clipList aClip;
     GdkDrawable* gdkDrawable = GDK_DRAWABLE( GetGdkWindow() );
+    if( !gdkDrawable )
+        return sal_False;
     GdkPixmap* pixmap = NULL;
     Rectangle aPixmapRect;
     if( ( bNeedPixmapPaint )
@@ -2321,7 +2324,7 @@ sal_Bool GtkSalGraphics::NWPaintGTKTabItem( ControlType 
nType, ControlPart,
     paintRect.width = pixmapRect.GetWidth();
     paintRect.height = pixmapRect.GetHeight();
 
-    gtk_paint_flat_box( m_pWindow->style, pixmap, GTK_STATE_NORMAL,
+    gtk_paint_flat_box( gtk_widget_get_style( m_pWindow ), pixmap, 
GTK_STATE_NORMAL,
                                GTK_SHADOW_NONE, &paintRect, m_pWindow, "base", 
0, 0, -1, -1);
 
        NWSetWidgetState( gWidgetData[m_nScreen].gNotebookWidget, nState, 
stateType );
@@ -3628,7 +3631,10 @@ 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 );
+    GdkWindow* pWin = GetGdkWindow();
+    if( !pWin )
+        return NULL;
+    GdkPixmap * pPixmap                = gdk_pixmap_new( GDK_DRAWABLE(pWin), 
srcRect.GetWidth(), srcRect.GetHeight(), -1 );
        GdkGC *  pPixmapGC      = gdk_gc_new( pPixmap );
 
     if( !pPixmap || !pPixmapGC )
diff --git a/main/vcl/unx/gtk/window/gtkframe.cxx 
b/main/vcl/unx/gtk/window/gtkframe.cxx
index 67cb16d5f3..3e9cc9c4b1 100644
--- a/main/vcl/unx/gtk/window/gtkframe.cxx
+++ b/main/vcl/unx/gtk/window/gtkframe.cxx
@@ -377,6 +377,8 @@ void GtkSalFrame::doKeyCallback( guint state,
 
 GtkSalFrame::GraphicsHolder::~GraphicsHolder()
 {
+    if( pGraphics )
+        pGraphics->DeInit();
     delete pGraphics;
 }
 
@@ -424,8 +426,8 @@ GtkSalFrame::~GtkSalFrame()
         m_pParent->m_aChildren.remove( this );
 
     // Early explicit removal of registered native and foreign window IDs
-    if( m_pWindow && m_pWindow->window )
-        getDisplay()->deregisterFrameWindow( 
GDK_WINDOW_XWINDOW(m_pWindow->window), this );
+    if( m_pWindow && getGdkWindow() )
+        getDisplay()->deregisterFrameWindow( getXWindow(), this );
     if( m_aForeignParentWindow != None )
         getDisplay()->deregisterFrameWindow( 
(XLIB_Window)m_aForeignParentWindow, this );
     if( m_aForeignTopLevelWindow != None )
@@ -440,7 +442,7 @@ GtkSalFrame::~GtkSalFrame()
     if( m_hBackgroundPixmap )
     {
         XSetWindowBackgroundPixmap( getDisplay()->GetDisplay(),
-                                    GDK_WINDOW_XWINDOW(m_pWindow->window),
+                                    getXWindow(),
                                     None );
         XFreePixmap( getDisplay()->GetDisplay(), m_hBackgroundPixmap );
     }
@@ -603,8 +605,8 @@ void GtkSalFrame::InitCommon()
     SalDisplay* pDisp = GetX11SalData()->GetDisplay();
     m_aSystemData.nSize                = sizeof( SystemChildData );
     m_aSystemData.pDisplay             = pDisp->GetDisplay();
-    if( m_pWindow && m_pWindow->window )
-        m_aSystemData.aWindow  = GDK_WINDOW_XWINDOW(m_pWindow->window);
+    if( m_pWindow && getGdkWindow() )
+        m_aSystemData.aWindow  = getXWindow();
     else
         m_aSystemData.aWindow   = None;
     m_aSystemData.pSalFrame            = this;
@@ -661,7 +663,7 @@ void GtkSalFrame::InitCommon()
     *  some paint issues
     */
     XSetWindowBackgroundPixmap( getDisplay()->GetDisplay(),
-                                GDK_WINDOW_XWINDOW(m_pWindow->window),
+                                getXWindow(),
                                 m_hBackgroundPixmap );
 }
 
@@ -965,7 +967,7 @@ void GtkSalFrame::Init( SystemParentData* pSysData )
     if( ! m_bWindowIsGtkPlug )
     {
         XReparentWindow( getDisplay()->GetDisplay(),
-                         GDK_WINDOW_XWINDOW(m_pWindow->window),
+                         getXWindow(),
                          (XLIB_Window)pSysData->aWindow,
                          0, 0 );
     }
@@ -1006,7 +1008,7 @@ void GtkSalFrame::SetExtendedFrameStyle( SalExtStyle 
nStyle )
             pClass->res_name  = const_cast<char*>(aResHint.getStr());
             pClass->res_class = 
const_cast<char*>(X11SalData::getFrameClassName());
             XSetClassHint( getDisplay()->GetDisplay(),
-                           GDK_WINDOW_XWINDOW(m_pWindow->window),
+                           getXWindow(),
                            pClass );
             XFree( pClass );
         }
@@ -1030,7 +1032,12 @@ SalGraphics* GtkSalFrame::GetGraphics()
                 if( ! m_aGraphics[i].pGraphics )
                 {
                     m_aGraphics[i].pGraphics = new GtkSalGraphics( m_pWindow );
-                    m_aGraphics[i].pGraphics->Init( this, 
GDK_WINDOW_XWINDOW(m_pWindow->window), m_nScreen );
+                    m_aGraphics[i].pGraphics->Init( this, getXWindow(), 
m_nScreen );
+                }
+                else
+                {
+                    m_aGraphics[i].pGraphics->SetWindow( m_pWindow );
+                    m_aGraphics[i].pGraphics->SetDrawable( getXWindow(), 
m_nScreen );
                 }
                 return m_aGraphics[i].pGraphics;
             }
@@ -1772,8 +1779,8 @@ void GtkSalFrame::moveToScreen( int nScreen )
         gtk_widget_realize( m_pWindow );
         // update system data
         GtkSalDisplay* pDisp = getDisplay();
-        if( m_pWindow && m_pWindow->window )
-            m_aSystemData.aWindow      = GDK_WINDOW_XWINDOW(m_pWindow->window);
+        if( m_pWindow && getGdkWindow() )
+            m_aSystemData.aWindow      = getXWindow();
         else
             m_aSystemData.aWindow   = None;
         m_aSystemData.pVisual          = pDisp->GetVisual( m_nScreen 
).GetVisual();
@@ -1787,8 +1794,8 @@ void GtkSalFrame::moveToScreen( int nScreen )
         // update graphics if necessary
         for( unsigned int i = 0; i < 
sizeof(m_aGraphics)/sizeof(m_aGraphics[0]); i++ )
         {
-            if( m_aGraphics[i].bInUse )
-                m_aGraphics[i].pGraphics->SetDrawable( 
GDK_WINDOW_XWINDOW(m_pWindow->window), m_nScreen );
+            if( m_aGraphics[i].pGraphics )
+                m_aGraphics[i].pGraphics->SetDrawable( getXWindow(), m_nScreen 
);
         }
         updateScreenNumber();
     }
@@ -2092,7 +2099,7 @@ void GtkSalFrame::StartPresentation( sal_Bool bStart )
                }
 #ifdef ENABLE_DBUS
                m_nGSMCookie = dbus_inhibit_gsm(g_get_application_name(), 
"presentation",
-                    GDK_WINDOW_XID(m_pWindow->window));
+                    getXWindow());
 #endif
        }
        else
@@ -2124,10 +2131,10 @@ void GtkSalFrame::ToTop( sal_uInt16 nFlags )
                 gtk_window_present( GTK_WINDOW(m_pWindow) );
             else
             {
-                // gdk_window_focus( m_pWindow->window, 
gdk_x11_get_server_time(GTK_WIDGET (m_pWindow)->window) );
+                // gdk_window_focus( getGdkWindow(), 
gdk_x11_get_server_time(GTK_WIDGET (m_pWindow)->window) );
                 /* #i99360# ugly workaround an X11 library bug */
                 guint32 nUserTime= getDisplay()->GetLastUserEventTime( true );
-                gdk_window_focus( m_pWindow->window, nUserTime );
+                gdk_window_focus( getGdkWindow(), nUserTime );
             }
             /*  need to do an XSetInputFocus here because
              *  gdk_window_focus will ask a EWMH compliant WM to put the focus
@@ -2139,7 +2146,7 @@ void GtkSalFrame::ToTop( sal_uInt16 nFlags )
                 // sad but true: this can cause an XError, we need to catch 
that
                 // to do this we need to synchronize with the XServer
                 getDisplay()->GetXLib()->PushXErrorLevel( true );
-                XSetInputFocus( getDisplay()->GetDisplay(), 
GDK_WINDOW_XWINDOW( m_pWindow->window ), RevertToParent, CurrentTime );
+                XSetInputFocus( getDisplay()->GetDisplay(), getXWindow(), 
RevertToParent, CurrentTime );
                 XSync( getDisplay()->GetDisplay(), False );
                 getDisplay()->GetXLib()->PopXErrorLevel();
             }
@@ -2158,7 +2165,7 @@ void GtkSalFrame::SetPointer( PointerStyle ePointerStyle )
     {
         m_ePointerStyle = ePointerStyle;
         GdkCursor *pCursor = getDisplay()->getCursor( ePointerStyle );
-        gdk_window_set_cursor( m_pWindow->window, pCursor );
+        gdk_window_set_cursor( getGdkWindow(), pCursor );
         m_pCurrentCursor = pCursor;
 
         // #i80791# use grabPointer the same way as CaptureMouse, respective 
float grab
@@ -2193,7 +2200,7 @@ void GtkSalFrame::grabPointer( sal_Bool bGrab, sal_Bool 
bOwnerEvents )
             {
                 const int nMask = ( GDK_BUTTON_PRESS_MASK | 
GDK_BUTTON_RELEASE_MASK | GDK_POINTER_MOTION_MASK | 
GDK_POINTER_MOTION_HINT_MASK );
 
-                gdk_pointer_grab( m_pWindow->window, bOwnerEvents,
+                gdk_pointer_grab( getGdkWindow(), bOwnerEvents,
                                   (GdkEventMask) nMask, NULL, m_pCurrentCursor,
                                   GDK_CURRENT_TIME );
             }
@@ -2206,7 +2213,7 @@ void GtkSalFrame::grabPointer( sal_Bool bGrab, sal_Bool 
bOwnerEvents )
                 // this is of course a bad hack, especially as we cannot
                 // set the right cursor this way
                 XGrabPointer( getDisplay()->GetDisplay(),
-                              GDK_WINDOW_XWINDOW( m_pWindow->window),
+                              getXWindow(),
                               bOwnerEvents,
                               PointerMotionMask | ButtonPressMask | 
ButtonReleaseMask,
                               GrabModeAsync,
@@ -2254,7 +2261,7 @@ void GtkSalFrame::SetPointerPos( long nX, long nY )
     // #i38648# ask for the next motion hint
     gint x, y;
     GdkModifierType mask;
-    gdk_window_get_pointer( pFrame->m_pWindow->window, &x, &y, &mask );
+    gdk_window_get_pointer( pFrame->getGdkWindow(), &x, &y, &mask );
 }
 
 void GtkSalFrame::Flush()
@@ -2340,7 +2347,7 @@ SalBitmap* GtkSalFrame::SnapShot()
                return NULL;
 
        X11SalBitmap *pBmp = new X11SalBitmap;
-       GdkWindow *pWin = m_pWindow->window;
+       GdkWindow *pWin = getGdkWindow();
        if( pBmp->SnapShot( GDK_DISPLAY_XDISPLAY( getGdkDisplay() ),
                                                GDK_WINDOW_XID( pWin ) ) )
                return pBmp;
@@ -2437,7 +2444,7 @@ void GtkSalFrame::createNewWindow( XLIB_Window 
aNewParent, bool bXEmbed, int nSc
 
     // free xrender resources
     for( unsigned int i = 0; i < sizeof(m_aGraphics)/sizeof(m_aGraphics[0]); 
i++ )
-        if( m_aGraphics[i].bInUse )
+        if( m_aGraphics[i].pGraphics )
             m_aGraphics[i].pGraphics->SetDrawable( None, m_nScreen );
 
     // first deinit frame
@@ -2448,8 +2455,8 @@ void GtkSalFrame::createNewWindow( XLIB_Window 
aNewParent, bool bXEmbed, int nSc
     }
     if( m_pRegion )
         gdk_region_destroy( m_pRegion );
-    if( m_pWindow && m_pWindow->window )
-        getDisplay()->deregisterFrameWindow( 
GDK_WINDOW_XWINDOW(m_pWindow->window), this );
+    if( m_pWindow && getGdkWindow() )
+        getDisplay()->deregisterFrameWindow( getXWindow(), this );
     if( m_aForeignParentWindow != None )
         getDisplay()->deregisterFrameWindow( 
(XLIB_Window)m_aForeignParentWindow, this );
     if( m_aForeignTopLevelWindow != None )
@@ -2493,9 +2500,9 @@ void GtkSalFrame::createNewWindow( XLIB_Window 
aNewParent, bool bXEmbed, int nSc
        // update graphics
     for( unsigned int i = 0; i < sizeof(m_aGraphics)/sizeof(m_aGraphics[0]); 
i++ )
     {
-        if( m_aGraphics[i].bInUse )
+        if( m_aGraphics[i].pGraphics )
         {
-            m_aGraphics[i].pGraphics->SetDrawable( 
GDK_WINDOW_XWINDOW(m_pWindow->window), m_nScreen );
+            m_aGraphics[i].pGraphics->SetDrawable( getXWindow(), m_nScreen );
             m_aGraphics[i].pGraphics->SetWindow( m_pWindow );
         }
     }
@@ -2525,7 +2532,7 @@ bool GtkSalFrame::SetPluginParent( SystemParentData* 
pSysParent )
 void GtkSalFrame::ResetClipRegion()
 {
     if( m_pWindow )
-        gdk_window_shape_combine_region( m_pWindow->window, NULL, 0, 0 );
+        gdk_window_shape_combine_region( getGdkWindow(), NULL, 0, 0 );
 }
 
 void GtkSalFrame::BeginSetClipRegion( sal_uLong )
@@ -2552,7 +2559,7 @@ void GtkSalFrame::UnionClipRegion( long nX, long nY, long 
nWidth, long nHeight )
 void GtkSalFrame::EndSetClipRegion()
 {
     if( m_pWindow && m_pRegion )
-        gdk_window_shape_combine_region( m_pWindow->window, m_pRegion, 0, 0 );
+        gdk_window_shape_combine_region( getGdkWindow(), m_pRegion, 0, 0 );
 }
 
 bool GtkSalFrame::dispatchXEvent( const XEvent* pEvent )
@@ -2565,16 +2572,16 @@ bool GtkSalFrame::dispatchXEvent( const XEvent* pEvent )
         Atom nDesktopAtom = pAdaptor->getAtom( 
vcl_sal::WMAdaptor::NET_WM_DESKTOP );
         if( pEvent->xproperty.atom == nDesktopAtom &&
             pEvent->xproperty.state == PropertyNewValue &&
-            m_pWindow && m_pWindow->window )
+            m_pWindow && getGdkWindow() )
         {
-            m_nWorkArea = pAdaptor->getWindowWorkArea( GDK_WINDOW_XWINDOW( 
m_pWindow->window) );
+            m_nWorkArea = pAdaptor->getWindowWorkArea( getXWindow() );
         }
     }
     else if( pEvent->type == ConfigureNotify )
     {
         if( m_pForeignParent &&
             m_pWindow &&
-            m_pWindow->window &&
+            getGdkWindow() &&
             pEvent->xconfigure.window == m_aForeignParentWindow )
         {
             bHandled = true;
@@ -2591,7 +2598,7 @@ bool GtkSalFrame::dispatchXEvent( const XEvent* pEvent )
             }
         }
         else if( m_pForeignTopLevel &&
-                 m_pWindow && m_pWindow->window &&
+                 m_pWindow && getGdkWindow() &&
                  pEvent->xconfigure.window == m_aForeignTopLevelWindow )
         {
             bHandled = true;
@@ -2599,7 +2606,7 @@ bool GtkSalFrame::dispatchXEvent( const XEvent* pEvent )
             int x = 0, y = 0;
             XLIB_Window aChild;
             XTranslateCoordinates( getDisplay()->GetDisplay(),
-                                   GDK_WINDOW_XWINDOW( m_pWindow->window),
+                                   getXWindow(),
                                    getDisplay()->GetRootWindow( 
getDisplay()->GetDefaultScreenNumber() ),
                                    0, 0,
                                    &x, &y,
@@ -2614,8 +2621,8 @@ bool GtkSalFrame::dispatchXEvent( const XEvent* pEvent )
     }
     else if( pEvent->type == ClientMessage &&
              pEvent->xclient.message_type == 
getDisplay()->getWMAdaptor()->getAtom( vcl_sal::WMAdaptor::XEMBED ) &&
-             m_pWindow && m_pWindow->window &&
-             pEvent->xclient.window == GDK_WINDOW_XWINDOW(m_pWindow->window) &&
+             m_pWindow && getGdkWindow() &&
+             pEvent->xclient.window == getXWindow() &&
              m_bWindowIsGtkPlug
              )
     {
@@ -2627,7 +2634,7 @@ bool GtkSalFrame::dispatchXEvent( const XEvent* pEvent )
         {
             GdkEventFocus aEvent;
             aEvent.type = GDK_FOCUS_CHANGE;
-            aEvent.window = m_pWindow->window;
+            aEvent.window = getGdkWindow();
             aEvent.send_event = sal_True;
             aEvent.in = (pEvent->xclient.data.l[1] == 1);
             signalFocus( m_pWindow, &aEvent, this );
@@ -2647,7 +2654,7 @@ void GtkSalFrame::SetBackgroundBitmap( SalBitmap* pBitmap 
)
     if( m_hBackgroundPixmap )
     {
         XSetWindowBackgroundPixmap( getDisplay()->GetDisplay(),
-                                    GDK_WINDOW_XWINDOW(m_pWindow->window),
+                                    getXWindow(),
                                     None );
         XFreePixmap( getDisplay()->GetDisplay(), m_hBackgroundPixmap );
         m_hBackgroundPixmap = None;
@@ -2660,7 +2667,7 @@ void GtkSalFrame::SetBackgroundBitmap( SalBitmap* pBitmap 
)
         {
             m_hBackgroundPixmap =
                 XCreatePixmap( getDisplay()->GetDisplay(),
-                               GDK_WINDOW_XWINDOW(m_pWindow->window),
+                               getXWindow(),
                                aSize.Width(),
                                aSize.Height(),
                                getDisplay()->GetVisual(m_nScreen).GetDepth() );
@@ -2676,7 +2683,7 @@ void GtkSalFrame::SetBackgroundBitmap( SalBitmap* pBitmap 
)
                                aTwoRect,
                                getDisplay()->GetCopyGC(m_nScreen) );
                 XSetWindowBackgroundPixmap( getDisplay()->GetDisplay(),
-                                            
GDK_WINDOW_XWINDOW(m_pWindow->window),
+                                            getXWindow(),
                                             m_hBackgroundPixmap );
             }
         }
@@ -2934,7 +2941,7 @@ IMPL_LINK( GtkSalFrame, ImplDelayedFullScreenHdl, void*, 
EMPTYARG )
         XEvent aEvent;
         aEvent.type                                    = ClientMessage;
         aEvent.xclient.display         = getDisplay()->GetDisplay();
-        aEvent.xclient.window          = GDK_WINDOW_XWINDOW(m_pWindow->window);
+        aEvent.xclient.window          = getXWindow();
         aEvent.xclient.message_type    = nStateAtom;
         aEvent.xclient.format          = 32;
         aEvent.xclient.data.l[0]       = 1;
diff --git a/main/vcl/unx/gtk/window/gtkobject.cxx 
b/main/vcl/unx/gtk/window/gtkobject.cxx
index 5ab103fecd..1ddd9b65bd 100644
--- a/main/vcl/unx/gtk/window/gtkobject.cxx
+++ b/main/vcl/unx/gtk/window/gtkobject.cxx
@@ -54,7 +54,7 @@ GtkSalObject::GtkSalObject( GtkSalFrame* pParent, sal_Bool 
bShow )
         SalDisplay* pDisp = GetX11SalData()->GetDisplay();
         m_aSystemData.nSize            = sizeof( SystemChildData );
         m_aSystemData.pDisplay         = pDisp->GetDisplay();
-        m_aSystemData.aWindow          = GDK_WINDOW_XWINDOW(m_pSocket->window);
+        m_aSystemData.aWindow          = 
GDK_WINDOW_XWINDOW(gtk_widget_get_window(m_pSocket));
         m_aSystemData.pSalFrame                = NULL;
         m_aSystemData.pWidget          = m_pSocket;
         m_aSystemData.pVisual          = 
pDisp->GetVisual(pParent->getScreenNumber()).GetVisual();
@@ -62,7 +62,7 @@ GtkSalObject::GtkSalObject( GtkSalFrame* pParent, sal_Bool 
bShow )
         m_aSystemData.nDepth           = 
pDisp->GetVisual(pParent->getScreenNumber()).GetDepth();
         m_aSystemData.aColormap                = 
pDisp->GetColormap(pParent->getScreenNumber()).GetXColormap();
         m_aSystemData.pAppContext      = NULL;
-        m_aSystemData.aShellWindow     = 
GDK_WINDOW_XWINDOW(GTK_WIDGET(pParent->getWindow())->window);
+        m_aSystemData.aShellWindow     = pParent->getXWindow();
         m_aSystemData.pShellWidget     = GTK_WIDGET(pParent->getWindow());
 
         g_signal_connect( G_OBJECT(m_pSocket), "button-press-event", 
G_CALLBACK(signalButton), this );
@@ -97,7 +97,7 @@ GtkSalObject::~GtkSalObject()
 void GtkSalObject::ResetClipRegion()
 {
     if( m_pSocket )
-        gdk_window_shape_combine_region( m_pSocket->window, NULL, 0, 0 );
+        gdk_window_shape_combine_region( gtk_widget_get_window(m_pSocket), 
NULL, 0, 0 );
 }
 
 sal_uInt16 GtkSalObject::GetClipRegionType()
@@ -126,7 +126,7 @@ void GtkSalObject::UnionClipRegion( long nX, long nY, long 
nWidth, long nHeight
 void GtkSalObject::EndSetClipRegion()
 {
     if( m_pSocket )
-        gdk_window_shape_combine_region( m_pSocket->window, m_pRegion, 0, 0 );
+        gdk_window_shape_combine_region( gtk_widget_get_window(m_pSocket), 
m_pRegion, 0, 0 );
 }
 
 void GtkSalObject::SetPosSize( long nX, long nY, long nWidth, long nHeight )

Reply via email to