Hi,

this was indeed fixed upstream with commit e5eb127e (that depends on
e5eb127e to apply cleanly). A rough debdiff is attached. Tested on top
of current sid's 3.12.1-1, works for me.

This bug is really harming the usability of zenity in many real-world
situations, as indicated by the fact it's been reported numerous times
against various distributions.

It's unlikely that Jessie gets these fixes for free through zenity
3.14 (right?), so I hereby propose that we cherry-pick these two
commits for Jessie. What do the maintainers think?

If you agree that's the way to go, then I'm happy to prepare and
upload a NMU (I'll find better names for the quilt patches, and will
add proper DEP-3 headers).

Of course, I would fully understand if you preferred to do it
yourself, to keep everything in the team's Vcs-Svn repo (I must say
I didn't dare looking at the SVN-based workflow; would it be a Git
workflow I'm familiar with, then you would find git-format-patch'es
attached).

(Context: I'm primarily doing this so that we at Tails can stop
patching zenity when we migrate to Jessie. Delta-- :)

Cheers, and thanks a *lot* for maintaining GNOME in Debian!
--
  intrigeri
  | GnuPG key @ https://gaffer.ptitcanardnoir.org/intrigeri/intrigeri.asc
  | OTR fingerprint @ https://gaffer.ptitcanardnoir.org/intrigeri/otr.asc

