From 404fc2144c99c7f787e34b2a6a9400727a864459 Mon Sep 17 00:00:00 2001 From: Martin Klapetek Date: Wed, 12 Feb 2014 10:50:13 +0100 Subject: [PATCH] [kwin] Make KWin place the OSD REVIEW: 115334 --- placement.cpp | 10 ++++++++++ placement.h | 1 + 2 files changed, 11 insertions(+) diff --git a/placement.cpp b/placement.cpp index 8534f81ad4..e0ebf3d149 100644 --- a/placement.cpp +++ b/placement.cpp @@ -70,6 +70,8 @@ void Placement::place(Client* c, QRect& area) placeDialog(c, area, options->placement()); else if (c->isSplash()) placeOnMainWindow(c, area); // on mainwindow, if any, otherwise centered + else if (c->isNotification()) + placeNotification(c, area); else place(c, area, options->placement()); } @@ -481,6 +483,14 @@ void Placement::placeUtility(Client* c, QRect& area, Policy /*next*/) place(c, area, Default); } +void Placement::placeNotification(Client* c, QRect& area) +{ + // place at lower 1/3 of the screen + const int x = area.left() + (area.width() - c->width()) / 2; + const int y = area.top() + 2 * (area.height() - c->height()) / 3; + + c->move(QPoint(x, y)); +} void Placement::placeDialog(Client* c, QRect& area, Policy nextPlacement) { diff --git a/placement.h b/placement.h index 7c943fffda..a14036bd3b 100644 --- a/placement.h +++ b/placement.h @@ -71,6 +71,7 @@ public: void placeZeroCornered(Client* c, const QRect& area, Policy next = Unknown); void placeDialog(Client* c, QRect& area, Policy next = Unknown); void placeUtility(Client* c, QRect& area, Policy next = Unknown); + void placeNotification(Client* c, QRect& area); void reinitCascading(int desktop);