Bug 219873 - Combobox in the battery applet is clipped by the dialog border/panel
Summary: Combobox in the battery applet is clipped by the dialog border/panel
Status: RESOLVED FIXED
Alias: None
Product: plasma4
Classification: Unmaintained
Component: widget-battery (show other bugs)
Version: unspecified
Platform: Compiled Sources Unspecified
: NOR normal
Target Milestone: ---
Assignee: Plasma Bugs List
URL:
Keywords:
: 206993 219903 220275 222549 223088 224334 224796 225567 226337 227702 228009 228572 228608 230099 231611 233145 233162 236759 238459 241461 243695 244201 246273 247390 249003 250080 252641 252938 (view as bug list)
Depends on:
Blocks:
 
Reported: 2009-12-23 20:23 UTC by Alex
Modified: 2011-09-24 21:10 UTC (History)
7 users (show)

See Also:
Latest Commit:
Version Fixed In: 4.5.2
Sentry Crash Report:


Attachments
Simple possible workaround: only show 2 items at the time in the dropdown; (dropdown will have scrollbars too) (649 bytes, patch)
2010-04-09 03:23 UTC, Dario Andres
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Alex 2009-12-23 20:23:03 UTC
Version:            (using Devel)
Installed from:    Compiled sources

powersave combobox in the battery applet is clipped by the panel, so not of all the powersave profiles are shown in the battery applet combobox. I mean they all are surely there and i actualy can select the proper one by the keyboard but i can't do this by the mouse becouse they simply clipped by the panel. Screenshot of what i mean: http://picasaweb.google.com/PhilatAlexander/Kde#5418159023332195458 - presentation profile is not shown in the combobox
Comment 1 Dario Andres 2009-12-24 02:24:34 UTC
*** Bug 219903 has been marked as a duplicate of this bug. ***
Comment 2 Dario Andres 2009-12-24 02:24:57 UTC
There were other related reports IIRC
Comment 3 Christoph Feck 2009-12-28 19:26:06 UTC
*** Bug 220275 has been marked as a duplicate of this bug. ***
Comment 4 Dario Andres 2010-01-11 00:39:30 UTC
A previous report with similar issues: bug 200270
@Marco: where you working on workaround to this issues (for contextualmenus and
similar "popup" widgets to bypass the QGraphicsView) ?
Regards
Comment 5 Dario Andres 2010-01-11 00:44:10 UTC
BTW; I can reproduce this bug here using:

Qt: 4.6.0 (kde-qt master commit 747ff8e6ef6f5a1163dfa75bc9ac4755ce7083d1
        Date:   Tue Dec 15 11:58:13 2009 +0100)
KDE Development Platform: 4.4.59 (KDE 4.4.59 (KDE 4.5 >= 20100107))
kdelibs svn rev. 1072256 / kdebase svn rev. 1072256
on ArchLinux i686 - Kernel 2.6.31.6

I had to use a big font size (12px+) to experience the problem.
Comment 6 Dario Andres 2010-01-13 15:36:20 UTC
*** Bug 222549 has been marked as a duplicate of this bug. ***
Comment 7 Dario Andres 2010-01-19 19:05:06 UTC
*** Bug 223088 has been marked as a duplicate of this bug. ***
Comment 8 Beat Wolf 2010-01-26 22:33:24 UTC
*** Bug 224334 has been marked as a duplicate of this bug. ***
Comment 9 Beat Wolf 2010-01-26 22:34:54 UTC
This is actualy in a indirect way a QT bug. Plasma should use the comboboxes in another way than they are used right now, but that triggers a qt bug, which can be tracked here:
http://bugreports.qt.nokia.com/browse/QTBUG-7254

