[PATCH] Fixing the KMix applet

Christian Esken c.esken at cityweb.de
Sun Nov 23 20:34:04 GMT 2003


On Sunday 23 November 2003 18:20, Andras Mantia wrote:
> On Sunday 23 November 2003 18:39, Christian Esken wrote:
> > >3. After restarting KDE or kicker the mixer applet was very wide, there
> > > was
> >
> > Nice. These fix ugly bugs.
> >
> > >-       updateSize(true);
> > >+       updateSize(false);
> >
> > Why do you need to change this?
>
> To fix the above problem.
>
> > And are you aware that kmixerwidget.cpp is not only part of the applet,
> > but of the main application itself? This change could screw up resizing
> > the main window (especially after enabling/disabling the "Advanced"
> > checkbox).
>
> No... Well, changing true to false solves the applet is too wide problem.
> It may be not the best solution.

It's the best solution. I have not correctly looked at the sources. The code 
above is *explicitely* not executed on the main window.

>
> > > -      emit updateLayout();
> > > +      QTimer::singleShot(0, m_mixerwidget, SLOT(updateSize()));
> >
> > I think this might OK, but why is it neccesary? And wouldn't it then be
> > neccesary for MixDeviceWidget::setStereoLinked() too?
>
> I don't know. I just looked at the functions involved in channel
> hiding/showing. If the updateSize() call is not delayed, the hide()/show()
> in the MixDeviceWidget::setDisabled() may not be executed when the
> KMixerWidget::updateSize() is called, and the layout() width will be still
> wrong. This causes the bug that the last channel is not visible even after
> you enable it, only if you hide another channel. Restoring the other
> channel hides the last one again, as the minimum width is too small. Enable
> the debug line in KMixerWidget::updateSize() and you will see what does the
> layout()->minimumSize().width() contain after hiding/showing channels.
>
> Now I looked at the setStereoLinked() and yes, it seems that it needs to be
> done also there. Or use the same trick as with
> KKMixApplet::triggerUpdateLayout / KMixApplet::updateLayoutNow.

Acknowledged. The patch is good. I have applied the patch now (except the 
strange "-void , +void" patch lines).

Only one part of the patch is not good: The channel hiding/showing. It would 
not work if there are channels with the same name. The real  patch is much 
more complicated. Please see it attach and comment.

Helio around? An OK from you to commit?

Chris

-------------- next part --------------
A non-text attachment was scrubbed...
Name: kmix-hideShowMixer.diff
Type: text/x-diff
Size: 4137 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20031123/ecc08233/attachment.diff>


More information about the kde-core-devel mailing list