Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 10 Jun 2018 17:45:43 +0000
From:      bugzilla-noreply@freebsd.org
To:        ports-bugs@FreeBSD.org
Subject:   [Bug 228873] [patch] audio/pavucontrol: fix unreadable label names due to ellipsize side-effect with GTK2 option
Message-ID:  <bug-228873-7788@https.bugs.freebsd.org/bugzilla/>

next in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D228873

            Bug ID: 228873
           Summary: [patch] audio/pavucontrol: fix unreadable label names
                    due to ellipsize side-effect with GTK2 option
           Product: Ports & Packages
           Version: Latest
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Many People
          Priority: ---
         Component: Individual Port(s)
          Assignee: romain@FreeBSD.org
          Reporter: samy.mahmoudi@gmail.com
          Assignee: romain@FreeBSD.org
             Flags: maintainer-feedback?(romain@FreeBSD.org)

Description:
When building audio/pavucontrol against GTK2 (default option), the label na=
mes
of the streams/devices are improperly ellipsized. The GTK+2 Reference Manual
mentions the side-effect that the label requests only enough space to displ=
ay
the ellipsis "...".
URL: https://developer.gnome.org/gtk2/stable/GtkLabel.html#GtkLabel--ellips=
ize

Reproducibility:
pkg install --yes pavucontrol && pavucontrol

Workaround for devices:
Conditionally patch src/pavucontrol.glade to expand corresponding labels
(patches provided below)

Workarounds for streams (by increasing order of preference):
=E2=80=A2 Make GTK3 the default option (fixes not only streams but also dev=
ices)
=E2=80=A2 Conditionally patch src/pavucontrol.glade to set the "ellipsize" =
property of
the affected labels to none. Runs the risk of stretching the window
horizontally more than the screen size if the label name is too long
(nevertheless, patch may be provided).
=E2=80=A2 Conditionally patch src/pavucontrol.glade to expand the affected =
labels.
Works flawlessly with devices but slightly changes the pavucontrol expected
appearance with streams because each stream is followed by an "on" label wh=
ich
gets shifted at right (nevertheless, patch may be provided).
=E2=80=A2 Conditionally patch src/mainwindow.cc to set the "width-chars" pr=
operty
dynamically if the label name is less than 64 characters and to ellipsize
beyond 64 characters otherwise (patches provided below).

# Patch to apply to Makefile
--- Makefile.orig       2018-06-10 18:56:03.808240000 +0200
+++ Makefile    2018-06-10 18:55:59.757969000 +0200
@@ -30,6 +30,7 @@
 GTK2_USE=3D      GNOME=3Dgtkmm24
 GTK2_LIB_DEPENDS=3D      libcanberra.so:audio/libcanberra
 GTK2_CONFIGURE_ON=3D     --disable-gtk3
+GTK2_EXTRA_PATCHES=3D    ${PATCHDIR}/extra-patch-gtk2-ellipsize-side-effect

 GTK3_USE=3D      GNOME=3Dgtkmm30
 GTK3_LIB_DEPENDS=3D      libcanberra-gtk3.so:audio/libcanberra-gtk3
# End of file

# Patch file to add to files/extra-patch-gtk2-ellipsize-side-effect
--- src/mainwindow.cc.orig      2015-03-24 14:39:00 UTC
+++ src/mainwindow.cc
@@ -758,9 +758,11 @@ void MainWindow::updateSinkInput(const p
         g_free(txt);
         w->nameLabel->set_markup(txt =3D g_markup_printf_escaped(": %s",
info.name));
         g_free(txt);
+        w->nameLabel->set_width_chars ((strlen(info.name) < 62) ?
strlen(info.name) : 62);
     } else {
         w->boldNameLabel->set_text("");
         w->nameLabel->set_label(info.name);
+        w->nameLabel->set_width_chars ((strlen(info.name) < 64) ?
strlen(info.name) : 64);
     }

     w->nameLabel->set_tooltip_text(info.name);
@@ -813,9 +815,11 @@ void MainWindow::updateSourceOutput(cons
         g_free(txt);
         w->nameLabel->set_markup(txt =3D g_markup_printf_escaped(": %s",
info.name));
         g_free(txt);
+        w->nameLabel->set_width_chars ((strlen(info.name) < 62) ?
strlen(info.name) : 62);
     } else {
         w->boldNameLabel->set_text("");
         w->nameLabel->set_label(info.name);
+        w->nameLabel->set_width_chars ((strlen(info.name) < 64) ?
strlen(info.name) : 64);
     }

     w->nameLabel->set_tooltip_text(info.name);
@@ -897,6 +901,7 @@ bool MainWindow::createEventRoleWidget()

     eventRoleWidget->boldNameLabel->set_text("");
     eventRoleWidget->nameLabel->set_label(_("System Sounds"));
+    eventRoleWidget->nameLabel->set_width_chars (13);

=20=20=20=20
eventRoleWidget->iconImage->set_from_icon_name("multimedia-volume-control",
Gtk::ICON_SIZE_SMALL_TOOLBAR);

--- src/pavucontrol.glade.orig  2015-03-24 14:39:00 UTC
+++ src/pavucontrol.glade
@@ -259,7 +259,7 @@
                             <property name=3D"ellipsize">end</property>
                           </object>
                           <packing>
-                            <property name=3D"expand">False</property>
+                            <property name=3D"expand">True</property>
                             <property name=3D"fill">True</property>
                             <property name=3D"position">1</property>
                           </packing>
# End of file

--=20
You are receiving this mail because:
You are the assignee for the bug.=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-228873-7788>