home *** CD-ROM | disk | FTP | other *** search
/ Dream 52 / Amiga_Dream_52.iso / Linux / Enlightenment / enl_BETA-0.13.src.tar.gz / enl_BETA-0.13.src.tar / enl-0.13 / iconify.c < prev    next >
C/C++ Source or Header  |  1997-11-18  |  15KB  |  546 lines

  1. #include "enlightenment.h"
  2.  
  3. Icon *GrabClient(EWin *ewin) {
  4.    Icon *ic;
  5.    Pixmap tmp;
  6.    Pixmap grab;
  7.    XImage *xim;
  8.    int w,h;
  9.    int ww,hh;
  10.    int cw,ch;
  11.    int gw,gh,gx,gy;
  12.    int i,j;
  13.    float x,y;
  14.    float inc;
  15.    GC gc;
  16.    XGCValues gcv;
  17.    int r,g,b;
  18.    
  19.    ic=malloc(sizeof(Icon));
  20.    ic->ewin=ewin;ic->pmap=0;ic->mask=0;ic->win=0;
  21.    ic->ewin->icon=ic;
  22.    cw=ewin->client_width;
  23.    ch=ewin->client_height;
  24.    gc=XCreateGC(disp,ewin->client_win,0,&gcv);
  25.    
  26.    if (icfg.orientation) {
  27.     if ((4*ch)>(3*cw)) {
  28.          /* if client is higher that it is wide, limit the widht to 4/3 */
  29.          /* times the width of the iconbox */
  30.          h=(((icfg.width-(icfg.bx*2))*3)/4);
  31.          w=((cw*h)/ch);
  32.     } else {
  33.          w=(icfg.width-(icfg.bx*2));
  34.          h=((ch*w)/cw);
  35.         }
  36.    } else {
  37.     if ((3*cw)>(4*ch)) {
  38.          /* if client is wider that it is high, limit the widht to 4/3 */
  39.          /* times the height of the iconbox */
  40.          w=(((icfg.height-(icfg.by*2))*4)/3);
  41.          h=((ch*w)/cw);
  42.     } else {
  43.          h=(icfg.height-(icfg.by*2));
  44.          w=((cw*h)/ch);
  45.     }
  46.    }
  47.    ww=w-1;if (ww<1) w=1;
  48.    hh=h-1;if (hh<1) h=1;
  49.    ic->pmap=XCreatePixmap(disp,ewin->client_win,w,h,depth);
  50.    ic->mask=0;
  51.    ic->win=CreateWin(icfg.bg_win,0,0,w,h);
  52.    ic->width=w;
  53.    ic->height=h;
  54.    ic->x=0;
  55.    ic->y=0;
  56.    tmp=XCreatePixmap(disp,ewin->client_win,cw,hh,depth);
  57.    grab=XCreatePixmap(disp,ewin->client_win,cw,ch,depth);
  58.    gx=0;gy=0;gw=cw;gh=ch;
  59.    if (ewin->frame_x+ewin->client_x<0) {
  60.     gx=-(ewin->frame_x+ewin->client_x);
  61.     gw-=gx;
  62.    }
  63.    if (ewin->frame_y+ewin->client_y<0) {
  64.     gy=-(ewin->frame_y+ewin->client_y);
  65.     gh-=gy;
  66.    }
  67.    if (ewin->frame_x+ewin->client_x+ewin->client_width>=DisplayWidth(disp,screen))
  68.      gw=DisplayWidth(disp,screen)-(ewin->frame_x+ewin->client_x+gx);
  69.    if (ewin->frame_y+ewin->client_y+ewin->client_height>=DisplayHeight(disp,screen))
  70.      gh=DisplayHeight(disp,screen)-(ewin->frame_y+ewin->client_y+gy);
  71.    xim=NULL;
  72.    if ((gw>0)&&(gh>0))
  73.      xim=XGetImage(disp,ewin->client_win,gx,gy,gw,gh,0xffffffff,ZPixmap);
  74.    if (!xim) {
  75.     ImlibFreePixmap(imd,grab);
  76.     grab=ewin->client_win;
  77.    } else {
  78.     XPutImage(disp,grab,gc,xim,0,0,gx,gy,gw,gh);
  79.     XDestroyImage(xim);
  80.    }
  81.    inc=(float)ch/(float)hh;
  82.    j=0;
  83.    for (y=0;;y+=inc) {
  84.     i=(int)y;
  85.     if (i>=ch) break;
  86.     XCopyArea(disp,grab,tmp,gc,0,i,cw,1,0,j++);
  87.    }
  88.    inc=(float)cw/(float)ww;
  89.    j=0;
  90.    for (x=0;;x+=inc) {
  91.     i=(int)x;
  92.     if (i>=cw) break;
  93.     XCopyArea(disp,tmp,ic->pmap,gc,i,0,1,hh,1+j++,1);
  94.    }
  95.    /* draw bevels around icon */
  96.    r=255,g=255,b=255;
  97.    XSetForeground(disp,gc,ImlibBestColorMatch(imd,&r,&g,&b));
  98.    XDrawLine(disp,ic->pmap,gc,0,0,ic->width-1,0);
  99.    XDrawLine(disp,ic->pmap,gc,0,0,0,ic->height-1);
  100.    r=0,g=0,b=0;
  101.    XSetForeground(disp,gc,ImlibBestColorMatch(imd,&r,&g,&b));
  102.    XSetWindowBackgroundPixmap(disp,ic->win,ic->pmap);
  103.    XDrawLine(disp,ic->pmap,gc,0,ic->height-1,ic->width-1,ic->height-1);
  104.    XDrawLine(disp,ic->pmap,gc,ic->width-1,0,ic->width-1,ic->height-1);
  105.    /* free up after uourselves */
  106.    ImlibFreePixmap(imd,tmp);
  107.    ImlibFreePixmap(imd,grab);
  108.    XFreeGC(disp,gc); 
  109.    return ic;
  110. }
  111.  
  112. void LoadImageWithImlib(char *reg_im, ImColor *reg_trans, Pixmap *pmap, Pixmap *mask, int *width, int *height) 
  113. {
  114. /* This function basically sums up everything you need to load an image using
  115.  * imlib -- made by Mandrake some time around 06/21/97 or so ... */
  116.    Image *im;
  117.    im=LoadImage(imd,reg_im,reg_trans);
  118.    if (!im) 
  119.      {
  120.     Alert("EEEEK! Someone Save me!\n I wasn't able to load the file:\n%s\n I'm having a nervous breakdown over this... AAARGH\n(Enlightenment is seen fleeing from the screen\n in an uncrontrollable fit).\n",reg_im);
  121.     EExit(1);
  122.      }
  123.    ImlibRender(imd,im,im->rgb_width,im->rgb_height);
  124.    *pmap=ImlibMoveImageToPixmap(imd,im);
  125.    *mask=ImlibMoveMaskToPixmap(imd,im);
  126.    *width=im->rgb_width;
  127.    *height=im->rgb_height;
  128.    ImlibDestroyImage(imd,im);
  129. }
  130. void LoadImageSizeWithImlib(char *reg_im, ImColor *reg_trans, Pixmap *pmap, Pixmap *mask, int width, int height) 
  131. {
  132. /* This function basically sums up everything you need to load an image using
  133.  * imlib -- made by Mandrake some time around 06/21/97 or so ... */
  134.    Image *im;
  135.  
  136.    im=LoadImage(imd,reg_im,reg_trans);
  137.    if (!im) 
  138.      {
  139.     Alert("EEEEK! Someone Save me!\n I wasn't able to load the file:\n%s\n I'm having a nervous breakdown over this... AAARGH\n(Enlightenment is seen fleeing from the screen\n in an uncrontrollable fit).\n",reg_im);
  140.     EExit(1);
  141.      }
  142.    ImlibRender(imd,im,width,height);
  143.    *pmap=ImlibMoveImageToPixmap(imd,im);
  144.    *mask=ImlibMoveMaskToPixmap(imd,im);
  145.    ImlibDestroyImage(imd,im);
  146. }
  147.  
  148. void InitIcons() 
  149. {
  150.    Pixmap dummy;
  151.  
  152. /* 06/22/97 - finally abstracted out the button loading to use (mandrake)
  153.  * LoadImageWithImlib - cut down on like 100 or so lines of code
  154.  * Still lots of work to do in here */
  155.  
  156.    LoadImageWithImlib(icfg.left_arrow_im, &icfg.left_transparent, &icfg.left_pmap, &icfg.left_mask, &icfg.left_w, &icfg.left_h);
  157.    LoadImageWithImlib(icfg.left_sel_arrow_im, &icfg.left_sel_transparent, &icfg.left_sel_pmap, &icfg.left_sel_mask, &icfg.left_sel_w, &icfg.left_sel_h);
  158.    LoadImageWithImlib(icfg.left_clk_arrow_im, &icfg.left_clk_transparent, &icfg.left_clk_pmap, &icfg.left_clk_mask, &icfg.left_clk_w, &icfg.left_clk_h);
  159.    LoadImageWithImlib(icfg.right_arrow_im, &icfg.right_transparent, &icfg.right_pmap, &icfg.right_mask, &icfg.right_w, &icfg.right_h);
  160.    LoadImageWithImlib(icfg.right_sel_arrow_im, &icfg.right_sel_transparent, &icfg.right_sel_pmap, &icfg.right_sel_mask, &icfg.right_sel_w, &icfg.right_sel_h);
  161.    LoadImageWithImlib(icfg.right_clk_arrow_im, &icfg.right_clk_transparent, &icfg.right_clk_pmap, &icfg.right_clk_mask, &icfg.right_clk_w, &icfg.right_clk_h);
  162.    LoadImageSizeWithImlib(icfg.background_im, NULL, &icfg.bg_pmap, &dummy, icfg.width, icfg.height);
  163.    
  164.    icfg.bg_win=CreateBasicWin(root,icfg.x,icfg.y,icfg.width,icfg.height);
  165.    XSelectInput(disp,icfg.bg_win,SubstructureNotifyMask|ButtonPressMask|
  166.         ButtonReleaseMask|EnterWindowMask|LeaveWindowMask|
  167.         ButtonMotionMask|FocusChangeMask|ColormapChangeMask|
  168.         PropertyChangeMask|SubstructureRedirectMask|
  169.         PointerMotionMask);
  170.    if (icfg.orientation) 
  171.      {
  172.     icfg.left_win=CreateBasicWin(root,icfg.x+((icfg.width-icfg.left_w)/2),
  173.                       icfg.y-icfg.left_h,
  174.                       icfg.left_w,icfg.left_h);
  175.     icfg.right_win=CreateBasicWin(root,
  176.                       icfg.x+((icfg.width-icfg.right_w)/2),
  177.                       icfg.y+icfg.height,
  178.                       icfg.right_w,icfg.right_h);
  179.      } 
  180.    else 
  181.      {
  182.     icfg.left_win=CreateBasicWin(root,icfg.x-icfg.left_w,
  183.                       icfg.y+((icfg.height-icfg.left_h)/2),
  184.                       icfg.left_w,icfg.left_h);
  185.     icfg.right_win=CreateBasicWin(root,icfg.x+icfg.width,
  186.                       icfg.y+((icfg.height-icfg.right_h)/2),
  187.                       icfg.right_w,icfg.right_h);
  188.      }
  189.    XSelectInput(disp,icfg.left_win,LeaveWindowMask|
  190.         EnterWindowMask|SubstructureNotifyMask|
  191.         PropertyChangeMask|SubstructureRedirectMask);
  192.    XSelectInput(disp,icfg.right_win,LeaveWindowMask|
  193.         EnterWindowMask|SubstructureNotifyMask|
  194.         PropertyChangeMask|SubstructureRedirectMask);
  195.    XSetWindowBackgroundPixmap(disp,icfg.bg_win,icfg.bg_pmap);
  196.    XSetWindowBackgroundPixmap(disp,icfg.left_win,icfg.left_pmap);
  197.    XSetWindowBackgroundPixmap(disp,icfg.right_win,icfg.right_pmap);
  198.    if (icfg.left_mask)
  199.      XShapeCombineMask(disp,icfg.left_win,ShapeBounding,0,0,icfg.left_mask,ShapeSet);
  200.    if (icfg.right_mask)
  201.      XShapeCombineMask(disp,icfg.right_win,ShapeBounding,0,0,icfg.right_mask,ShapeSet);
  202. }
  203.  
  204. Icon *GetIconWinID(Window w) {
  205.    struct i_member *ptr;
  206.    
  207.    ptr=ilist.first;
  208.    while(ptr) {
  209.     if (ptr->icon->win==w) return ptr->icon;
  210.     ptr=ptr->next;
  211.    }
  212.    return NULL;
  213. }
  214.  
  215. void AddIcon(Icon *ic) 
  216. {
  217.    struct i_member *ptr;
  218.    struct i_member *pptr;
  219.    int x,y;
  220.    
  221.    if (ilist.first) 
  222.      {
  223.     ptr=ilist.first;
  224.     x=ptr->icon->x;
  225.     y=ptr->icon->y;
  226.     while(ptr) 
  227.       {
  228.          pptr=ptr;
  229.          x+=ptr->icon->width+(icfg.bx*2);
  230.          y+=ptr->icon->height+(icfg.by*2);
  231.          ptr=ptr->next;
  232.       }
  233.     pptr->next=malloc(sizeof(struct i_member));
  234.     pptr->next->next=NULL;
  235.     pptr->next->icon=ic;
  236.     ilist.last=pptr->next;
  237.     if (icfg.orientation) 
  238.       {
  239.          pptr->next->icon->x=icfg.bx;
  240.          pptr->next->icon->y=y;
  241.       } 
  242.     else 
  243.       {
  244.          pptr->next->icon->x=x;
  245.          pptr->next->icon->y=icfg.by;
  246.       }
  247.     XMoveWindow(disp,pptr->next->icon->win,pptr->next->icon->x,pptr->next->icon->y);
  248.     XMapWindow(disp,pptr->next->icon->win);
  249.     if (ic->mask) XShapeCombineMask(disp,ic->win,ShapeBounding,0,0,ic->mask,ShapeSet);
  250.      } 
  251.    else 
  252.      {
  253.     ilist.first=malloc(sizeof(struct i_member));
  254.     ilist.first->next=NULL;
  255.     ilist.first->icon=ic;
  256.     ilist.first->icon->y=icfg.by;
  257.     ilist.first->icon->x=icfg.bx;
  258.     ilist.last=ilist.first;
  259.     XMoveWindow(disp,ilist.first->icon->win,ilist.first->icon->x,ilist.first->icon->y);
  260.     XMapWindow(disp,ilist.first->icon->win);
  261.     if (ic->mask) XShapeCombineMask(disp,ic->win,ShapeBounding,0,0,ic->mask,ShapeSet);
  262.      }
  263.    XSync(disp,False);
  264. }
  265.  
  266. void DelIcon(Window w) {
  267.    struct i_member *ptr;
  268.    struct i_member *pptr;
  269.    int found;
  270.    int wid;
  271.    
  272.    pptr=NULL;
  273.    found=0;
  274.    if (ilist.first) {
  275.     ptr=ilist.first;
  276.     while(ptr) {
  277.          if (ptr->icon->win==w) {
  278.           found=1;
  279.           break;
  280.          }
  281.          pptr=ptr;
  282.          ptr=ptr->next;
  283.     }
  284.     if (pptr) pptr->next=ptr->next;
  285.     else ilist.first=ptr->next;
  286.     if (icfg.orientation)
  287.       wid=ptr->icon->height;
  288.     else
  289.       wid=ptr->icon->width;
  290.     if (ptr->icon->win) XDestroyWindow(disp,ptr->icon->win);
  291.     if (ptr->icon->pmap) ImlibFreePixmap(imd,ptr->icon->pmap);
  292.     if (ptr->icon->mask) ImlibFreePixmap(imd,ptr->icon->mask);
  293.     ptr->icon->ewin->icon=NULL;
  294.     free(ptr->icon);
  295.     if (ilist.last==ptr) 
  296.     {
  297.        if (pptr) ilist.last=pptr;
  298.        else ilist.last=NULL;
  299.     }
  300.     free(ptr);
  301.     if (pptr) ptr=pptr->next;
  302.     else ptr=ilist.first;
  303.     while(ptr) 
  304.     {
  305.        if (icfg.orientation)
  306.          ptr->icon->y-=wid+(icfg.by*2);
  307.        else
  308.          ptr->icon->x-=wid+(icfg.bx*2);
  309.        XMoveWindow(disp,ptr->icon->win,ptr->icon->x,ptr->icon->y);
  310.        XMapWindow(disp,ptr->icon->win);
  311.        XSync(disp,False);
  312.        pptr=ptr;
  313.        ptr=ptr->next;
  314.     }
  315.    }
  316.    XSync(disp,False);
  317. }
  318.  
  319. void Msg_Iconify(EWin *ewin) {
  320.    XSync(disp,False);
  321.    ewin->state|=ICONIFIED;
  322.    XSetInputFocus(disp,root,RevertToNone,CurrentTime);
  323.    MimickEwin(ewin);
  324.    XSync(disp,False);
  325. }
  326.  
  327. void DeIconify(EWin *ewin) {
  328.  
  329.  
  330.     /* added 07/21/97 by Troy Pesola */
  331.  
  332.     Icon *ic;
  333.     struct i_member *ptr;
  334.  
  335.     /* find the icon in the iconlist */
  336.     ptr=ilist.first;
  337.     while(ptr) {
  338.         if(ptr->icon->ewin==ewin) break;
  339.         ptr=ptr->next;
  340.     }
  341.  
  342.     /* not in the list, get outta here */
  343.     if(!ptr) return;
  344.  
  345.     ic = ptr->icon;
  346.  
  347.     /* restore the window */
  348.     XMapWindow(disp,ewin->frame_win);
  349.     if (fx.shadow.on) XMapWindow(disp,ewin->fx.shadow_win);
  350.     Msg_DeIconify(ewin);
  351.     DelIcon(ic->win);
  352.     XSync(disp,False);
  353.  
  354. }
  355. void Msg_DeIconify(EWin *ewin) {
  356.  
  357.    ewin->state&=~ICONIFIED;
  358.    ewin->state&=~UNMAPPED;
  359.    ewin->state|=MAPPED;
  360.    ewin->desk=desk.current;
  361.    MimickEwin(ewin);
  362.    XSync(disp,False);
  363. }
  364.  
  365. Icon *LoadIconFromDisk(EWin *ewin, char *IconInfo, ImColor *icl)
  366. {
  367.    Icon *ic;
  368.    Pixmap pmap;
  369.    Pixmap mask;
  370.    int w,h;
  371.    
  372.    ic=malloc(sizeof(Icon));
  373.    LoadImageWithImlib(IconInfo,icl,&pmap,&mask,&w,&h);
  374.    ic->ewin=ewin;
  375.    ic->ewin->icon=ic;
  376.    ic->win=CreateWin(icfg.bg_win,0,0,w,h);
  377.    ic->width=w;
  378.    ic->height=h;
  379.    ic->pmap=pmap;
  380.    ic->mask=mask;
  381.    ic->x=0;
  382.    ic->y=0;
  383.    XSetWindowBackgroundPixmap(disp,ic->win,ic->pmap);
  384.    
  385.    return ic;
  386. }
  387.  
  388. Icon *PredefinedIconLoad(EWin *ewin, char *TitleBarContents) 
  389. {
  390. /* Originally created 06/11/97 by Mandrake (mandrake@mandrake.net)
  391.  * this function should return a 1 if found, 0 if not found.
  392.  * If found, the icon is loaded with LoadIconFromDisk
  393.  */
  394.    char *IconInfo;
  395.    ImColor *icl;
  396.    
  397.    IconInfo = ReturnIconPath(TitleBarContents,&icl);
  398.    if (!IconInfo) return NULL;
  399.    if (IconInfo[0]) 
  400.      {
  401.       /* RIGHT HERE NEEDS TO CHANGE TO USE LoadImageWithImlib!!!!!!!!!!!
  402.        * LoadIconFromDisk doesn't exist!!! */
  403.         return LoadIconFromDisk(ewin,IconInfo,icl);
  404.      } 
  405.    return NULL;
  406. }
  407.  
  408. char *ReturnIconPath(char *TitleBarContents, ImColor **icl) 
  409. {
  410. /*   
  411.  * this function should parse through the predefined icon configuration
  412.  * and determine if the window has a predefined icon associated with it
  413.  * NOTE: consider adding a PreDefIconPath to struct Ewin - next release?
  414.  * This function returns the line number containing information about
  415.  * the particular window's predefined icon
  416.  */
  417.    int i;
  418.    
  419.    for(i=0;i<predef_num;i++)
  420.      {
  421.     if (matchregexp(predef_list[i].title,TitleBarContents))
  422.       {
  423.          *icl=predef_list[i].transp;
  424.          return predef_list[i].image_file;
  425.       }
  426.      }
  427.    return NULL;
  428. }
  429.  
  430. void Finish_Iconify() {
  431.    Icon *ic;
  432.    
  433. /* This code was modified by Mandrake - mandrake@mandrake.net 
  434.  * added 06/10/97 - ability to have predefined icon definitions
  435.  * (currently does not support shaped pixmaps)
  436.  */
  437.    if (!CheckClientExists(newicon.ewin))
  438.      {
  439.     ListDelWinID(global_l,newicon.ewin->frame_win);
  440.     XSetInputFocus(disp,root,RevertToNone,CurrentTime);
  441.     XSync(disp,False);
  442.     return;
  443.      }
  444.    ic=PredefinedIconLoad(newicon.ewin,newicon.ewin->title);
  445.    if(!ic) ic=GrabClient(newicon.ewin);
  446. /** end mod **/
  447.    AddIcon(ic);
  448.    XUnmapWindow(disp,newicon.ewin->frame_win);
  449.    if (fx.shadow.on) XUnmapWindow(disp,newicon.ewin->fx.shadow_win);
  450.    Msg_Iconify(newicon.ewin);
  451.    /* allow other iconifications ot go ahead */
  452.    if (newicon.kill) Do_KillWin(newicon.ewin, newicon.kill-1);
  453.    newicon.ewin=NULL;
  454.    newicon.win=0;
  455.    newicon.kill=0;
  456.    timer_mode = 0;
  457. }
  458.  
  459. void MapIconBox()
  460. {
  461.    XMapWindow(disp,icfg.bg_win);
  462.    XMapWindow(disp,icfg.left_win);
  463.    XMapWindow(disp,icfg.right_win);
  464.    XSync(disp,False);
  465. }
  466.  
  467. void IconLeft()
  468. {
  469.    Window dummyw;
  470.    int dummy;
  471.    unsigned int btns;
  472.    
  473.    btns=1;
  474.    while (btns) {
  475.     IconsScroll(8);
  476.     XQueryPointer(disp,root,&dummyw,&dummyw,&dummy,&dummy,&dummy,&dummy,&btns);
  477.     usleep(icfg.scroll_speed*1000);
  478.    }
  479. }
  480.  
  481. void IconRight() {
  482.    Window dummyw;
  483.    int dummy;
  484.    unsigned int btns;
  485.    
  486.    btns=1;
  487.    while (btns) {
  488.     IconsScroll(-8);
  489.     XQueryPointer(disp,root,&dummyw,&dummyw,&dummy,&dummy,&dummy,&dummy,&btns);
  490.     usleep(icfg.scroll_speed*1000);
  491.    }
  492. }
  493.  
  494. void IconsScroll(int x)
  495. {
  496.    struct i_member *ptr;
  497.    unsigned char ok=0;
  498.    
  499.    ptr=ilist.first;
  500.    if (ptr) {
  501.     if (icfg.orientation) {
  502.          if (x<0) {
  503.           if (ilist.last->icon->y>(icfg.height-icfg.by-ilist.last->icon->height+x)) 
  504.             ok=1;
  505.          }
  506.          if (x>0) {
  507.           if (ilist.first->icon->y<(icfg.by+x)) 
  508.             ok=1;
  509.          }
  510.     } else {
  511.          if (x<0) {
  512.           if (ilist.last->icon->x>(icfg.width-icfg.bx-ilist.last->icon->width+x)) 
  513.             ok=1;
  514.          }
  515.          if (x>0) {
  516.           if (ilist.first->icon->x<(icfg.bx+x)) 
  517.             ok=1;
  518.          }
  519.     }
  520.    }
  521.    if (!ok) return;
  522.    while(ptr) {
  523.     if (icfg.orientation)
  524.       ptr->icon->y+=x;
  525.     else
  526.       ptr->icon->x+=x;
  527.     XMoveWindow(disp,ptr->icon->win,ptr->icon->x,ptr->icon->y);
  528.     ptr=ptr->next;
  529.    }
  530.    XSync(disp,False);
  531. }
  532.  
  533. void RaiseLowerIcons() {
  534.    if (icfg.level) {
  535.     XRaiseWindow(disp,icfg.bg_win);
  536.     XRaiseWindow(disp,icfg.left_win);
  537.     XRaiseWindow(disp,icfg.right_win);
  538.     XSync(disp,False);
  539.    } else {
  540.     XLowerWindow(disp,icfg.bg_win);
  541.     XLowerWindow(disp,icfg.left_win);
  542.     XLowerWindow(disp,icfg.right_win);
  543.     XSync(disp,False);
  544.    }
  545. }
  546.