Bug 289998

Summary: panel does overlap other panel on same edge
Product: [Plasma] plasmashell Reporter: Christoph Thielecke <crissi99>
Component: PanelAssignee: Plasma Bugs List <plasma-bugs>
Status: RESOLVED DUPLICATE    
Severity: normal CC: bloodse3ker, Craig.Magina, kde, minecraftbhil, myriam
Priority: NOR    
Version: 5.11.5   
Target Milestone: 1.0   
Platform: Ubuntu   
OS: Linux   
Latest Commit: Version Fixed In:
Attachments: prevent overlap panels on same edge using docking

Description Christoph Thielecke 2011-12-28 10:48:20 UTC
Version:           unspecified (using Devel) 
OS:                Linux

A second panel does overlap other panel on same edge instead of stack on first one.

Reproducible: Always

Steps to Reproduce:
Create a new panel, move panel to edge where another panel exists

Actual Results:  
Panel overlaps first one, no access to first panel is possible

Expected Results:  
Panel should stack on first panel to allow access to both panels
Comment 1 Christoph Thielecke 2011-12-28 10:55:21 UTC
Tested kde version was 4.8-rc1
Comment 2 Boris Yonchev 2012-01-04 15:06:00 UTC
I was able to reproduce the bug
Comment 3 Slavi 2012-01-05 15:00:39 UTC
Same thing happened to me (using KDE 4.7.3)
Comment 4 minecraftbhil 2012-01-27 16:51:12 UTC
I have the same problem. In KDE 3.5 I was able to put 2 panels on the same edge. I designed a very cool desktop in kde 3 but now I'm not able to rebuild it in kde 4 because I cannot put 2 panels on the same edge without overlapping the other one.
Screenshot of how I would like to look my desktop like:
http://www.mediafire.com/i/?2mu9gat5329fby5
Comment 5 Craig Magina 2012-03-01 15:45:38 UTC
I have a similar issue where I have two maximized panels on abutting edges that overlap in the corner requiring me to manually adjust the size of one of the panels to not overlap.
Comment 6 Christoph Thielecke 2012-07-09 12:15:18 UTC
Created attachment 72401 [details]
prevent overlap panels on same edge using docking
Comment 7 Christoph Thielecke 2012-07-09 12:34:17 UTC
Comment on attachment 72401 [details]
prevent overlap panels on same edge using docking

--- plasma/desktop/shell/panelview.cpp.orig    2012-06-18 21:29:17.425013657 +0200
+++ plasma/desktop/shell/panelview.cpp    2012-06-21 20:38:32.326059299 +0200
@@ -1019,6 +1019,103 @@
         int topOffset = wholeScreen.top() - thisScreen.top();
         kDebug() << "screen l/r/b/t offsets are:" << leftOffset << rightOffset << bottomOffset << topOffset << location();
 
+    
+        int my_y = 0;
+        int my_x = 0;
+        int my_height = 0;
+        int my_width = 0;
+        int o_y = 0;
+        int o_x = 0;
+        int o_height = 0;
+        int o_width = 0;
+        QRectF myrect;
+        QRectF orect;
+        QRect m;
+        QRect o;
+        QString a;
+        QString b;
+
+        int cntTopP=0;
+        int cntBottomP=0;
+        int cntRightP=0;
+        int cntLeftP=0;
+        
+        foreach (Plasma::Containment *c, PlasmaApp::self()->corona()->containments()) 
+        {
+            if (c->containmentType() == Plasma::Containment::PanelContainment) 
+            {
+                if (c->location()==Plasma::TopEdge)
+                    cntTopP++;
+                if (c->location()==Plasma::BottomEdge)
+                    cntBottomP++;
+                if (c->location()==Plasma::RightEdge)
+                    cntRightP++;
+                if (c->location()==Plasma::LeftEdge)
+                    cntLeftP++;
+                
+                kDebug() << QString("countPanel Top Bottom Right Left: %1 %2 %3 %4 ").arg(cntTopP).arg(cntBottomP).arg(cntRightP).arg(cntLeftP);
+                
+                if (c == containment()) 
+                {
+                    if (c->view()  != NULL) {
+                        myrect=c->view()->geometry();
+                        
+                        my_y = c->view()->y();
+                        my_x = c->view()->x();
+                        my_width = c->geometry().width();
+                        my_height = c->geometry().height();
+                        m=myrect.toRect();
+                    }
+                    //a += " i'm self !!!";
+                }
+                else // check for same edge...
+                {
+                    //a += " Found other panel !!!";
+                    if (c->view()  != NULL) {    
+                        orect = c->view()->geometry();
+                        o_y = c->view()->y();
+                        o_x = c->view()->x();
+                        o_width = c->geometry().width();
+                        o_height = c->geometry().height();
+                        o=orect.toRect();
+                    }
+                    
+                    if (c->location() == location()) 
+                    {
+                        //a+= " other panel is on same edge!!!";
+                        //a+= QString().setNum(location());
+                        if  ( myrect.intersects(orect) ) 
+                        switch (location())
+                        {
+                        case Plasma::TopEdge:
+                            move(x(), y()+(cntTopP-1)*o_height);
+                            break;
+                        case Plasma::BottomEdge:
+                            move(x(), y() - (cntBottomP-1)*o_height);
+                            break;
+                        case Plasma::RightEdge:
+                            move(x() - (cntRightP-1)*o_width, y());
+                            break;
+                        case Plasma::LeftEdge:
+                            move(x() + (cntLeftP-1)*o_width, y());
+                            break;
+                        default:
+                            //kDebug() << "where are we?";
+                            break;
+                        }
+                    }
+                }
+            }
+            //else
+            //    a += "(other containment)";
+            
+            
+            /*
+            b.sprintf("my: %d,%d %dx%d, other: %d,%d %dx%d ", m.x(), m.y(), m.width(), m.height(), o.x(),  o.y(),  o.width(), o.height());
+            a += b;
+            kDebug() << "c: type: " << c->containmentType() << " " << a;*/
+       }
+       
         switch (location())
         {
             case Plasma::TopEdge:
Comment 8 minecraftbhil 2012-07-09 13:12:56 UTC
Oh!
Many thanks! I will try it out!
Comment 9 Myriam Schweingruber 2012-08-07 21:21:04 UTC
(In reply to comment #6)
> Created attachment 72401 [details]
> prevent overlap panels on same edge using docking

Thank you for the patch. Could you please submit this to http://reviewboard.kde.org?
Comment 10 Christoph Thielecke 2013-01-20 16:16:04 UTC
Still open in 4.10rc3
Comment 11 Nate Graham 2018-06-08 19:43:07 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 is already 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
Comment 12 Christoph Thielecke 2018-06-09 15:06:43 UTC
Still valid with plasmashell.
Comment 13 David Edmundson 2018-06-09 15:15:04 UTC

*** This bug has been marked as a duplicate of bug 336374 ***