[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-core-devel
Subject:    [PATCH] Xinerama correctness in kdatetbl.cpp
From:       George Staikos <staikos () kde ! org>
Date:       2002-03-02 14:56:25
[Download RAW message or body]


This patch works for me.  Ok to commit?

diff -u -r1.36 kdatetbl.cpp
--- kdatetbl.cpp        2002/02/27 23:15:45     1.36
+++ kdatetbl.cpp        2002/03/02 14:55:08
@@ -668,20 +668,18 @@
 KPopupFrame::popup(const QPoint &pos)
 {
   // Make sure the whole popup is visible.
-  QWidget* desktop = QApplication::desktop();
-  int sw = desktop->width();
-  int sh = desktop->height();
+  QRect d = 
QApplication::desktop()->screenGeometry(QApplication::desktop()->screenNumber(pos));
   int x = pos.x();
   int y = pos.y();
   int w = width();
   int h = height();
-  if (x+w > sw)
-    x = sw - w;
-  if (y+h > sh)
-    y = sh - h;
-  if (x < 0)
+  if (x+w > d.x()+d.width())
+    x = d.width() - w;
+  if (y+h > d.y()+d.height())
+    y = d.height() - h;
+  if (x < d.x())
     x = 0;
-  if (y < 0)
+  if (y < d.y())
     y = 0;

   // Pop the thingy up.



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic