[gtk+] gtk/gtksocket-x11.c: Use accessor functions to access GtkWidget



commit 04fd195b9babdb52c933378ed95a71dc79b2fddb
Author: Javier Jardón <jjardon gnome org>
Date:   Sun Aug 15 17:36:02 2010 +0200

    gtk/gtksocket-x11.c: Use accessor functions to access GtkWidget

 gtk/gtksocket-x11.c |   26 ++++++++++++++++++--------
 1 files changed, 18 insertions(+), 8 deletions(-)
---
diff --git a/gtk/gtksocket-x11.c b/gtk/gtksocket-x11.c
index 8ea321a..6d1e626 100644
--- a/gtk/gtksocket-x11.c
+++ b/gtk/gtksocket-x11.c
@@ -56,15 +56,17 @@ static gboolean xembed_get_info     (GdkWindow     *gdk_window,
 GdkNativeWindow
 _gtk_socket_windowing_get_id (GtkSocket *socket)
 {
-  return GDK_WINDOW_XWINDOW (GTK_WIDGET (socket)->window);
+  return GDK_WINDOW_XWINDOW (gtk_widget_get_window (GTK_WIDGET (socket)));
 }
 
 void
 _gtk_socket_windowing_realize_window (GtkSocket *socket)
 {
-  GdkWindow *window = GTK_WIDGET (socket)->window;
+  GdkWindow *window;
   XWindowAttributes xattrs;
 
+  window = gtk_widget_get_window (GTK_WIDGET (socket));
+
   XGetWindowAttributes (GDK_WINDOW_XDISPLAY (window),
 			GDK_WINDOW_XWINDOW (window),
 			&xattrs);
@@ -209,6 +211,7 @@ _gtk_socket_windowing_focus (GtkSocket       *socket,
 void
 _gtk_socket_windowing_send_configure_event (GtkSocket *socket)
 {
+  GtkAllocation allocation;
   XConfigureEvent xconfigure;
   gint x, y;
 
@@ -227,11 +230,12 @@ _gtk_socket_windowing_send_configure_event (GtkSocket *socket)
   gdk_error_trap_push ();
   gdk_window_get_origin (socket->plug_window, &x, &y);
   gdk_error_trap_pop ();
-			 
+
+  gtk_widget_get_allocation (GTK_WIDGET(socket), &allocation);
   xconfigure.x = x;
   xconfigure.y = y;
-  xconfigure.width = GTK_WIDGET(socket)->allocation.width;
-  xconfigure.height = GTK_WIDGET(socket)->allocation.height;
+  xconfigure.width = allocation.width;
+  xconfigure.height = allocation.height;
 
   xconfigure.border_width = 0;
   xconfigure.above = None;
@@ -284,7 +288,7 @@ _gtk_socket_windowing_embed_notify (GtkSocket *socket)
 #endif
   _gtk_xembed_send_message (socket->plug_window,
 			    XEMBED_EMBEDDED_NOTIFY, 0,
-			    GDK_WINDOW_XWINDOW (GTK_WIDGET (socket)->window),
+			    GDK_WINDOW_XWINDOW (gtk_widget_get_window (GTK_WIDGET (socket))),
 			    socket->xembed_version);
 }
 
@@ -605,10 +609,14 @@ _gtk_socket_windowing_filter_func (GdkXEvent *gdk_xevent,
       break;
     case ReparentNotify:
       {
+        GdkWindow *window;
 	XReparentEvent *xre = &xevent->xreparent;
 
+        window = gtk_widget_get_window (widget);
+
 	GTK_NOTE (PLUGSOCKET, g_message ("GtkSocket - ReparentNotify received"));
-	if (!socket->plug_window && xre->parent == GDK_WINDOW_XWINDOW (widget->window))
+	if (!socket->plug_window &&
+            xre->parent == GDK_WINDOW_XWINDOW (window))
 	  {
 	    _gtk_socket_add_window (socket, xre->window, FALSE);
 	    
@@ -621,7 +629,9 @@ _gtk_socket_windowing_filter_func (GdkXEvent *gdk_xevent,
 	  }
         else
           {
-            if (socket->plug_window && xre->window == GDK_WINDOW_XWINDOW (socket->plug_window) && xre->parent != GDK_WINDOW_XWINDOW (widget->window))
+            if (socket->plug_window &&
+                xre->window == GDK_WINDOW_XWINDOW (socket->plug_window) &&
+                xre->parent != GDK_WINDOW_XWINDOW (window))
               {
                 gboolean result;
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]