After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 565144 - balance midpoint
balance midpoint
Status: RESOLVED FIXED
Product: gnome-media
Classification: Deprecated
Component: gnome-volume-control
unspecified
Other Linux
: Normal normal
: ---
Assigned To: gnome media maintainers
gnome media maintainers
: 567590 (view as bug list)
Depends on: 565656 569240
Blocks:
 
 
Reported: 2008-12-20 02:26 UTC by Matthias Clasen
Modified: 2009-01-26 19:48 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
test.c (651 bytes, text/plain)
2008-12-26 03:07 UTC, Matthias Clasen
  Details
a working patch (1018 bytes, patch)
2009-01-03 18:20 UTC, Matthias Clasen
committed Details | Review
Add left/right/middle marks to balance scroll (2.49 KB, patch)
2009-01-21 16:53 UTC, Luca Ferretti
committed Details | Review

Description Matthias Clasen 2008-12-20 02:26:18 UTC
The balance slider should have a visible/noticable midpoint, and some easy way to reset to it.
Comment 1 William Jon McCann 2008-12-20 07:11:12 UTC
Completely agree.  Also the range widget is the wrong choice because it shows the left/lesser side of the range as a different color from the other.
Comment 2 Matthias Clasen 2008-12-25 23:39:03 UTC
I've added an implementation of 'marks' for GtkScale in bug 565656 
Comment 3 Matthias Clasen 2008-12-26 03:06:13 UTC
And here is an example that shows how to turn of the filled drawing for an individual scale. This works fine with Clearlooks. See 
http://bugzilla.redhat.com/show_bug.cgi?id=477941 for what needs to happen to make it work with the default Fedora theme.
Comment 4 Matthias Clasen 2008-12-26 03:07:03 UTC
Created attachment 125323 [details]
test.c
Comment 5 Matthias Clasen 2009-01-03 18:20:43 UTC
Created attachment 125695 [details] [review]
a working patch
Comment 6 Bastien Nocera 2009-01-13 13:23:11 UTC
*** Bug 567590 has been marked as a duplicate of this bug. ***
Comment 7 Luca Ferretti 2009-01-21 16:53:04 UTC
Created attachment 126929 [details] [review]
Add left/right/middle marks to balance scroll

Just a 5 minute hack, maybe I removed too much [v|h]boxes :)

To check:
 * how many marks we want? 3? 5?
 * RTL/LTR behavior (left is left, right is right, should not swap)
 * gtk version in configure

OT: "Balance:" label should provide an accelerator, as per HIG
Comment 8 Matthias Clasen 2009-01-22 07:26:15 UTC
3, because there's only 3 special points: left, middle, right.
and yes, rtl flipping is a bad idea here, so better set a fixed text direction on the scale.
Comment 9 Bastien Nocera 2009-01-26 17:55:21 UTC
It crashes with gtk2-2.15.1-4.fc11.x86_64, with the patch applied:

