Bug 317783

Summary: Tooltip position is wrong whenever there isn't any gui element on screen
Product: [Plasma] plasma4 Reporter: Ömer Fadıl USTA <omerusta>
Component: widget-systemtrayAssignee: Plasma Bugs List <plasma-bugs>
Status: RESOLVED UNMAINTAINED    
Severity: normal CC: adaptee, annma, benoitd38, cjacker, gchm2, greta_watson, modellbaukeller, obuolis1, plasma-bugs, rdieter, t.jp, thoor1
Priority: NOR Keywords: regression
Version: git master   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed In:
Attachments: bug Screenshot ( bug can be seen )
bug Screenshot ( bug can NOT be seen )
A short screencast showing the problem

Description Ömer Fadıl USTA 2013-04-03 14:50:31 UTC
There is a new bug about that boxed tips ( i don't know how to explain it - The information boxes whenever you put your mouse over systray ) (Maybe tooltips)

if there isn't any other application running ( i mean application with a gui ) that tips goes upper side of screen instead of being near system tray
( also it happens if all other applications are minimized to tray )

for example if you move your mouse over klipper's icon in system tray and a tooltip appears which says "Clipboard Contents"  at near system tray  ( bottom side ) if any gui element on screen. 
On the other hand if i minimize all other application that "Clipboard Contents" Tooltips goes top of screen
This bug is not exist in 4.10 but it is exist in master branch

Reproducible: Always
Comment 1 Ömer Fadıl USTA 2013-04-03 14:53:31 UTC
If needed i can take screenshots /video or other needed informations about this bug.
Comment 2 Anne-Marie Mahfouf 2013-04-03 14:57:40 UTC
Confirming, I can reproduce.
Comment 3 Ömer Fadıl USTA 2013-04-03 15:41:25 UTC
Created attachment 78612 [details]
bug Screenshot ( bug can be seen )

If there isn't any gui element on screen ( all applications are minimized )
you can see bug. ( Check the position of tooltip )
Comment 4 Ömer Fadıl USTA 2013-04-03 15:42:47 UTC
Created attachment 78613 [details]
bug Screenshot ( bug can NOT be seen )

If there IS a gui element on the screen ( for example konsole application is not 
minimized ) there isn't any bug ( Check the position of tooltip )
Comment 5 Ömer Fadıl USTA 2013-04-07 14:16:54 UTC
The bug is still exist with today's master branch build (07/05/13)
Comment 6 Jekyll Wu 2013-04-18 03:22:02 UTC
Created attachment 78999 [details]
A short screencast showing the problem

Notice in the screencast how the tooltip positions are right for some widgets while wrong for others. 

And the problem happens only when all windows are minimized.
Comment 7 Jekyll Wu 2013-07-07 11:22:22 UTC
*** Bug 314708 has been marked as a duplicate of this bug. ***
Comment 8 Jekyll Wu 2013-07-07 11:34:50 UTC
*** Bug 313578 has been marked as a duplicate of this bug. ***
Comment 9 Greta Watson 2013-07-09 04:39:30 UTC
Bug still occurs in Fedora 19.  I have narrowed it down to the modification in system settings of an icon size:  system settings --> application appearance --> icons --> advanced --> dialogs --> increase size from 32 to 48.  Then, after you log out and in again, the bug shows up.  If the dialogs size is set back to 32, the bug goes away.
Comment 10 daniel 2013-08-07 15:55:55 UTC
confirm on my kubuntu 13.04 with kde 10.4.5
Comment 11 daniel 2013-08-18 09:09:18 UTC
is also present in kubuntu 13.04 with kde 4.11.0(In reply to comment #10)
> confirm on my kubuntu 13.04 with kde 4.10.5
Comment 12 daniel 2013-08-18 09:10:06 UTC
(In reply to comment #10)
> confirm on my kubuntu 13.04 with kde 4.10.5
Comment 13 daniel 2013-08-22 22:17:13 UTC
in : systemsettings/application apearance/icons/advanced/panell icon ; press the default value button the bug disappears (sorry for my english)
Comment 14 Jekyll Wu 2013-08-22 22:46:46 UTC
*** Bug 314702 has been marked as a duplicate of this bug. ***
Comment 15 t.jp 2013-08-23 07:53:28 UTC
*** Bug 314702 has been marked as a duplicate of this bug. ***
Comment 16 Jekyll Wu 2013-11-13 09:52:45 UTC
*** Bug 327425 has been marked as a duplicate of this bug. ***
Comment 17 Cjacker 2013-12-20 18:32:50 UTC
The problem is in QGraphicsView *viewFor(const QGraphicsItem *item) of plasma.cpp and affect "popupPosition" in corona.cpp.

===========viewFor in plasma.cpp===================
QGraphicsView *viewFor(const QGraphicsItem *item)
{
    if (!item || !item->scene()) {
        return 0;
    }
    QGraphicsView *found = 0;
    foreach (QGraphicsView *view, item->scene()->views()) {
        if (view->sceneRect().intersects(item->sceneBoundingRect()) ||
            view->sceneRect().contains(item->scenePos())) {
            if (!found || view->isActiveWindow()) {
                found = view;
            }
        }
    }
    return found;
}
===============corona.cpp========================

    QRect screenRect = screenGeometry(screen);

    switch (loc) {
    case BottomEdge:
//here, v is fetched via 'viewFor'
        pos.setY(v->geometry().y() - s.height());
        break;
    case TopEdge:
================================================
forearch function try to find which view 'contains' the item, if there is no window opened,
It seems at last the "default whole desktop view" will returned.

I am very confused what the extract meaning of this if condition.

And finally I tried below fix(find first one and break), it seems works, but need more investigation.

--- /home/huangjz/rpmbuild/SOURCES/kdelibs-4.12.0/plasma/plasma.cpp     2013-12-13 04:33:53.000000000 +0800
+++ ../../plasma/plasma.cpp     2013-12-21 02:12:43.080504590 +0800
@@ -100,10 +100,9 @@
     foreach (QGraphicsView *view, item->scene()->views()) {
         if (view->sceneRect().intersects(item->sceneBoundingRect()) ||
             view->sceneRect().contains(item->scenePos())) {
-            if (!found || view->isActiveWindow()) {
                 found = view;
+                break;
             }
-        }
     }
 
     return found;
Comment 18 Operius 2014-08-29 11:09:34 UTC
On openSUSE 13.1 with KDE 4.11.5 i had changed the height of the panel to 22 instead of the default height of 36.

When i change it back to 36 again the tooltip position at the correct position.
Change it again to 22 and the position remains at the correct position until i reboot.
Then the position is off again.

When i keep the panel height at 36 the position of the tooltips remains at the correct position even after a reboot.
Comment 19 Nate Graham 2018-06-08 18:22:30 UTC
Hello!

This bug report was filed for KDE Plasma 4, which reached end-of-support status in August 2015. KDE Plasma 5's desktop shell has been almost completely rewritten for better performance and usability, so it is likely that this bug has already been resolved in Plasma 5.

Accordingly, we hope you understand why we must close this bug report. If the issue described  here is still present in KDE Plasma 5.12 or later, please feel free to open a new ticket in the "plasmashell" product after reading https://community.kde.org/Get_Involved/Bug_Reporting

If you would like to get involved in KDE's bug triaging effort so that future mass bug closes like this are less likely, please read https://community.kde.org/Get_Involved#Bug_Triaging

Thanks for your understanding!

Nate Graham