Enlightenment CVS committal

Author  : kwo
Project : e16
Module  : e

Dir     : e16/e/src


Modified Files:
        E.h desktops.c pager.c 


Log Message:
Hack to fix pager update glitch during desktop switch.
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/E.h,v
retrieving revision 1.152
retrieving revision 1.153
diff -u -3 -r1.152 -r1.153
--- E.h 30 Nov 2003 15:35:43 -0000      1.152
+++ E.h 4 Dec 2003 16:57:48 -0000       1.153
@@ -624,6 +624,7 @@
 #define MODE_DESKRAY              7
 #define MODE_PAGER_DRAG_PENDING   8
 #define MODE_PAGER_DRAG           9
+#define MODE_DESKSWITCH          10
 
 #define EVENT_MOUSE_DOWN  0
 #define EVENT_MOUSE_UP    1
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/desktops.c,v
retrieving revision 1.48
retrieving revision 1.49
diff -u -3 -r1.48 -r1.49
--- desktops.c  22 Nov 2003 00:15:40 -0000      1.48
+++ desktops.c  4 Dec 2003 16:57:48 -0000       1.49
@@ -1264,6 +1264,9 @@
    FocusToEWin(NULL);
    BeginNewDeskFocus();
 
+   if (mode.mode == MODE_NONE)
+      mode.mode = MODE_DESKSWITCH;
+
    if (num > 0)
      {
        if (desks.slidein)
@@ -1347,7 +1350,11 @@
          }
      }
 
+   if (mode.mode == MODE_DESKSWITCH)
+      mode.mode = MODE_NONE;
+
    NewDeskFocus();
+   RedrawPagersForDesktop(pdesk, 0);
    RedrawPagersForDesktop(num, 3);
    ForceUpdatePagersForDesktop(num);
    HandleDrawQueue();
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/pager.c,v
retrieving revision 1.47
retrieving revision 1.48
diff -u -3 -r1.47 -r1.48
--- pager.c     30 Nov 2003 15:35:43 -0000      1.47
+++ pager.c     4 Dec 2003 16:57:48 -0000       1.48
@@ -277,10 +277,9 @@
    pq = queue_up;
    queue_up = 0;
    MatchToSnapInfoPager(p);