when that gets fixed, the battery app can get fixed.
The only alternative now would be removing the toolbox (which i think you can't really do without losing the functionality)
Comment 10 Dario Andres 2010-01-29 17:59:29 UTC
*** Bug 224796 has been marked as a duplicate of this bug. ***
Comment 11 Jithin Emmanuel 2010-02-03 10:34:34 UTC
Is there any workaround for this. Right now there is NO way I can select presentation profile.
It would be great if this can be fixed for 4.4 final release.
Comment 12 Christoph Feck 2010-02-05 01:39:25 UTC
*** Bug 225567 has been marked as a duplicate of this bug. ***
Comment 13 Dario Andres 2010-02-11 23:05:24 UTC
*** Bug 226337 has been marked as a duplicate of this bug. ***
Comment 14 Dario Andres 2010-02-20 00:38:59 UTC
*** Bug 227702 has been marked as a duplicate of this bug. ***
Comment 15 Dario Andres 2010-02-22 13:24:46 UTC
*** Bug 228009 has been marked as a duplicate of this bug. ***
Comment 16 markuss 2010-02-22 13:34:53 UTC
As a work-around, the developer could move the Profile combobox further to the top, eg. by switching positions with the screen brightness slider.
That won't fix the bug, but make at least a few more items in the combobox visible.
Comment 17 Christoph Feck 2010-02-26 05:12:35 UTC
*** Bug 206993 has been marked as a duplicate of this bug. ***
Comment 18 Christoph Feck 2010-02-26 05:12:47 UTC
*** Bug 228572 has been marked as a duplicate of this bug. ***
Comment 19 Dario Andres 2010-02-26 21:03:39 UTC
*** Bug 228608 has been marked as a duplicate of this bug. ***
Comment 20 Bruno Menegola 2010-03-07 01:41:08 UTC
Just helping some people: You can use the arrow keys to select clipped profiles.

Hope this ugly bug gets fixed soon.
Comment 21 Christoph Feck 2010-03-09 14:59:41 UTC
*** Bug 230099 has been marked as a duplicate of this bug. ***
Comment 22 Aaron J. Seigo 2010-03-09 17:13:39 UTC
this is indeed a but in Qt and it affects -all- of our comboboxes. there is absolutely nothing we can do about this until the freezes in qt are dealt with. i'm cc'ing one of the QGraphicsView developers so they can see just how urgent and critical this issue is.
Comment 23 Dario Andres 2010-03-22 18:44:10 UTC
*** Bug 231611 has been marked as a duplicate of this bug. ***
Comment 24 Dario Andres 2010-04-03 14:01:53 UTC
*** Bug 233145 has been marked as a duplicate of this bug. ***
Comment 25 Dario Andres 2010-04-03 14:02:21 UTC
*** Bug 233162 has been marked as a duplicate of this bug. ***
Comment 26 Alexis MENARD 2010-04-06 06:19:59 UTC
It's not an easy issue and http://labs.trolltech.com/blogs/2008/12/17/solving-how-popups-are-clipped-to-viewport-in-graphics-view/ remembers the issue. We still haven't found any proper way to solve that.
Comment 27 Tom Chiverton 2010-04-06 19:27:04 UTC
Sure it's difficult, but there are work arounds (like redesigning the box) that should be done in the mean time.
Comment 28 postdoc38 2010-04-06 22:47:44 UTC
It is high time to quote the famous "if it ain't broken, don't fix it". It worked quite well in previous versions. I wonder how it is we are now at 4.4.2 with such an outstanding bug...
Comment 29 Vivek 2010-04-09 02:58:05 UTC
(In reply to comment #28)
> It is high time to quote the famous "if it ain't broken, don't fix it". It
> worked quite well in previous versions. I wonder how it is we are now at 4.4.2
> with such an outstanding bug...

It was broken in earlier versions as well, and the bug was reported as early as November last year.  The only difference was that the power profile box was designed differently and in the earlier design, the defaults did not drop too far.  The newer power dialog box is much snazzier and smoother on the eyes, but less functional while this bug exists.

I understand that it's a complex issue and will take time to fix properly.  In the meanwhile, redesigning the box or designing some other workaround would be useful, from my perspective.
Comment 30 Dario Andres 2010-04-09 03:23:34 UTC
Created attachment 42608 [details]
Simple possible workaround: only show 2 items at the time in the dropdown; (dropdown will have scrollbars too)
Comment 31 Sebastian Kügler 2010-04-16 14:55:24 UTC
More likely, only show two options at all (Performance, Powersaving), more than that is nto really necessary for most users (and those who want it can add more profiles).
Comment 32 Joe Mulloy 2010-04-16 15:55:18 UTC
What about "Presentation"? It's vital to anyone who wants to run a presentation on their laptop. Removing features to work around this bug is just silly.

(In reply to comment #31)
> More likely, only show two options at all (Performance, Powersaving), more than
> that is nto really necessary for most users (and those who want it can add more
> profiles).
Comment 33 Sebastian Kügler 2010-04-16 19:21:11 UTC
Apps that do presentations should set this mode themselves, if the user has to do it, she'll forget it and you're back to square one.
Comment 34 Tom Chiverton 2010-04-16 19:28:56 UTC
That's not really going to fly. You could be presenting with any application from Eclipse to Konsole, which is why there is a 'presentation' mode in the first place.
Adding that KDE specific feature to every* GUI application isn't going to be a viable solution.

Either we should redesign the dialogue (so there is more room below the drop down) or just fix the underlying QT issue (back porting if needed). I vote the former while we wait for Nokia to do the latter- at least it's making the issue less bad.
Comment 35 Marvin 2010-04-16 19:32:30 UTC
Name me one app that switches to "presentation" profile! AFAIK not even Okular does that!

But that's not the point. There must be a simple hack around the problem until it gets solved by the qt folks.
Comment 36 Sebastian Kügler 2010-04-17 17:31:25 UTC
@Tom: How is adding one line to a couple of apps not a "viable" solution? If we put this kind of stuff in the wrong place of the stack, we'll never get it to happen automatically. It's not a KDE-specific feature, btw, but a FDO-standardized mode.

"I vote the former" means that you want to give it a go, or that you vote that I do it?

@Marvin: The quick hack you're talking about is removing options from the UI I don't want in there in the first place.
Comment 37 Mat Lechner 2010-04-17 20:15:16 UTC
@Sebastian: It is no viable solution, because then basically every app (even non-kde) would need that line, even apps for which the respective developer would never even think of adding that feature. As Tom said: What if I want to use a non-presentation app like konsole or konqueror in the presentation energy profile (or another profile)? What should be the rule for these apps to automatically switch it on? Wouldn't it make more sense to implement your auto-switching-feature just for typical presentation apps like okular and koffice, and leave the obviously beloved and requested profile-switching function in the battery applet? What about adding scrollbars to the dropdown menu while waiting for the qt-team to fix this problem?
Comment 38 postdoc38 2010-04-17 20:22:31 UTC
BTW, in the good old days, there was a blacklist of programs that when running would prevent the screensaver from kicking in. That was very useful. An obvious example that comes to my mind is watching a movie fullscreen with mplayer...
Comment 39 Tom Chiverton 2010-04-18 11:21:25 UTC
To be clear, we shouldn't remove the options.

Work arounds that occur to me could be to move the drop down to the very top of the dialogue, or replace the drop down with a list selection of fixed height.
Comment 40 Sebastian Kügler 2010-04-19 23:13:34 UTC
mplayer actually does prevent the screensaver and idle-time mechanisms to kick in, by "faking" input events.

Not doing the presentation mode automatically means two things:

- I'll forget to switch to presentation mode before doing a presentation
- I'll forget to switch back afterwards

Doing this kind of stuff manually really is a clutch, and apps that don't get it right. What kinds of apps do you have in mind btw, I'm imagining presentation software and movie players, but can't really think of anything else.

I wouldn't go as far as putting scollbars manually into the drop-down, for the following reasons:

- it means we get to mess with the sizing of the individual widgets which usually brings in a slew of other problems, think of truncated or incorrectly sized text, especially when you start varying font sizes, this kind of hacks makes layout less flexible because it creates special cases on a level where you wouldn't expect it.

- it hides a bug. This bug (combobox popup ends up under another widget) needs to be fixed in Qt. Papering over the layering bug will make it harder to get it fixed because it's less visible and harder to confirm working.

- scrollbars on a transient popupwidget are a usability nightmare, because it's just too easy to 'dismiss' the popup when not hitting the scrollbars correctly. With a touchpad, it's even less pleasant.
Comment 41 Mat Lechner 2010-04-20 01:40:33 UTC
@ frank: 

I perfectly understand your argument about the scrollbars. What do you think about the idea of (temporarily) moving the dropdown-menue to a higher postion in the applet?

To the question of automatic presentation mode: I first what to make clear that I really think it is a great idea in many cases, especially for presentation apps. But I don't think it can totally replace the manual selection. What if I want to show a browser window (think of flash video or other forms of streaming) in presentation mode? Also, it is comfortable to have different (self defined) energy profiles, even for using the same application: When watching a movie on my laptop at home I want a bright screen, but I want to save battery using a dimmed screen when showing the same movie someone at work, with my notebook connected to a beamer.
I don't think that there is any doubt that playing a video or starting a presentation should automatically e.g. stop any screensavers from working, but an "energy profile" consists of many settings (like the screen brightness mentioned above), which can be very situation-dependent, especially for video players.
Comment 42 Sebastian Kügler 2010-04-20 11:25:33 UTC
You'll still be able to do that, we're only talking about *default* profiles.
Comment 43 Tom Chiverton 2010-04-20 20:48:07 UTC
Let's not get side-tracked into discussion about more general power management/profile issues.

This bug is about a nasty GUI glitch that almost all users of the feature will encounter.

I agree that redesign'ing the popup is work, and masks the real problem. We can revisit this bug once QT has fixed itself. 
QT doesn't appear to be fixing this in a sensible timescale, so we should make our users experience better in the mean time.

As far as I can tell looking at the popup just now, if you move the power profile drop down up (to the top, or even to just below the two status lines of text) it would fix this issue for everyone. This wouldn't have any impact on varying font sizes and wouldn't need a list box (w/scroll bars).
Comment 44 Alexis MENARD 2010-04-21 01:51:11 UTC
@Tom : 
"QT doesn't appear to be fixing this in a sensible timescale, so we should make
our users experience better in the mean time."

First it's Qt not QT. Nokia don't maintain QuickTime. :D

I'm actually looking at this bug and as expected it's not easy. Actually I'm think of using another thing that implementing the clipping issue. I'll go back to sebas with a patch.

I'll spent one more day on it but after I'll postpone the work, we have much more critical bugs that needs to be fixed for 4.7.0 and the release is close. Also sorry if we don't fix the bug too fast for you but this is not the only bug we have. After all Qt source code is open, help will be appreciate.

/me going back to debugging.
Comment 45 Christoph Feck 2010-05-19 00:25:26 UTC
*** Bug 236759 has been marked as a duplicate of this bug. ***
Comment 46 Dario Andres 2010-06-12 02:06:25 UTC
*** Bug 241461 has been marked as a duplicate of this bug. ***
Comment 47 Sebastian Kügler 2010-06-14 10:47:14 UTC
I've cleaned up the profiles that are installed by default, which should alleviate this bug (but not fix it).
Comment 48 Beat Wolf 2010-06-14 10:50:26 UTC
i didn't look at the code and don't know if it's even possible, but what about opening the selection box in the oposite direction of the panel?
Comment 49 Christoph Feck 2010-07-06 01:21:49 UTC
*** Bug 243695 has been marked as a duplicate of this bug. ***
Comment 50 Christoph Feck 2010-07-30 16:01:26 UTC
*** Bug 246273 has been marked as a duplicate of this bug. ***
Comment 51 Sebastian Kügler 2010-07-30 16:23:17 UTC
@Beat: that's exactly what should be happening. It's Qt's domain though, we don't have any control over the direction the combo box is opened (hence this bug is marked as upstream)
Comment 52 Tom Chiverton 2010-07-30 17:25:53 UTC
@Sebastian, as of the current 4.5 RC I have (RC2, Kubuntu PPA packages), it still opens downwards, thus cutting off.
Comment 53 Sebastian Kügler 2010-07-30 19:32:12 UTC
I know. It should either open upwards or on top of the panel (not below it).

What I've done for 4.5 is cleaning up the powerdevil default profiles, those desperately needed work anyway and it was long on my TODO list. This list is shorter now, so the problem is more or less avoided in the default case.

It's not a proper solution by all means, just some conincidental band-aid -- this needs to be fixed in Qt.
Comment 54 Alexis MENARD 2010-07-30 19:58:31 UTC
The way the popup works NOW make the bug impossible to solve in the Qt side. 

Why?

Because the panel is a *separate* QGraphicsView therefore a separate window/widget in X. The popup in the combo is not a top level widget, it's embedded in the QGraphicsView window/widget which is rendered by the Plasma::Dialog of the battery applet. Since the panel is always on top because of KWin there is no hope to get the combobox popup on top of the panel.

It's different from a regular combobox (i.e. not embedded) with popup where the popup *is* a top level widget when it is displayed. Then the window manager is able to understand and therefore is always on top of anything else.

It's a limitation of the framework/QGraphicsView/QGraphicsProxyWidget. There is a flag which helps but was not designed for this purpose : Qt::BypassGraphicsProxyWidget, it works for unique widget, not widget with popups.

Solution : Something different than a combobox for the profile. Perhaps you can move the brightness setting in the kcm. Who uses that everyday if you have proper profiles correctly setup? What about a button that slide the content on the left and bring a list of profiles, some kind of pages?
Comment 55 Tom Chiverton 2010-07-30 21:37:11 UTC
As none of people on this bug are likely to get the new defaults, and there is only room for three, I take it that'll be 'Plugged in, 'Battery' and 'Presentation' ?
That's going to jar a bit with the two drop downs for 'When battery is at' drop downs in the main power settings panel, no ?

An alternative GUI layout would have been a better solution as per #54, but this bug was allowed to wallow for so long it's probably too late to get that in before the release :-(
Comment 56 Christoph Feck 2010-08-03 12:19:48 UTC
*** Bug 238459 has been marked as a duplicate of this bug. ***
Comment 57 Sebastian Kügler 2010-08-11 00:06:37 UTC
SVN commit 1161833 by sebas:

Move the profiles combobox up one row

This works around #219873 by giving more space to the combobox's
dropdown. This should work for up to 4 profiles, while we default to 3
right now.

Also remove the ifdef for 4.5 and clean up some unused debug statements.

BUG:219873

 M  +13 -21    battery.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=1161833
Comment 58 Sebastian Kügler 2010-08-11 00:34:57 UTC
SVN commit 1161840 by sebas:

Move the profiles combobox up one row
    
    This works around #219873 by giving more space to the combobox's
    dropdown. This should work for up to 4 profiles, while we default to 3
    right now.
    
Also remove the ifdef for 4.5 and clean up some unused debug statements.
    
CCBUG:219873
FIXED-IN:4.5.1
Backported from trunk


 M  +13 -15    battery.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=1161840
Comment 59 Sebastian Kügler 2010-08-11 00:44:46 UTC
@Alexis: The purpose of the brightness slider is to override the power profiles setting. Imagine you're sitting on the balcony in the half-shadow. Your laptop panel is reasonable, but you need to set it to full brightness in order to be able to see anything on the screen. You still want all the powersaving stuff, just not the brightness.

Another (more likely) use case: You get up in the middle of the night to check your email. You get your laptop (which is plugged in and turned to fully bright accordingly). You do need your eyes to adjust to the too-bright display, so you turn down the brightness temporarily.

Granted, some hardware has brightness buttons, on some hardware it even works (2 out of 3 machines w/ brightness control here), but the slider over there definitely has its uses.

Cheers =)
Comment 60 Christoph Feck 2010-08-11 16:39:44 UTC
*** Bug 247390 has been marked as a duplicate of this bug. ***
Comment 61 Christoph Feck 2010-08-11 17:04:29 UTC
SVN commit 1162174 by cfeck:

Limit number of profiles that are visible

Now when there are more than four profiles are in the menu,
a scroll bar will appear.

Thanks to sebas for the review, will commit to 4.5 branch
if this is desired.

CCBUG:219873


 M  +3 -0      battery.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=1162174
Comment 62 Tom Chiverton 2010-08-11 19:50:06 UTC
Hurrah ! Thank you so much !
Please get this on the 4.5 branch if at all possible - it's polish like this that really helps...
Comment 63 Sebastian Kügler 2010-08-11 20:12:01 UTC
Let's first run it for a bit and see if there are any ill side-effects. 4.5.1 is far enough away to give it some good spanking.
Comment 64 postdoc38 2010-08-16 09:27:28 UTC
If I may, I'd like to add that the "four" of comment #61 worries me: right now I can only see two profiles in the drop down, not three as (most?) other people...
Comment 65 Christoph Feck 2010-08-16 09:59:28 UTC
postdoc, do you have the patch from comment #58?
Comment 66 postdoc38 2010-08-16 10:24:56 UTC
Christoph, short answer: I don't know. Long answer: I am using opensuse rpm's for 4.5 and kdebase4-workspace says version 4.5.0-493.1.

I tried to check out

svn://anonsvn.kde.org/home/kde/trunk/KDE/kdebase/workspace/plasma/generic/applets/battery

but cmake failed, and I did not want to pull the whole repository. Is there a way to test the applet without compiling the whole of kde?
Comment 67 Sebastian Kügler 2010-08-18 19:28:02 UTC
It should be sufficient to have kdelibs development packages installed, since those contain libplasma and the solid stuff that's needed by the battery.

There *might* be some stuff in workspace libs as well (didn't check), in that case, install those development packages as well.

In openSUSE, that would be kdelibs4-devel and kdebase4-workspace-devel  if I'm not mistaken.
Comment 68 postdoc38 2010-08-19 13:50:12 UTC
@Sebas: thanks for the note, updating kdelibs4 and kdebase4-workspace was the only thing needed. FYI, in opensuse's scheme, the -devel packages contain headers necessary for development, not the libraries themselves.

@Christoph: the above update made this patch available to me, as I can now see three profiles.
Comment 69 Christoph Feck 2010-08-31 00:23:14 UTC
SVN commit 1170157 by cfeck:

Work around Qt 4.6 bug in QComboBox::setMaxVisibleItems

Hopefully this is the last workaround for a workaround for a workaround
of a bug that should not be there in the first place ...

Since this Qt bug is fixed in Qt 4.7 we need the version check. Note that
this is a _compile time_ check, so if you upgrade to Qt 4.7, you have to
recompile Plasma, otherwise it will be limited to just 3 visible entries.

Please test in trunk, so that it can be (finally) backported to 4.5.2.

CCBUG: 219873


 M  +6 -1      battery.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=1170157
Comment 70 Christoph Feck 2010-08-31 00:54:11 UTC
*** Bug 249003 has been marked as a duplicate of this bug. ***
Comment 71 Christoph Feck 2010-08-31 01:40:28 UTC
SVN commit 1170162 by cfeck:

Limit number of profiles that are visible (backport r1162174 and r1170157)

FIXED-IN: 4.5.2
BUG: 219873


 M  +9 -1      battery.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=1170162
Comment 72 Christoph Feck 2010-09-04 03:29:06 UTC
*** Bug 250080 has been marked as a duplicate of this bug. ***
Comment 73 Tom Chiverton 2010-09-04 14:20:30 UTC
As of 4.5.1, there is room for showing 4 options, so some improvement.
Comment 74 Christoph Feck 2010-09-28 18:23:20 UTC
*** Bug 252641 has been marked as a duplicate of this bug. ***
Comment 75 Christoph Feck 2010-10-01 13:16:59 UTC
*** Bug 252938 has been marked as a duplicate of this bug. ***
Comment 76 Christoph Feck 2011-09-24 21:10:28 UTC
*** Bug 244201 has been marked as a duplicate of this bug. ***