diff -Nru zenity-3.12.1/debian/changelog zenity-3.12.1/debian/changelog
--- zenity-3.12.1/debian/changelog	2014-05-24 12:21:09.000000000 +0200
+++ zenity-3.12.1/debian/changelog	2014-06-07 15:39:35.000000000 +0200
@@ -1,3 +1,11 @@
+zenity (3.12.1-1+local0) UNRELEASED; urgency=medium
+
+  * Non-maintainer upload.
+  * New patches, taken from upstream Git: ec0c2f3 and e5eb127e.
+    (Closes: #702295)
+
+ -- intrigeri <intrig...@debian.org>  Sat, 07 Jun 2014 15:38:14 +0200
+
 zenity (3.12.1-1) unstable; urgency=low
 
   [ Jeremy Bicha ]
diff -Nru zenity-3.12.1/debian/patches/debian-702295 zenity-3.12.1/debian/patches/debian-702295
--- zenity-3.12.1/debian/patches/debian-702295	1970-01-01 01:00:00.000000000 +0100
+++ zenity-3.12.1/debian/patches/debian-702295	2014-06-07 15:31:18.000000000 +0200
@@ -0,0 +1,31 @@
+diff --git a/src/msg.c b/src/msg.c
+index f5d4dc9..f287f25 100644
+--- a/src/msg.c
++++ b/src/msg.c
+@@ -27,7 +27,7 @@
+#include "util.h"
+static void zenity_msg_dialog_response (GtkWidget *widget, int response, gpointer data);
+-
++static void zenity_text_size_allocate (GtkWidget *widget, GtkAllocation *allocation, gpointer data);
+static void
+zenity_msg_construct_question_dialog (GtkWidget *dialog, ZenityMsgData *msg_data, ZenityData *data)
+{
+@@ -161,6 +161,9 @@ zenity_msg (ZenityData *data, ZenityMsgData *msg_data)
+if (msg_data->ellipsize)
+gtk_label_set_ellipsize (GTK_LABEL(text), PANGO_ALIGN_RIGHT);
++ else
++ g_signal_connect_after (G_OBJECT (text), "size-allocate",
++ G_CALLBACK (zenity_text_size_allocate), data);
+if (msg_data->dialog_icon)
+gtk_image_set_from_icon_name (GTK_IMAGE (image), msg_data->dialog_icon, GTK_ICON_SIZE_DIALOG);
+@@ -179,6 +182,11 @@ zenity_msg (ZenityData *data, ZenityMsgData *msg_data)
+gtk_main ();
+}
++static void
++zenity_text_size_allocate (GtkWidget *widget, GtkAllocation *allocation, gpointer data)
++{
++ gtk_widget_set_size_request (widget, allocation->width, -1);
++}
+static void
+zenity_msg_dialog_response (GtkWidget *widget, int response, gpointer data)
+
diff -Nru zenity-3.12.1/debian/patches/debian-702295.diff zenity-3.12.1/debian/patches/debian-702295.diff
--- zenity-3.12.1/debian/patches/debian-702295.diff	1970-01-01 01:00:00.000000000 +0100
+++ zenity-3.12.1/debian/patches/debian-702295.diff	2014-06-07 15:38:02.000000000 +0200
@@ -0,0 +1,44 @@
+commit e5eb127e9779b9a58e53b1a7d268b81284ebd241
+Author: Arx Cruz <arxc...@gnome.org>
+Date:   Thu May 29 17:51:46 2014 -0300
+
+    Bug #670496 and #673643
+    
+    This fix the size of GtkLabel width when you have a big
+    text in the dialog.
+
+diff --git a/src/msg.c b/src/msg.c
+index f5d4dc9..f287f25 100644
+--- a/src/msg.c
++++ b/src/msg.c
+@@ -27,7 +27,7 @@
+ #include "util.h"
+ 
+ static void zenity_msg_dialog_response (GtkWidget *widget, int response, gpointer data);
+-
++static void zenity_text_size_allocate (GtkWidget *widget, GtkAllocation *allocation, gpointer data);
+ static void
+ zenity_msg_construct_question_dialog (GtkWidget *dialog, ZenityMsgData *msg_data, ZenityData *data)
+ {
+@@ -161,6 +161,9 @@ zenity_msg (ZenityData *data, ZenityMsgData *msg_data)
+ 
+   if (msg_data->ellipsize)
+ 	gtk_label_set_ellipsize (GTK_LABEL(text), PANGO_ALIGN_RIGHT);
++  else
++	g_signal_connect_after (G_OBJECT (text), "size-allocate",
++                          G_CALLBACK (zenity_text_size_allocate), data);
+   
+   if (msg_data->dialog_icon)
+     gtk_image_set_from_icon_name (GTK_IMAGE (image), msg_data->dialog_icon, GTK_ICON_SIZE_DIALOG);
+@@ -179,6 +182,11 @@ zenity_msg (ZenityData *data, ZenityMsgData *msg_data)
+   gtk_main ();
+ }
+ 
++static void 
++zenity_text_size_allocate (GtkWidget *widget, GtkAllocation *allocation, gpointer data)
++{
++  gtk_widget_set_size_request (widget, allocation->width, -1);
++}
+ 
+ static void
+ zenity_msg_dialog_response (GtkWidget *widget, int response, gpointer data)
diff -Nru zenity-3.12.1/debian/patches/ellipsize.diff zenity-3.12.1/debian/patches/ellipsize.diff
--- zenity-3.12.1/debian/patches/ellipsize.diff	1970-01-01 01:00:00.000000000 +0100
+++ zenity-3.12.1/debian/patches/ellipsize.diff	2014-06-07 15:37:57.000000000 +0200
@@ -0,0 +1,172 @@
+commit ec0c2f3292b3db0fdad7f02ed068a97b66f7a2ea
+Author: Arx Cruz <arxc...@gnome.org>
+Date:   Tue May 20 16:05:32 2014 -0300
+
+    Add the --ellipsize option to info, error, warning and question dialogs
+    
+    This option will help people who need to add huge texts in their dialogs
+    and the window size get's very huge due amount of size that GtkLabel
+    requests
+
+diff --git a/src/msg.c b/src/msg.c
+index f4d5e7a..f5d4dc9 100644
+--- a/src/msg.c
++++ b/src/msg.c
+@@ -159,6 +159,9 @@ zenity_msg (ZenityData *data, ZenityMsgData *msg_data)
+       gtk_label_set_markup (GTK_LABEL (text), g_strcompress (msg_data->dialog_text));
+   }
+ 
++  if (msg_data->ellipsize)
++	gtk_label_set_ellipsize (GTK_LABEL(text), PANGO_ALIGN_RIGHT);
++  
+   if (msg_data->dialog_icon)
+     gtk_image_set_from_icon_name (GTK_IMAGE (image), msg_data->dialog_icon, GTK_ICON_SIZE_DIALOG);
+  
+@@ -176,6 +179,7 @@ zenity_msg (ZenityData *data, ZenityMsgData *msg_data)
+   gtk_main ();
+ }
+ 
++
+ static void
+ zenity_msg_dialog_response (GtkWidget *widget, int response, gpointer data)
+ {
+diff --git a/src/option.c b/src/option.c
+index fb25f37..1b2bb5c 100644
+--- a/src/option.c
++++ b/src/option.c
+@@ -47,6 +47,7 @@ static gchar   *zenity_general_ok_button;
+ static gchar   *zenity_general_cancel_button;
+ static gboolean zenity_general_modal;
+ static gint     zenity_general_attach;
++static gboolean zenity_general_dialog_ellipsize;
+ 
+ /* Calendar Dialog Options */
+ static gboolean zenity_calendar_active;
+@@ -389,6 +390,14 @@ static GOptionEntry error_options[] = {
+     &zenity_general_dialog_no_markup,
+     N_("Do not enable pango markup")
+   },
++  {
++	"ellipsize",
++	'\0',
++	G_OPTION_FLAG_NOALIAS,
++	G_OPTION_ARG_NONE,
++	&zenity_general_dialog_ellipsize,
++	N_("Enable ellipsize in dialog text. This fix the high window size with big texts")
++  },
+   { 
+     NULL 
+   } 
+@@ -439,6 +448,14 @@ static GOptionEntry info_options[] = {
+     &zenity_general_dialog_no_markup,
+     N_("Do not enable pango markup")
+   },
++  {
++	"ellipsize",
++	'\0',
++	G_OPTION_FLAG_NOALIAS,
++	G_OPTION_ARG_NONE,
++	&zenity_general_dialog_ellipsize,
++	N_("Enable ellipsize in dialog text. This fix the high window size with big texts")
++  },
+   { 
+     NULL 
+   }
+@@ -809,6 +826,14 @@ static GOptionEntry question_options[] = {
+     N_("Give cancel button focus by default"),
+     NULL
+   },
++  {
++	"ellipsize",
++	'\0',
++	G_OPTION_FLAG_NOALIAS,
++	G_OPTION_ARG_NONE,
++	&zenity_general_dialog_ellipsize,
++	N_("Enable ellipsize in dialog text. This fix the high window size with big texts")
++  },
+   { 
+     NULL 
+   }
+@@ -939,6 +964,14 @@ static GOptionEntry warning_options[] = {
+     &zenity_general_dialog_no_markup,
+     N_("Do not enable pango markup")
+   },
++  {
++	"ellipsize",
++	'\0',
++	G_OPTION_FLAG_NOALIAS,
++	G_OPTION_ARG_NONE,
++	&zenity_general_dialog_ellipsize,
++	N_("Enable ellipsize in dialog text. This fix the high window size with big texts")
++  },
+   { 
+     NULL 
+   }
+@@ -1646,6 +1679,7 @@ zenity_general_post_callback (GOptionContext *context,
+   results->data->cancel_label = zenity_general_cancel_button;
+   results->data->modal = zenity_general_modal;
+   results->data->attach = zenity_general_attach;
++
+   return TRUE;
+ }
+ 
+@@ -1741,6 +1775,7 @@ zenity_error_post_callback (GOptionContext *context,
+     results->msg_data->mode = ZENITY_MSG_ERROR; 
+     results->msg_data->no_wrap = zenity_general_dialog_no_wrap; 
+     results->msg_data->no_markup = zenity_general_dialog_no_markup;
++	results->msg_data->ellipsize = zenity_general_dialog_ellipsize;
+   }
+     
+   return TRUE;
+@@ -1760,6 +1795,7 @@ zenity_info_post_callback (GOptionContext *context,
+     results->msg_data->mode = ZENITY_MSG_INFO; 
+     results->msg_data->no_wrap = zenity_general_dialog_no_wrap;
+     results->msg_data->no_markup = zenity_general_dialog_no_markup;
++	results->msg_data->ellipsize = zenity_general_dialog_ellipsize;
+   }
+   
+   return TRUE;
+@@ -1936,6 +1972,7 @@ zenity_question_post_callback (GOptionContext *context,
+     results->msg_data->mode = ZENITY_MSG_QUESTION;
+     results->msg_data->no_wrap = zenity_general_dialog_no_wrap;
+     results->msg_data->no_markup = zenity_general_dialog_no_markup;
++	results->msg_data->ellipsize = zenity_general_dialog_ellipsize;
+     results->msg_data->default_cancel = zenity_question_default_cancel;
+   }
+ 
+@@ -1983,6 +2020,7 @@ zenity_warning_post_callback (GOptionContext *context,
+     results->msg_data->mode = ZENITY_MSG_WARNING;
+     results->msg_data->no_wrap = zenity_general_dialog_no_wrap;
+     results->msg_data->no_markup = zenity_general_dialog_no_markup;
++	results->msg_data->ellipsize = zenity_general_dialog_ellipsize;
+   }
+ 
+   return TRUE;
+@@ -2405,10 +2443,13 @@ zenity_option_parse (gint argc, gchar **argv)
+     if(results->mode == MODE_FILE || results->mode == MODE_ERROR || results->mode == MODE_WARNING || results->mode == MODE_INFO)
+       zenity_option_error (zenity_option_get_name (general_options, &zenity_general_cancel_button), ERROR_SUPPORT);
+   
+-
+   if (zenity_general_dialog_no_wrap)
+     if (results->mode != MODE_INFO && results->mode != MODE_ERROR && results->mode != MODE_QUESTION && results->mode != MODE_WARNING && results->mode != MODE_TEXTINFO)
+       zenity_option_error (zenity_option_get_name (text_options, &zenity_general_dialog_no_wrap), ERROR_SUPPORT);
+-  
++
++  if (zenity_general_dialog_ellipsize)
++    if (results->mode != MODE_INFO && results->mode != MODE_ERROR && results->mode != MODE_QUESTION && results->mode != MODE_WARNING)
++      zenity_option_error (zenity_option_get_name (text_options, &zenity_general_dialog_ellipsize), ERROR_SUPPORT);
++
+   return results; 
+ }
+diff --git a/src/zenity.h b/src/zenity.h
+index 6e1b687..d3606cd 100644
+--- a/src/zenity.h
++++ b/src/zenity.h
+@@ -67,6 +67,7 @@ typedef struct {
+   gboolean no_wrap;
+   gboolean no_markup;
+   gboolean default_cancel;
++  gboolean ellipsize;
+ } ZenityMsgData;
+ 
+ typedef struct {
diff -Nru zenity-3.12.1/debian/patches/series zenity-3.12.1/debian/patches/series
--- zenity-3.12.1/debian/patches/series	1970-01-01 01:00:00.000000000 +0100
+++ zenity-3.12.1/debian/patches/series	2014-06-07 15:38:02.000000000 +0200
@@ -0,0 +1,2 @@
+ellipsize.diff
+debian-702295.diff

Reply via email to