-   ewin =
-      AddInternalToFamily(p->win, 1,
-                         (p->border_name) ? p->border_name : "PAGER",
-                         EWIN_TYPE_PAGER, p);
+   ewin = AddInternalToFamily(p->win, 1,
+                             (p->border_name) ? p->border_name : "PAGER",
+                             EWIN_TYPE_PAGER, p);
    if (ewin)
      {
        char                s[4096];
@@ -540,7 +539,7 @@
    GC                  gc;
    XGCValues           gcv;
 
-   if (!mode.show_pagers)
+   if (!mode.show_pagers || mode.mode == MODE_DESKSWITCH)
       return;
 
    if (queue_up)
@@ -706,7 +705,7 @@
 {
    int                 ww, hh, xx, yy, ax, ay, cx, cy, i;
 
-   if (!mode.show_pagers)
+   if (!mode.show_pagers || mode.mode == MODE_DESKSWITCH)
       return;
 
    if (queue_up)
@@ -1065,222 +1064,215 @@
 
    pq = queue_up;
 
-   if (mode.pager_zoom)
-     {
-       p->hi_win_w = 2 * w;
-       p->hi_win_h = 2 * h;
+   p->hi_win_w = 2 * w;
+   p->hi_win_h = 2 * h;
 
-       ic = FindItem("PAGER_WIN", 0, LIST_FINDBY_NAME, LIST_TYPE_ICLASS);
-       EMoveResizeWindow(disp, p->hi_win, x, y, w, h);
-       EMapRaised(disp, p->hi_win);
-       if (ewin->mini_pmm.pmap)
+   ic = FindItem("PAGER_WIN", 0, LIST_FINDBY_NAME, LIST_TYPE_ICLASS);
+   EMoveResizeWindow(disp, p->hi_win, x, y, w, h);
+   EMapRaised(disp, p->hi_win);
+   if (ewin->mini_pmm.pmap)
+     {
+       Imlib_Image        *im;
+       Pixmap              pmap, mask;
+       int                 xx, yy, ww, hh, i;
+
+       imlib_context_set_drawable(ewin->mini_pmm.pmap);
+       im = imlib_create_image_from_drawable(0, 0, 0, ewin->mini_w,
+                                             ewin->mini_h, 0);
+       imlib_context_set_image(im);
+       if (w > h)
          {
-            Imlib_Image        *im;
-            Pixmap              pmap, mask;
-            int                 xx, yy, ww, hh, i;
-
-            imlib_context_set_drawable(ewin->mini_pmm.pmap);
-            im = imlib_create_image_from_drawable(0, 0, 0, ewin->mini_w,
-                                                  ewin->mini_h, 0);
-            imlib_context_set_image(im);
-            if (w > h)
+            for (i = w; i < (w * 2); i++)
               {
-                 for (i = w; i < (w * 2); i++)
-                   {
-                      ww = i;
-                      hh = (i * h) / w;
-                      xx = x + ((w - ww) / 2);
-                      yy = y + ((h - hh) / 2);
-                      imlib_render_pixmaps_for_whole_image_at_size(&pmap,
-                                                                   &mask, ww,
-                                                                   hh);
-                      ESetWindowBackgroundPixmap(disp, p->hi_win, pmap);
-                      imlib_free_pixmap_and_mask(pmap);
-                      EMoveResizeWindow(disp, p->hi_win, xx, yy, ww, hh);
-                      XClearWindow(disp, p->hi_win);
+                 ww = i;
+                 hh = (i * h) / w;
+                 xx = x + ((w - ww) / 2);
+                 yy = y + ((h - hh) / 2);
+                 imlib_render_pixmaps_for_whole_image_at_size(&pmap,
+                                                              &mask, ww, hh);
+                 ESetWindowBackgroundPixmap(disp, p->hi_win, pmap);
+                 imlib_free_pixmap_and_mask(pmap);
+                 EMoveResizeWindow(disp, p->hi_win, xx, yy, ww, hh);
+                 XClearWindow(disp, p->hi_win);
+                 {
+                    int                 px, py;
+
+                    PointerAt(&px, &py);
+                    if ((px < x) || (py < y) || (px >= (x + w))
+                        || (py >= (y + h)))
                       {
-                         int                 px, py;
-
-                         PointerAt(&px, &py);
-                         if ((px < x) || (py < y) || (px >= (x + w))
-                             || (py >= (y + h)))
-                           {
-                              imlib_free_image_and_decache();
-                              EUnmapWindow(disp, p->hi_win);
-                              goto exit;
-                           }
+                         imlib_free_image_and_decache();
+                         EUnmapWindow(disp, p->hi_win);
+                         goto exit;
                       }
-                   }
+                 }
               }
-            else
+         }
+       else
+         {
+            for (i = h; i < (h * 2); i++)
               {
-                 for (i = h; i < (h * 2); i++)
-                   {
-                      ww = (i * w) / h;
-                      hh = i;
-                      xx = x + ((w - ww) / 2);
-                      yy = y + ((h - hh) / 2);
-                      imlib_render_pixmaps_for_whole_image_at_size(&pmap,
-                                                                   &mask, ww,
-                                                                   hh);
-                      ESetWindowBackgroundPixmap(disp, p->hi_win, pmap);
-                      imlib_free_pixmap_and_mask(pmap);
-                      EMoveResizeWindow(disp, p->hi_win, xx, yy, ww, hh);
-                      XClearWindow(disp, p->hi_win);
+                 ww = (i * w) / h;
+                 hh = i;
+                 xx = x + ((w - ww) / 2);
+                 yy = y + ((h - hh) / 2);
+                 imlib_render_pixmaps_for_whole_image_at_size(&pmap,
+                                                              &mask, ww, hh);
+                 ESetWindowBackgroundPixmap(disp, p->hi_win, pmap);
+                 imlib_free_pixmap_and_mask(pmap);
+                 EMoveResizeWindow(disp, p->hi_win, xx, yy, ww, hh);
+                 XClearWindow(disp, p->hi_win);
+                 {
+                    int                 px, py;
+
+                    PointerAt(&px, &py);
+                    if ((px < x) || (py < y) || (px >= (x + w))
+                        || (py >= (y + h)))
                       {
-                         int                 px, py;
-
-                         PointerAt(&px, &py);
-                         if ((px < x) || (py < y) || (px >= (x + w))
-                             || (py >= (y + h)))
-                           {
-                              imlib_free_image_and_decache();
-                              EUnmapWindow(disp, p->hi_win);
-                              goto exit;
-                           }
+                         imlib_free_image_and_decache();
+                         EUnmapWindow(disp, p->hi_win);
+                         goto exit;
                       }
-                   }
+                 }
               }
-            EMoveResizeWindow(disp, p->hi_win, x - (w / 2), y - (h / 2),
-                              w * 2, h * 2);
-            imlib_context_set_image(im);
-            imlib_context_set_drawable(p->hi_win);
-            imlib_render_image_on_drawable_at_size(0, 0, p->hi_win_w,
-                                                   p->hi_win_h);
-            imlib_free_image_and_decache();
          }
-       else if (ic)
-         {
-            int                 xx, yy, ww, hh, i;
+       EMoveResizeWindow(disp, p->hi_win, x - (w / 2), y - (h / 2),
+                         w * 2, h * 2);
+       imlib_context_set_image(im);
+       imlib_context_set_drawable(p->hi_win);
+       imlib_render_image_on_drawable_at_size(0, 0, p->hi_win_w, p->hi_win_h);
+       imlib_free_image_and_decache();
+     }
+   else if (ic)
+     {
+       int                 xx, yy, ww, hh, i;
 
-            queue_up = 0;
-            if (w > h)
+       queue_up = 0;
+       if (w > h)
+         {
+            for (i = w; i < (w * 2); i++)
               {
-                 for (i = w; i < (w * 2); i++)
-                   {
-                      ww = i;
-                      hh = (i * h) / w;
-                      xx = x + ((w - ww) / 2);
-                      yy = y + ((h - hh) / 2);
-                      IclassApply(ic, p->hi_win, ww, hh, 0, 0, STATE_NORMAL,
-                                  0);
-                      EMoveResizeWindow(disp, p->hi_win, xx, yy, ww, hh);
-                      XClearWindow(disp, p->hi_win);
+                 ww = i;
+                 hh = (i * h) / w;
+                 xx = x + ((w - ww) / 2);
+                 yy = y + ((h - hh) / 2);
+                 IclassApply(ic, p->hi_win, ww, hh, 0, 0, STATE_NORMAL, 0);
+                 EMoveResizeWindow(disp, p->hi_win, xx, yy, ww, hh);
+                 XClearWindow(disp, p->hi_win);
+                 {
+                    int                 px, py;
+
+                    PointerAt(&px, &py);
+                    if ((px < x) || (py < y) || (px >= (x + w))
+                        || (py >= (y + h)))
                       {
-                         int                 px, py;
-
-                         PointerAt(&px, &py);
-                         if ((px < x) || (py < y) || (px >= (x + w))
-                             || (py >= (y + h)))
-                           {
-                              EUnmapWindow(disp, p->hi_win);
-                              goto exit;
-                           }
+                         EUnmapWindow(disp, p->hi_win);
+                         goto exit;
                       }
-                   }
+                 }
               }
-            else
+         }
+       else
+         {
+            for (i = h; i < (h * 2); i++)
               {
-                 for (i = h; i < (h * 2); i++)
-                   {
-                      ww = (i * w) / h;
-                      hh = i;
-                      xx = x + ((w - ww) / 2);
-                      yy = y + ((h - hh) / 2);
-                      IclassApply(ic, p->hi_win, ww, hh, 0, 0, STATE_NORMAL,
-                                  0);
-                      EMoveResizeWindow(disp, p->hi_win, xx, yy, ww, hh);
-                      XClearWindow(disp, p->hi_win);
+                 ww = (i * w) / h;
+                 hh = i;
+                 xx = x + ((w - ww) / 2);
+                 yy = y + ((h - hh) / 2);
+                 IclassApply(ic, p->hi_win, ww, hh, 0, 0, STATE_NORMAL, 0);
+                 EMoveResizeWindow(disp, p->hi_win, xx, yy, ww, hh);
+                 XClearWindow(disp, p->hi_win);
+                 {
+                    int                 px, py;
+
+                    PointerAt(&px, &py);
+                    if ((px < x) || (py < y) || (px >= (x + w))
+                        || (py >= (y + h)))
                       {
-                         int                 px, py;
-
-                         PointerAt(&px, &py);
-                         if ((px < x) || (py < y) || (px >= (x + w))
-                             || (py >= (y + h)))
-                           {
-                              EUnmapWindow(disp, p->hi_win);
-                              goto exit;
-                           }
+                         EUnmapWindow(disp, p->hi_win);
+                         goto exit;
                       }
-                   }
+                 }
               }
-            EMoveResizeWindow(disp, p->hi_win, x - (w / 2), y - (h / 2), w * 2,
-                              h * 2);
          }
-       else
+       EMoveResizeWindow(disp, p->hi_win, x - (w / 2), y - (h / 2), w * 2,
+                         h * 2);
+     }
+   else
+     {
+       Pixmap              pmap;
+       GC                  gc = 0;
+       XGCValues           gcv;
+       int                 xx, yy, ww, hh, i;
+
+       pmap = ECreatePixmap(disp, p->hi_win, w * 2, h * 2, root.depth);
+       ESetWindowBackgroundPixmap(disp, p->hi_win, pmap);
+       if (!gc)
+          gc = XCreateGC(disp, pmap, 0, &gcv);
+       if (w > h)
          {
-            Pixmap              pmap;
-            GC                  gc = 0;
-            XGCValues           gcv;
-            int                 xx, yy, ww, hh, i;
-
-            pmap = ECreatePixmap(disp, p->hi_win, w * 2, h * 2, root.depth);
-            ESetWindowBackgroundPixmap(disp, p->hi_win, pmap);
-            if (!gc)
-               gc = XCreateGC(disp, pmap, 0, &gcv);
-            if (w > h)
+            for (i = w; i < (w * 2); i++)
               {
-                 for (i = w; i < (w * 2); i++)
-                   {
-                      ww = i;
-                      hh = (i * h) / w;
-                      xx = x + ((w - ww) / 2);
-                      yy = y + ((h - hh) / 2);
-                      XSetForeground(disp, gc, BlackPixel(disp, root.scr));
-                      XFillRectangle(disp, pmap, gc, 0, 0, ww, hh);
-                      XSetForeground(disp, gc, WhitePixel(disp, root.scr));
-                      XFillRectangle(disp, pmap, gc, 1, 1, ww - 2, hh - 2);
-                      EMoveResizeWindow(disp, p->hi_win, xx, yy, ww, hh);
-                      XClearWindow(disp, p->hi_win);
+                 ww = i;
+                 hh = (i * h) / w;
+                 xx = x + ((w - ww) / 2);
+                 yy = y + ((h - hh) / 2);
+                 XSetForeground(disp, gc, BlackPixel(disp, root.scr));
+                 XFillRectangle(disp, pmap, gc, 0, 0, ww, hh);
+                 XSetForeground(disp, gc, WhitePixel(disp, root.scr));
+                 XFillRectangle(disp, pmap, gc, 1, 1, ww - 2, hh - 2);
+                 EMoveResizeWindow(disp, p->hi_win, xx, yy, ww, hh);
+                 XClearWindow(disp, p->hi_win);
+                 {
+                    int                 px, py;
+
+                    PointerAt(&px, &py);
+                    if ((px < x) || (py < y) || (px >= (x + w))
+                        || (py >= (y + h)))
                       {
-                         int                 px, py;
-
-                         PointerAt(&px, &py);
-                         if ((px < x) || (py < y) || (px >= (x + w))
-                             || (py >= (y + h)))
-                           {
-                              EFreePixmap(disp, pmap);
-                              EUnmapWindow(disp, p->hi_win);
-                              goto exit;
-                           }
+                         EFreePixmap(disp, pmap);
+                         EUnmapWindow(disp, p->hi_win);
+                         goto exit;
                       }
-                   }
+                 }
               }
-            else
+         }
+       else
+         {
+            for (i = h; i < (h * 2); i++)
               {
-                 for (i = h; i < (h * 2); i++)
-                   {
-                      ww = (i * w) / h;
-                      hh = i;
-                      xx = x + ((w - ww) / 2);
-                      yy = y + ((h - hh) / 2);
-                      XSetForeground(disp, gc, BlackPixel(disp, root.scr));
-                      XFillRectangle(disp, pmap, gc, 0, 0, ww, hh);
-                      XSetForeground(disp, gc, WhitePixel(disp, root.scr));
-                      XFillRectangle(disp, pmap, gc, 1, 1, ww - 2, hh - 2);
-                      EMoveResizeWindow(disp, p->hi_win, xx, yy, ww, hh);
-                      XClearWindow(disp, p->hi_win);
+                 ww = (i * w) / h;
+                 hh = i;
+                 xx = x + ((w - ww) / 2);
+                 yy = y + ((h - hh) / 2);
+                 XSetForeground(disp, gc, BlackPixel(disp, root.scr));
+                 XFillRectangle(disp, pmap, gc, 0, 0, ww, hh);
+                 XSetForeground(disp, gc, WhitePixel(disp, root.scr));
+                 XFillRectangle(disp, pmap, gc, 1, 1, ww - 2, hh - 2);
+                 EMoveResizeWindow(disp, p->hi_win, xx, yy, ww, hh);
+                 XClearWindow(disp, p->hi_win);
+                 {
+                    int                 px, py;
+
+                    PointerAt(&px, &py);
+                    if ((px < x) || (py < y) || (px >= (x + w))
+                        || (py >= (y + h)))
                       {
-                         int                 px, py;
-
-                         PointerAt(&px, &py);
-                         if ((px < x) || (py < y) || (px >= (x + w))
-                             || (py >= (y + h)))
-                           {
-                              EFreePixmap(disp, pmap);
-                              EUnmapWindow(disp, p->hi_win);
-                              goto exit;
-                           }
+                         EFreePixmap(disp, pmap);
+                         EUnmapWindow(disp, p->hi_win);
+                         goto exit;
                       }
-                   }
+                 }
               }
-            EFreePixmap(disp, pmap);
-            EMoveResizeWindow(disp, p->hi_win, x - (w / 2), y - (h / 2), w * 2,
-                              h * 2);
          }
-       p->hi_visible = 1;
-       p->hi_ewin = ewin;
+       EFreePixmap(disp, pmap);
+       EMoveResizeWindow(disp, p->hi_win, x - (w / 2), y - (h / 2), w * 2,
+                         h * 2);
      }
+   p->hi_visible = 1;
+   p->hi_ewin = ewin;
+
  exit:
    queue_up = pq;
 }
@@ -1325,7 +1317,7 @@
           PagerShowTt(NULL);
      }
 
-   if (mode.pager_zoom && (in == PAGER_EVENT_MOTION) && ewin != p->hi_ewin)    /* !!! 
*/
+   if ((in == PAGER_EVENT_MOTION) && ewin != p->hi_ewin)
      {
        int                 wx, wy, ww, wh, ax, ay, cx, cy;
 




-------------------------------------------------------
This SF.net email is sponsored by: IBM Linux Tutorials.
Become an expert in LINUX or just sharpen your skills.  Sign up for IBM's
Free Linux Tutorials.  Learn everything from the bash shell to sys admin.
Click now! http://ads.osdn.com/?ad_id=1278&alloc_id=3371&op=click
_______________________________________________
enlightenment-cvs mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to