diff --git a/lib/kcommondecoration.cpp b/lib/kcommondecoration.cpp index 6625407ee3..dca6eaaa04 100644 --- a/lib/kcommondecoration.cpp +++ b/lib/kcommondecoration.cpp @@ -796,7 +796,7 @@ bool KCommonDecoration::isToolWindow() const return ((type==NET::Toolbar)||(type==NET::Utility)||(type==NET::Menu)); } -QRect KCommonDecoration::titleRect() +QRect KCommonDecoration::titleRect() const { int r_x, r_y, r_x2, r_y2; widget()->rect().coords(&r_x, &r_y, &r_x2, &r_y2); @@ -809,7 +809,7 @@ QRect KCommonDecoration::titleRect() const int ttlHeight = layoutMetric(LM_TitleHeight); const int titleEdgeBottomBottom = r_y+titleEdgeTop+ttlHeight+titleEdgeBottom-1; return QRect(r_x+titleEdgeLeft+buttonsLeftWidth()+titleBorderLeft, r_y+titleEdgeTop, - r_x2-titleEdgeRight-buttonsRightWidth()-(r_x+titleEdgeLeft+buttonsLeftWidth()+titleBorderLeft), + r_x2-titleEdgeRight-buttonsRightWidth()-titleBorderRight-(r_x+titleEdgeLeft+buttonsLeftWidth()+titleBorderLeft), titleEdgeBottomBottom-(r_y+titleEdgeTop) ); } diff --git a/lib/kcommondecoration.h b/lib/kcommondecoration.h index 47bfd3a215..67ace366c9 100644 --- a/lib/kcommondecoration.h +++ b/lib/kcommondecoration.h @@ -216,7 +216,7 @@ class KWIN_EXPORT KCommonDecoration : public KDecoration * Convenience method. * @returns the title rect. */ - QRect titleRect(); + QRect titleRect() const; public: /**