==29746== Invalid free() / delete / delete[]
==29746==    at 0x4A0609F: free (vg_replace_malloc.c:323)
==29746==    by 0x4FC0D85: _gtk_range_set_stop_values (gtkrange.c:3605)
==29746==    by 0x4FE0CB3: gtk_scale_finalize (gtkscale.c:1176)
==29746==    by 0x343560D958: g_object_unref (in /lib64/libgobject-2.0.so.0.1902.0)
==29746==    by 0x4EB6432: gtk_box_forall (gtkbox.c:1249)
==29746==    by 0x4EEDB75: gtk_container_destroy (gtkcontainer.c:1066)
==29746==    by 0x343560B77E: g_closure_invoke (in /lib64/libgobject-2.0.so.0.1902.0)
==29746==    by 0x34356229F6: (within /lib64/libgobject-2.0.so.0.1902.0)
==29746==    by 0x3435623D08: g_signal_emit_valist (in /lib64/libgobject-2.0.so.0.1902.0)
==29746==    by 0x3435624272: g_signal_emit (in /lib64/libgobject-2.0.so.0.1902.0)
==29746==    by 0x4FA89DD: gtk_object_dispose (gtkobject.c:421)
==29746==    by 0x343560DD4F: g_object_run_dispose (in /lib64/libgobject-2.0.so.0.1902.0)
==29746==  Address 0xfae1f08 is 0 bytes inside a block of size 24 free'd
==29746==    at 0x4A0609F: free (vg_replace_malloc.c:323)
==29746==    by 0x4FC31AD: gtk_range_destroy (gtkrange.c:1227)
==29746==    by 0x343560B77E: g_closure_invoke (in /lib64/libgobject-2.0.so.0.1902.0)
==29746==    by 0x34356229F6: (within /lib64/libgobject-2.0.so.0.1902.0)
==29746==    by 0x3435623D08: g_signal_emit_valist (in /lib64/libgobject-2.0.so.0.1902.0)
==29746==    by 0x3435624272: g_signal_emit (in /lib64/libgobject-2.0.so.0.1902.0)
==29746==    by 0x4FA89DD: gtk_object_dispose (gtkobject.c:421)
==29746==    by 0x343560DD4F: g_object_run_dispose (in /lib64/libgobject-2.0.so.0.1902.0)
==29746==    by 0x4EB6432: gtk_box_forall (gtkbox.c:1249)
==29746==    by 0x4EEDB75: gtk_container_destroy (gtkcontainer.c:1066)
==29746==    by 0x343560B77E: g_closure_invoke (in /lib64/libgobject-2.0.so.0.1902.0)
==29746==    by 0x34356229F6: (within /lib64/libgobject-2.0.so.0.1902.0)
==29746== 
==29746== Invalid free() / delete / delete[]
==29746==    at 0x4A0609F: free (vg_replace_malloc.c:323)
==29746==    by 0x4FC0DB9: _gtk_range_set_stop_values (gtkrange.c:3608)
==29746==    by 0x4FE0CB3: gtk_scale_finalize (gtkscale.c:1176)
==29746==    by 0x343560D958: g_object_unref (in /lib64/libgobject-2.0.so.0.1902.0)
==29746==    by 0x4EB6432: gtk_box_forall (gtkbox.c:1249)
==29746==    by 0x4EEDB75: gtk_container_destroy (gtkcontainer.c:1066)
==29746==    by 0x343560B77E: g_closure_invoke (in /lib64/libgobject-2.0.so.0.1902.0)
==29746==    by 0x34356229F6: (within /lib64/libgobject-2.0.so.0.1902.0)
==29746==    by 0x3435623D08: g_signal_emit_valist (in /lib64/libgobject-2.0.so.0.1902.0)
==29746==    by 0x3435624272: g_signal_emit (in /lib64/libgobject-2.0.so.0.1902.0)
==29746==    by 0x4FA89DD: gtk_object_dispose (gtkobject.c:421)
==29746==    by 0x343560DD4F: g_object_run_dispose (in /lib64/libgobject-2.0.so.0.1902.0)
==29746==  Address 0xfae1f50 is 0 bytes inside a block of size 12 free'd
==29746==    at 0x4A0609F: free (vg_replace_malloc.c:323)
==29746==    by 0x4FC31C0: gtk_range_destroy (gtkrange.c:1228)
==29746==    by 0x343560B77E: g_closure_invoke (in /lib64/libgobject-2.0.so.0.1902.0)
==29746==    by 0x34356229F6: (within /lib64/libgobject-2.0.so.0.1902.0)
==29746==    by 0x3435623D08: g_signal_emit_valist (in /lib64/libgobject-2.0.so.0.1902.0)
==29746==    by 0x3435624272: g_signal_emit (in /lib64/libgobject-2.0.so.0.1902.0)
==29746==    by 0x4FA89DD: gtk_object_dispose (gtkobject.c:421)
==29746==    by 0x343560DD4F: g_object_run_dispose (in /lib64/libgobject-2.0.so.0.1902.0)
==29746==    by 0x4EB6432: gtk_box_forall (gtkbox.c:1249)
==29746==    by 0x4EEDB75: gtk_container_destroy (gtkcontainer.c:1066)
==29746==    by 0x343560B77E: g_closure_invoke (in /lib64/libgobject-2.0.so.0.1902.0)
==29746==    by 0x34356229F6: (within /lib64/libgobject-2.0.so.0.1902.0)
Comment 10 Bastien Nocera 2009-01-26 17:59:59 UTC
This patch against GTK+ should fix it.
Index: gtkrange.c
===================================================================
--- gtkrange.c	(revision 22222)
+++ gtkrange.c	(working copy)
@@ -1225,7 +1225,9 @@
   if (range->layout->n_marks)
     {
       g_free (range->layout->marks);
+      range->layout->marks = NULL;
       g_free (range->layout->mark_pos);
+      range->layout->mark_pos = NULL;
       range->layout->n_marks = 0;
     }
Comment 11 Bastien Nocera 2009-01-26 19:48:23 UTC
2009-01-26  Bastien Nocera  <hadess@hadess.net>

	* src/gvc-balance-bar.c (_scale_box_new), (gvc_balance_bar_init):
	Patch from Luca Ferretti <elle.uca@libero.it>, to use the new GTK+
	scale marks for the balance widget (Closes: #565144)

2009-01-26  Bastien Nocera  <hadess@hadess.net>

        * src/gvc-balance-bar.c (gvc_balance_bar_init): Make sure the balance
        bar stays Left to Right, so that the Left balance is really on the 
        left

I also added a mnemonic to the Balance slider.