Thanks for the gtk2 patch. We are not using debian so we're not sure what your
build environment is, but we encountered a few hitches building it after
patching:

   - the original configure was built with autoconf 2.13, but the patched
     configure.in uses gtk2 m4 macros which seem to require autoconf 2.61
   - the Makefile.in does not work with configure generated by autoconf 2.61;
     the resulting Makefile has some un-substituted $expressions
   - fix: hack configure to make it work

Also, the patched gbuffy itself had some problems:

   - segfaults when opening the configuration dialog or displaying
     headers (both operations try to draw a pixmap)
   - fix: remove the gdk_draw_bitmap function in gbuffy.c so that the internal
     gdk_draw_drawable function is used instead

   - window resets position when gbuffy_display is called again, e.g., after
     closing configuration dialog
   - fix: use a configure_event callback instead of using the timeout callback
     to update internal window state after a position/dimension change

   - mailbox button and main window don't grow and shrink
     immediately/correctly in response to changes in button label lengths
     (mailbox: <count>)
   - fix: still working on it; button and window sizes are correct when gbuffy
     is initially launched now, but not while it is running

We're not sure who exactly to contact about patching gbuffy, since the gtk2
patches seem to be pending only for the debian package. The gendiff output for
our patches is below, if you're interested.

Regards,
Kelvin Ku

--- ../tmp/gbuffy.c     2009-05-21 11:49:03.794448649 -0400
+++ gbuffy.c    2009-05-21 11:48:06.962703339 -0400
@@ -137,54 +144,6 @@
   return gdk_bitmap_create_from_data (w, data, 48, 48);
 }
 
-#include <gdk/gdkprivate.h>
-void
-gdk_draw_bitmap (GdkDrawable *drawable,
-                 GdkGC       *gc,
-                 GdkPixmap   *src,
-                 gint         xsrc,
-                 gint         ysrc,
-                 gint         xdest,
-                 gint         ydest,
-                 gint         width,
-                 gint         height)
-{
-  GdkWindow *drawable_private;
-  GdkWindow *src_private;
-  GdkGC *gc_private;
-  g_return_if_fail (drawable != NULL);
-  g_return_if_fail (src != NULL);
-  g_return_if_fail (gc != NULL);
-
-  drawable_private = (GdkWindow *) drawable;
-  src_private = (GdkWindow *) src;
-  gc_private = (GdkGC *) gc;
-
-  if (width == -1)
-/*    width = src_private->width; */
-    gdk_drawable_get_size (src_private, &width, &height);
-  if (height == -1)
-/*    height = src_private->height; */
-    gdk_drawable_get_size (src_private, &width, &height);
-
-/* BDD - No idea if this is correct. */
-/*  XCopyPlane (drawable_private->xdisplay, */
-/*             src_private->xwindow, */
-/*             drawable_private->xwindow, */
-/*             gc_private->xgc, */
-/*             xsrc, ysrc, */
-/*             width, height, */
-/*             xdest, ydest, 1); */
-/*} */
-  XCopyPlane (gdk_x11_display_get_xdisplay(drawable_private),
-             gdk_x11_get_default_root_xwindow(),
-             gdk_x11_get_default_root_xwindow,
-             gdk_x11_gc_get_xgc(gc_private),
-             xsrc, ysrc,
-             width, height,
-             xdest, ydest, 1);
-}
-
 gint configure_event (GtkWidget *da, GdkEventConfigure *event, BOX_INFO *box)
 {
   GList *headers;
@@ -554,9 +536,6 @@
 {
   BOX_INFO *mbox;
   int change;
-  gint cur_width;
-  gint cur_height;
-  static unsigned int beenhere = 0;
 
   mbox = MailboxInfo;
   while (mbox != NULL)
@@ -577,24 +560,6 @@
     mbox = mbox->next;
   }
 
-  /* This is the wrong way to do this, but its quick and dirty.  I
-   * should figure out what event I should capture to receive and update
-   * this information, but instead we just update it here. */
-
-  gdk_window_get_size(MainWindow->window, &cur_width, &cur_height);
-  if (cur_width != Width)
-    Width = cur_width;
-  if (cur_height != Height)
-    Height = cur_height;
-  
-  HorizPos.sign = POSITIVE;
-  VertPos.sign = POSITIVE;
-
-  if (beenhere)
-    gdk_window_get_position (MainWindow->window, &HorizPos.value, 
&VertPos.value);
-  else
-    beenhere = 1;
-
   return TRUE;
 }
 
@@ -637,6 +602,19 @@
 }
 #endif
 
+/*
+ * Saves main window position/dimensions in case it's destroyed and remade.
+ */
+gint main_window_configure_event (GtkWidget *widget, GdkEventConfigure *event, 
gpointer user_data)
+{
+   HorizPos.value = event->x;
+   VertPos.value = event->y;
+   HorizPos.sign = VertPos.sign = POSITIVE;
+   Width = event->width;
+   Height = event->height;
+   return TRUE;
+}
+
 void gbuffy_display ()
 {
   GtkWidget *box;
@@ -739,36 +718,40 @@
                      GTK_FILL | GTK_SHRINK,
                      0, 0);
     gtk_widget_show (mbox->button);
