[banshee] Fixed notification area popup positioning on multi-monitor systems (bgo#586589)



commit cae75495cad40174a4c5383ede424ffa81dc2b64
Author: Alexander Kojevnikov <alexander kojevnikov com>
Date:   Sat Jun 27 22:58:49 2009 +1000

    Fixed notification area popup positioning on multi-monitor systems (bgo#586589)

 .../X11NotificationAreaBox.cs                      |   14 +++++++-------
 1 files changed, 7 insertions(+), 7 deletions(-)
---
diff --git a/src/Extensions/Banshee.NotificationArea/Banshee.NotificationArea/X11NotificationAreaBox.cs b/src/Extensions/Banshee.NotificationArea/Banshee.NotificationArea/X11NotificationAreaBox.cs
index 5783967..71b89d5 100644
--- a/src/Extensions/Banshee.NotificationArea/Banshee.NotificationArea/X11NotificationAreaBox.cs
+++ b/src/Extensions/Banshee.NotificationArea/Banshee.NotificationArea/X11NotificationAreaBox.cs
@@ -240,15 +240,15 @@ namespace Banshee.NotificationArea
             
             PositionWidget (popup, out x, out y, 5);
             
-            x = x - (popup_req.Width / 2) + (event_box_req.Width / 2);     
-
             int monitor = event_box.Screen.GetMonitorAtPoint (x, y);
-            int monitor_width = event_box.Screen.GetMonitorGeometry(monitor).Width;
+            var monitor_rect = event_box.Screen.GetMonitorGeometry(monitor);
+
+            x = x - (popup_req.Width / 2) + (event_box_req.Width / 2);
 
-            if (x + popup_req.Width >= monitor_width) {
-                x = monitor_width - popup_req.Width - 5;
-            } else if (x < 5) {
-                x = 5;
+            if (x + popup_req.Width >= monitor_rect.Right - 5) {
+                x = monitor_rect.Right - popup_req.Width - 5;
+            } else if (x < monitor_rect.Left + 5) {
+                x = monitor_rect.Left + 5;
             }
             
             popup.Move (x, y);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]