Re: Our size allocation issues



On Tue, 2002-08-20 at 18:45, Owen Taylor wrote:
>  a) size_request the toplevel
>  b) allocate the toplevel to the requested size 
>  c) realize the toplevel
>  d) map the toplevel

	Then again - I just added:

Index: bonobo/bonobo-socket.c
===================================================================
RCS file: /cvs/gnome/libbonoboui/bonobo/bonobo-socket.c,v
retrieving revision 1.44
diff -u -p -u -r1.44 bonobo-socket.c
--- bonobo/bonobo-socket.c      20 Aug 2002 14:18:19 -0000      1.44
+++ bonobo/bonobo-socket.c      21 Aug 2002 10:16:11 -0000
@@ -346,4 +346,18 @@ bonobo_socket_add_id (BonoboSocket   *so
        GtkSocket *gtk_socket = (GtkSocket *) socket;
 
        gtk_socket_add_id (gtk_socket, xid);
+
+       /* The allocate didn't get through even to the in-proc case,
+        * so do it again */
+       if (gtk_socket->plug_widget) {
+               GtkAllocation child_allocation;
+
+               child_allocation.x = 0;
+               child_allocation.y = 0;
+               child_allocation.width = GTK_WIDGET
(gtk_socket)->allocation.width;
+               child_allocation.height = GTK_WIDGET
(gtk_socket)->allocation.height;
+
+               gtk_widget_size_allocate (gtk_socket->plug_widget,
+                                         &child_allocation);
+       }
 }

	Which fixes the problem 'for me' inside libbonoboui in an inelegant,
unsatisfying but extremely functional fashion it seems.

> > 	Anyway; the patch looks like this, although I'd also like to kill the
> > socket->same_app, since it's a synonym for socket->plug_widget != NULL;
> > and it's only used once. 
> 
> Maybe you want to send a separate patch for that cleanup?

	Here it is:

diff -u -p -u -r1.3579 ChangeLog
--- ChangeLog   19 Aug 2002 14:39:40 -0000      1.3579
+++ ChangeLog   21 Aug 2002 10:55:57 -0000
@@ -1,3 +1,11 @@
+2002-08-21  Michael Meeks  <michael ximian com>
+
+       * gtk/gtksocket.c (gtk_socket_grab_notify):
+       use plug_widget != NULL == same_app
+
+       * gtk/gtkplug.c (_gtk_plug_add_to_socket),
+       (_gtk_plug_remove_from_socket): kill same_app bits.
+
 2002-08-19  Padraig O'Briain <padraig obriain sun com>
 
        * gtk/gtkentry.c (gtk_entry_real_delete_text): Use 
diff -u -p -u -r1.57 gtkplug.c
--- gtk/gtkplug.c       20 Jun 2002 23:59:21 -0000      1.57
+++ gtk/gtkplug.c       21 Aug 2002 10:55:58 -0000
@@ -231,7 +231,6 @@ _gtk_plug_add_to_socket (GtkPlug   *plug
 
   gtk_plug_set_is_child (plug, TRUE);
   plug->same_app = TRUE;
-  socket->same_app = TRUE;
   socket->plug_widget = widget;
 
   plug->socket_window = GTK_WIDGET (socket)->window;
@@ -287,8 +286,6 @@ _gtk_plug_remove_from_socket (GtkPlug   
   g_object_unref (socket->plug_window);
   socket->plug_window = NULL;
   
-  socket->same_app = FALSE;
-
   plug->same_app = FALSE;
   plug->socket_window = NULL;
 
diff -u -p -u -r1.51 gtksocket.c
--- gtk/gtksocket.c     2 Jul 2002 16:22:19 -0000       1.51
+++ gtk/gtksocket.c     21 Aug 2002 10:55:59 -0000
@@ -762,7 +762,7 @@ gtk_socket_grab_notify (GtkWidget *widge
 {
   GtkSocket *socket = GTK_SOCKET (widget);
 
-  if (!socket->same_app)
+  if (!socket->plug_widget)
     send_xembed_message (GTK_SOCKET (widget),
                         was_grabbed ? XEMBED_MODALITY_OFF : XEMBED_MODALITY_ON,
                         0, 0, 0, gtk_get_current_event_time ());
Index: gtk/gtksocket.h
===================================================================
RCS file: /cvs/gnome/gtk+/gtk/gtksocket.h,v
retrieving revision 1.15
diff -u -p -u -r1.15 gtksocket.h
--- gtk/gtksocket.h     6 Jun 2002 15:38:39 -0000       1.15
+++ gtk/gtksocket.h     21 Aug 2002 10:55:59 -0000
@@ -57,7 +57,6 @@ struct _GtkSocket
   GtkWidget *plug_widget;
 
   gshort xembed_version;       /* -1 == not xembed */
-  guint same_app : 1;
   guint focus_in : 1;
   guint have_size : 1;
   guint need_map : 1;

	Hmm,

		Michael.

-- 
 mmeeks gnu org  <><, Pseudo Engineer, itinerant idiot




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