Enlightenment CVS committal

Author  : mej
Project : e16
Module  : e

Dir     : e16/e/src


Modified Files:
        borders.c desktops.c ewmh.c sticky.c 


Log Message:
Fri Mar 28 00:10:38 EST 2003
(KainX)

More patches from Kim Woelders <[EMAIL PROTECTED]>.


===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/borders.c,v
retrieving revision 1.86
retrieving revision 1.87
diff -u -3 -r1.86 -r1.87
--- borders.c   24 Mar 2003 03:48:08 -0000      1.86
+++ borders.c   28 Mar 2003 05:11:14 -0000      1.87
@@ -1670,7 +1670,7 @@
    ewin->border_new = 0;
    ewin->bits = NULL;
    ewin->sticky = 0;
-   ewin->desktop = -1;
+   ewin->desktop = desks.current;
    ewin->groups = NULL;
    ewin->num_groups = 0;
    ewin->visible = 0;
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/desktops.c,v
retrieving revision 1.33
retrieving revision 1.34
diff -u -3 -r1.33 -r1.34
--- desktops.c  24 Mar 2003 03:48:08 -0000      1.33
+++ desktops.c  28 Mar 2003 05:11:14 -0000      1.34
@@ -1355,10 +1355,8 @@
                        ewin->y);
        ICCCM_Configure(ewin);
        StackDesktops();
-       HintsSetWindowDesktop(ewin);
-       EDBUG_RETURN_;
      }
-   if (ewin->floating)
+   else if (ewin->floating)
      {
        DesktopRemoveEwin(ewin);
        xo = desks.desk[ewin->desktop].x;
@@ -1372,10 +1370,8 @@
        XRaiseWindow(disp, ewin->win);
        ShowEdgeWindows();
        ICCCM_Configure(ewin);
-       HintsSetWindowDesktop(ewin);
-       EDBUG_RETURN_;
      }
-   if (ewin->parent != desks.desk[ewin->desktop].win)
+   else if (ewin->parent != desks.desk[ewin->desktop].win)
      {
        ewin->parent = desks.desk[ewin->desktop].win;
        DesktopAddEwinToTop(ewin);
@@ -1384,13 +1380,11 @@
        RaiseEwin(ewin);
 /*      ShowEwin(ewin); */
        ICCCM_Configure(ewin);
-/*     HintsSetWindowDesktop(ewin); */
-       HintsSetWindowHints(ewin);
        StackDesktops();
        SetEwinToCurrentArea(ewin);
      }
+   HintsSetWindowDesktop(ewin);
    EDBUG_RETURN_;
-
 }
 
 int
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/ewmh.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -3 -r1.1 -r1.2
--- ewmh.c      24 Mar 2003 03:48:08 -0000      1.1
+++ ewmh.c      28 Mar 2003 05:11:14 -0000      1.2
@@ -497,9 +497,16 @@
         goto exit;
 
     if (val[0] == 0xFFFFFFFF)
-        ewin->desktop = 0;
+    {
+        /* It is possible to distinguish between "sticky" and "on all desktops". */
+        /* E doesn't */
+        ewin->sticky = 1;
+    }
     else
+    {
         ewin->desktop = val[0];
+        ewin->sticky = 0;
+    }
     Efree(val);
 
 exit:
@@ -692,7 +699,18 @@
     }
     else if (event->message_type == _NET_WM_DESKTOP)
     {
-        MoveEwinToDesktop(ewin, event->data.l[0]);
+        if (event->data.l[0] == 0xFFFFFFFF)
+        {
+            if (!ewin->sticky)
+                MakeWindowSticky(ewin);
+        }
+        else
+        {
+            if (ewin->sticky)
+                MakeWindowUnSticky(ewin);
+            else
+                MoveEwinToDesktop(ewin, event->data.l[0]);
+        }
     }
     else if (event->message_type == _NET_WM_STATE)
     {
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/sticky.c,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -3 -r1.11 -r1.12
--- sticky.c    24 Mar 2003 03:48:09 -0000      1.11
+++ sticky.c    28 Mar 2003 05:11:14 -0000      1.12
@@ -22,6 +22,9 @@
  */
 #include "E.h"
 
+#define _COORD_MODULO(a, b, c) { a = b % c; if (a < 0) a += c; }
+
+
 void
 MakeWindowUnSticky(EWin * ewin)
 {
@@ -50,10 +53,21 @@
 void
 MakeWindowSticky(EWin * ewin)
 {
+   int x, y;
    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);
+   if (x != ewin->x || y != ewin->y)
+   {
+      ewin->x = x;
+      ewin->y = y;
+      FloatEwinAt(ewin, ewin->x, ewin->y);
+      DrawEwinShape(ewin, 0, ewin->x, ewin->y, ewin->client.w, ewin->client.h, 0);
+   }
    MoveEwinToDesktopAt(ewin, desks.current, ewin->x, ewin->y);
    RaiseEwin(ewin);
    DrawEwin(ewin);




-------------------------------------------------------
This SF.net email is sponsored by:
The Definitive IT and Networking Event. Be There!
NetWorld+Interop Las Vegas 2003 -- Register today!
http://ads.sourceforge.net/cgi-bin/redirect.pl?keyn0001en
_______________________________________________
enlightenment-cvs mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to