gtk+-1.0.4 / handlebox / BUG REPORT (II)



handleboxes do no expect to be unrealized then rerealized whilst
detached - in fact doing so results in a nasty large float_window
occluding your entire screen - not anymore :

(to be applied after my last patch to the same file of a few minutes
ago...)

*** gtkhandlebox.c	1998/07/02 15:50:50	1.2
--- gtkhandlebox.c	1998/07/02 16:32:28
***************
*** 302,309 ****
    if (GTK_BIN (hb)->child)
      gtk_widget_set_parent_window (GTK_BIN (hb)->child,
hb->bin_window);
    
!   attributes.x = 0;
!   attributes.y = 0;
    attributes.width = widget->requisition.width;
    attributes.height = widget->requisition.height;
    attributes.window_type = GDK_WINDOW_TOPLEVEL;
--- 302,309 ----
    if (GTK_BIN (hb)->child)
      gtk_widget_set_parent_window (GTK_BIN (hb)->child,
hb->bin_window);
    
!   attributes.x = hb->dragoff_x;	/* where we stored them as */
!   attributes.y = hb->dragoff_y;	/* we were unrealized - or (0,0) */
    attributes.width = widget->requisition.width;
    attributes.height = widget->requisition.height;
    attributes.window_type = GDK_WINDOW_TOPLEVEL;
***************
*** 326,331 ****
--- 326,345 ----
    gtk_style_set_background (widget->style, widget->window,
GTK_WIDGET_STATE (hb));
    gtk_style_set_background (widget->style, hb->bin_window,
GTK_WIDGET_STATE (hb));
    gtk_style_set_background (widget->style, hb->float_window,
GTK_WIDGET_STATE (hb));
+ 
+   if (hb->child_detached)
+   {
+     /* we were already detached when we were unrealized */
+ 
+     gdk_window_reparent (hb->bin_window, hb->float_window, 0, 0);
+     gdk_window_set_hints (hb->float_window, attributes.x,
attributes.y, 0, 0, 0, 0, GDK_HINT_POS);
+ 
+     /* do we need this ?
+        gtk_handle_box_draw_ghost (hb);
+     */
+     
+     gtk_widget_queue_resize (widget);
+   }
  }
  
  static void
***************
*** 341,346 ****
--- 355,362 ----
    gdk_window_set_user_data (hb->bin_window, NULL);
    gdk_window_destroy (hb->bin_window);
    hb->bin_window = NULL;
+   /* remember float_window coords - in case we get realized again */
+   gdk_window_get_origin (hb->float_window, &(hb->dragoff_x),
&(hb->dragoff_y));
    gdk_window_set_user_data (hb->float_window, NULL);
    gdk_window_destroy (hb->float_window);
    hb->float_window = NULL;
begin:          vcard
fn:             Jules Gosnell
n:              Gosnell;Jules
email;internet: Julian.Gosnell@nomura.co.uk
x-mozilla-cpt:  ;0
x-mozilla-html: FALSE
version:        2.1
end:            vcard



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