-    gtk_signal_connect_after (GTK_OBJECT (mbox->button), "button_press_event",
-       GTK_SIGNAL_FUNC (gbuffy_button_callback), mbox);
+
+    gtk_signal_connect (GTK_OBJECT (mbox->button), "button_press_event",
+       GTK_SIGNAL_FUNC (gbuffy_button_callback), (gpointer) mbox);
     gtk_signal_connect (GTK_OBJECT (mbox->button), "button_release_event",
-       GTK_SIGNAL_FUNC (gbuffy_delete_box), mbox);
-    gtk_signal_connect_after (GTK_OBJECT (mbox->button), "leave_notify_event",
-       GTK_SIGNAL_FUNC (gbuffy_leave_box), mbox);
+       GTK_SIGNAL_FUNC (gbuffy_delete_box), (gpointer) mbox);
+    gtk_signal_connect (GTK_OBJECT (mbox->button), "leave_notify_event",
+       GTK_SIGNAL_FUNC (gbuffy_leave_box), (gpointer) mbox);
     mbox = mbox->next;
     box_count++;
   }
 
-  gtk_widget_show (box);
+  // gbuffy_poll_boxes changes the sizes of the mailbox buttons
+  // which in turn changes the size of MainWindow
+  gbuffy_poll_boxes (NULL);
 
+  gtk_widget_show (box);
   gtk_widget_show (MainWindow);
+
   gdk_window_get_size(MainWindow->window, &cur_width, &cur_height);
   Width = (Width == -1) ? cur_width : Width;
   Height = (Height == -1) ? cur_height : Height;
   gdk_window_resize(MainWindow->window, Width, Height);
   
-  gbuffy_poll_boxes (NULL);
-
-  PollId = gtk_timeout_add (PollTime * 1000, gbuffy_poll_boxes, NULL);
-
-  if (!(HorizPos.sign != 0 && VertPos.sign != 0))
-    return;
+  // place window according to HorizPos/VertPos
   new_horizontal = (HorizPos.sign == POSITIVE) ? HorizPos.value :
     ScrW - Width - HorizPos.value;
   new_vertical = (VertPos.sign == POSITIVE) ? VertPos.value :
     ScrH - Height - VertPos.value;
   gdk_window_move(MainWindow->window, new_horizontal, new_vertical);
 
+  gtk_signal_connect (GTK_OBJECT (MainWindow), "configure_event",
+        GTK_SIGNAL_FUNC (main_window_configure_event), NULL);
+
+  PollId = gtk_timeout_add (PollTime * 1000, gbuffy_poll_boxes, NULL);
 }
 
 void parse_geometry(int *argc, char ***argv)
@@ -828,6 +811,14 @@
       break; /* We are done here */
     }
   }
+   if (HorizPos.value == -1) {
+      HorizPos.value = 1;
+      HorizPos.sign = POSITIVE;
+   }
+   if (VertPos.value == -1) {
+      VertPos.value = 1;
+      VertPos.sign = POSITIVE;
+   }
   if (remove == -1) 
   {
     argc--;

--- configure.orig      2009-05-20 14:08:06.703364076 -0400
+++ configure   2009-05-20 14:08:00.330593686 -0400
@@ -4680,20 +4680,20 @@
 
 DEFS=-DHAVE_CONFIG_H
 
-ac_libobjs=
-ac_ltlibobjs=
-for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue
-  # 1. Remove the extension, and $U if already installed.
-  ac_script='s/\$U\././;s/\.o$//;s/\.obj$//'
-  ac_i=`echo "$ac_i" | sed "$ac_script"`
-  # 2. Prepend LIBOBJDIR.  When used with automake>=1.10 LIBOBJDIR
-  #    will be set to the directory where LIBOBJS objects are built.
-  ac_libobjs="$ac_libobjs \${LIBOBJDIR}$ac_i\$U.$ac_objext"
-  ac_ltlibobjs="$ac_ltlibobjs \${LIBOBJDIR}$ac_i"'$U.lo'
-done
-LIBOBJS=$ac_libobjs
-
-LTLIBOBJS=$ac_ltlibobjs
+#ac_libobjs=
+#ac_ltlibobjs=
+#for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue
+#  # 1. Remove the extension, and $U if already installed.
+#  ac_script='s/\$U\././;s/\.o$//;s/\.obj$//'
+#  ac_i=`echo "$ac_i" | sed "$ac_script"`
+#  # 2. Prepend LIBOBJDIR.  When used with automake>=1.10 LIBOBJDIR
+#  #    will be set to the directory where LIBOBJS objects are built.
+#  ac_libobjs="$ac_libobjs \${LIBOBJDIR}$ac_i\$U.$ac_objext"
+#  ac_ltlibobjs="$ac_ltlibobjs \${LIBOBJDIR}$ac_i"'$U.lo'
+#done
+#LIBOBJS=$ac_libobjs
+#
+#LTLIBOBJS=$ac_ltlibobjs
 
 
 
@@ -5525,8 +5525,12 @@
 ' $ac_file_inputs` in
 *datarootdir*) ac_datarootdir_seen=yes;;
 *...@datadir@*|*...@docdir@*|*...@infodir@*|*...@localedir@*|*...@mandir@*)
-  { echo "$as_me:$LINENO: WARNING: $ac_file_inputs seems to ignore the 
--datarootdir setting" >&5
-echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir 
setting" >&2;}
+  {
+# XXX: disabling since Makefile.in was generated with old automake and we no
+# longer have the Makefile.am
+#echo "$as_me:$LINENO: WARNING: $ac_file_inputs seems to ignore the 
--datarootdir setting" >&5
+#echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir 
setting" >&2
+   true; }
 _ACEOF
 cat >>$CONFIG_STATUS <<_ACEOF
   ac_datarootdir_hack='



-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to