Bug 198547

Summary: Taskbar entries' context menu is too large and has empty space on it (menu is not "expanded")
Product: [Unmaintained] kdelibs Reporter: Sergio PR <sergio.pe.facebook+kde>
Component: qtAssignee: kdelibs bugs <kdelibs-bugs>
Status: RESOLVED UPSTREAM    
Severity: normal CC: a.samirh78, andresbajotierra, aseigo, cyberbeat, finex, georg.wittenburg, hf.farhad, jonathan.camp, kollix, lfpg.dev, luke-jr+kdebugs, plasma-bugs, slashdevdsp, vespas
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: openSUSE   
OS: Unspecified   
Latest Commit: Version Fixed In:
Sentry Crash Report:
Attachments: qmenu patch

Description Sergio PR 2009-07-01 18:12:04 UTC
Version:           KDE 4.3 RC1 (using KDE 4.2.90)
Installed from:    SuSE RPMs

When there is only 1 task in the taskbar, if you right-click on it, the context menu that appears is wider than the one which appears if there's more than one task.

Some images:

http://files.getdropbox.com/u/1040020/contextmenu1.png
http://files.getdropbox.com/u/1040020/contextmenu2.png

Tested with KDE 4.3 RC1 from KDE Four Live CD.
Comment 1 FiNeX 2009-07-01 22:20:14 UTC
Bug confirmed in current trunk (r989863)
Comment 2 Beat Wolf 2009-07-02 10:40:19 UTC
*** Bug 198579 has been marked as a duplicate of this bug. ***
Comment 3 Jonathan Camp 2009-07-10 21:07:35 UTC
in windowtaskitem.cpp:290 and taskgroupitem.cpp:378 under kdebase/workspace/plasma/applets/tasks we have...

menu.adjustSize();

if (m_applet->formFactor() != Plasma::Vertical) {
    menu.setMinimumWidth(size().width());
}

I am new to this so I have had problems building the project, I'll spend more time figuring out how to set up the kde development environment later but if someone with a working setup could try this out that would be ideal.

To get the authors intended design I think something that updates the layout needs to added after this.  Maybe updateGeometery()?  We could also remove that setMinimumWidth block and make it a standard context menu.
Comment 4 FiNeX 2009-07-19 13:20:50 UTC
*** Bug 200696 has been marked as a duplicate of this bug. ***
Comment 5 Beat Wolf 2009-07-22 15:56:33 UTC
*** Bug 201087 has been marked as a duplicate of this bug. ***
Comment 6 Aaron J. Seigo 2009-07-23 05:53:02 UTC
the menu is set to have a minimum width of the width of the button in the tasks widget. 

if the menu can't be that small (e.g. it's a small button in the tasks widget) then the menu will be wider than the button.

if the button is wider than the natural minimum of the menu, then the menu will be expanded to the width of the button.

to see why this is obviously needed, simply consider clicking anywhere to the right of a wide task button.
Comment 7 Luke-Jr 2009-07-23 07:07:51 UTC
That made no sense to me at all. The current result of this bug looks extremely awkward, and I see no reason the menu can't work like any other menu...
Comment 8 Georg Wittenburg 2009-07-23 10:49:45 UTC
+1 on Luke-Jr

Aaron, please reconsider because:
1) This is actually a regression; it was working as expected by the reporter of this bug in 4.2.
2) The beta-testers want to help you improve the software: There have been four bug reports on this (this one and three duplicates).
3) Your argument why the current behavior is correct ("consider clicking anywhere to the right of a wide task button") does not apply to the width of the context menu.
4) The current behavior (see screenshot at http://files.getdropbox.com/u/1040020/contextmenu1.png posted by Sergio) is clearly sub-standard given Plasma's claim for "sophisticated elegance" (http://plasma.kde.org/cms/1029). A matter of taste, I know, but if you disagree, consider asking around on plasma-devel or some apropriate place.

If it can't be done for 4.3-final then leave it open or even tag it wishlist.
Comment 9 Sergio PR 2009-07-23 12:07:37 UTC
I completely agree with Georg. I don't understand why it was working right in KDE 4.2 and now this behaviour is considered as good.
Comment 10 Paschalis Veskos 2009-07-23 12:18:34 UTC
Aaron, I would agree with you only if the text selection width was as wide as the menu (and the text spanned the entire menu; as it is, the '>' is in the middle). We either need to revert to the old behaviour, or expand the text to fill the menu.
Comment 11 Jonathan Camp 2009-07-23 16:41:40 UTC
If I can help to clarify, Aaron was closing this because the tasks code is correct, it just currently depends on a patch for qt that he is putting through.  I asked him about this through email and this is part of his reply.

"i posted a patch (a one liner) to fix this in qmenu to another bug and CC'd
one of the trolltech people. i'll post the patch for inclusion in our qt-copy
and send it upstream again. you can find it attached in the meantime."
Comment 12 Jonathan Camp 2009-07-23 16:42:57 UTC
Created attachment 35571 [details]
qmenu patch

This patch makes the action rectangles auto fill to widget size.
Comment 13 Georg Wittenburg 2009-07-23 17:50:02 UTC
Jonathan, thanks for the clarification; Aaron, thanks for fixing it upstream.
Comment 14 FiNeX 2009-08-07 11:18:54 UTC
*** Bug 201071 has been marked as a duplicate of this bug. ***
Comment 15 Ahmad Samir 2009-08-07 11:30:19 UTC
ummm... I see what Aaron means, still with 4.3 final, moving the menu expansion arrow, e.g. Advanced *>* to the far right looks better.
Comment 16 Jonathan Camp 2009-08-07 22:47:50 UTC
medo: it's actually a problem with qt, and from talking to someone there I was told the patch would be applied to the 4.6 branch.  it was commited to the master here -> http://qt.gitorious.org/qt/qt/commit/baf3ec81ca5d5cd38b54dc853c12109956a98cb9
Comment 17 FiNeX 2009-08-08 16:48:43 UTC
*** Bug 203072 has been marked as a duplicate of this bug. ***
Comment 18 Farhad Hedayati 2009-08-08 21:01:37 UTC
this happens even if there are more than one task , ( i've seen this on KDE svn trunk and 4.3.0)
Comment 19 Jonathan Camp 2009-08-08 21:58:04 UTC
Farhad: the bug description is a bit incorrect but it is fixed in qt 4.6
Comment 20 Dario Andres 2009-08-19 04:43:04 UTC
*** Bug 203834 has been marked as a duplicate of this bug. ***
Comment 21 Dario Andres 2009-09-03 01:58:33 UTC
*** Bug 206043 has been marked as a duplicate of this bug. ***
Comment 22 Dario Andres 2009-09-22 17:17:24 UTC
*** Bug 208146 has been marked as a duplicate of this bug. ***
Comment 23 Dario Andres 2009-09-22 17:17:59 UTC
*** Bug 192850 has been marked as a duplicate of this bug. ***