Enlightenment CVS committal

Author  : kwo
Project : e16
Module  : e

Dir     : e16/e/src


Modified Files:
        sticky.c timestamp.h 


Log Message:
Wed Sep  3 19:23:14 CEST 2003
(Kim)

Fix making slightly offscreen (x/y < 0) windows sticky.
This one caused (aot.) pagers and iconboxes to get lost when changing theme.

===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/sticky.c,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -3 -r1.14 -r1.15
--- sticky.c    22 May 2003 19:15:03 -0000      1.14
+++ sticky.c    3 Sep 2003 17:30:35 -0000       1.15
@@ -22,8 +22,6 @@
  */
 #include "E.h"
 
-#define _COORD_MODULO(a, b, c) { a = b % c; if (a < 0) a += c; }
-
 void
 MakeWindowUnSticky(EWin * ewin)
 {
@@ -52,15 +50,26 @@
 void
 MakeWindowSticky(EWin * ewin)
 {
-   int                 x, y;
+   int                 x, y, dx, dy;
 
    EDBUG(5, "MakeWindowSticky");
    if (!ewin)
       EDBUG_RETURN_;
+
    ewin->sticky = 1;
+
    /* Avoid "losing" windows made sticky while not in the current viewport */
-   _COORD_MODULO(x, ewin->x, root.w);
-   _COORD_MODULO(y, ewin->y, root.h);
+   dx = ewin->w / 2;
+   dy = ewin->h / 2;
+   x = (ewin->x + dx) % root.w;
+   if (x < 0)
+      x += root.w;
+   x -= dx;
+   y = (ewin->y + dy) % root.h;
+   if (y < 0)
+      y += root.h;
+   y -= dy;
+
    if (x != ewin->x || y != ewin->y)
      {
        ewin->x = x;
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/timestamp.h,v
retrieving revision 1.528
retrieving revision 1.529
diff -u -3 -r1.528 -r1.529
--- timestamp.h 22 Aug 2003 20:58:10 -0000      1.528
+++ timestamp.h 3 Sep 2003 17:30:35 -0000       1.529
@@ -1 +1 @@
-#define E_CHECKOUT_DATE "$Date: 2003/08/22 20:58:10 $"
+#define E_CHECKOUT_DATE "$Date: 2003/09/03 17:30:35 $"




-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
enlightenment-cvs mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to