Changeset 3575 in Sophya


Ignore:
Timestamp:
Feb 12, 2009, 4:12:56 PM (17 years ago)
Author:
ansari
Message:

Ajout handler visibility-change event pour contourner le probleme de PIBaseWdgX non rafraichi avec certains serveurs X11 (X.org) - Reza 12/02/2009

Location:
trunk/SophyaPI/PI
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/SophyaPI/PI/piwindowx.cc

    r3291 r3575  
    152152//if (mWtyp == PIWK_transient) 
    153153  XRaiseWindow(mdsp, XtWindow(pwm->XtWdg()));
     154  // cmv+rz Fevrier 2009 (retour Moriond) - Suppression de XFlush() / usleep 
     155  // Probleme regle par gestion VisibilityChange event ds pixtbase.cc
    154156  // cmv+rz 09/08/2007 Ajout XFlush() + usleep
    155157  // pour regler le probleme de  perte d'evenement expose a la creation
    156   XFlush(mdsp);   usleep(5000);
     158  //  XFlush(mdsp);   usleep(5000);
    157159return;
    158160}
  • trunk/SophyaPI/PI/pixtbase.cc

    r3572 r3575  
    143143}
    144144
     145// Pour traiter les etats de changements de visibilite de la fenetre
     146/* Nouvelle-Fonction */
     147void visibchange_handler_pixtbase (Widget wdgp, XtPointer /*closure*/,
     148                             XEvent* evt, Boolean* cont)
     149{
     150#ifdef DEBUG_PIXTB
     151printf("Debug_visibchange_handler_pixtbase: Wdg= %lx Object= %lx  fgvis_expose= %d (EvtType=%d VisSt=%d)\n",
     152  (long)wdgp, (long)(((PIXtBaseWidget)wdgp)->pixtbase.objet),
     153  ((PIXtBaseWidget)wdgp)->pixtbase.vis_expose_fg, (int)evt->type,(int)evt->xvisibility.state);
     154#endif
     155PIXtBaseWidget bwdg = (PIXtBaseWidget)wdgp;
     156if (bwdg->pixtbase.vis_expose_fg != 1) return;
     157if (evt->xvisibility.state == VisibilityFullyObscured)  return;
     158int x0, y0, dx, dy;
     159x0 = y0 = 0;
     160dx = wdgp->core.width;  dy = wdgp->core.height;
     161(bwdg->pixtbase.objet)->eXposeProcess(x0, y0, dx, dy);
     162bwdg->pixtbase.vis_expose_fg = 0;
     163}
     164
    145165/* Nouvelle-Fonction */
    146166static void init_pixtbase (Widget request, Widget wdg,
     
    154174// get_GCs (wdgp);
    155175#ifdef DEBUG_PIXTB
    156 printf("Debug_init_pixtbase: Wdg=%lx Object= %lx  narg=%d \n",
    157 (long)wdgp, (long)(wdgp->pixtbase.objet), (int)(*narg));
    158 #endif
    159 return;
    160 }
    161 
    162 /* Nouvelle-Fonction */
    163 static void destroy_pixtbase (Widget /*wdgp*/)
     176printf("Debug_init_pixtbase: Wdg=%lx Object= %lx  \n",
     177(long)wdgp, (long)(wdgp->pixtbase.objet));
     178#endif
     179
     180// Pour gerer les exposes event avec fenetre non visible ...
     181wdgp->pixtbase.vis_expose_fg = 0;
     182XtAddEventHandler(wdg, VisibilityChangeMask, FALSE, visibchange_handler_pixtbase, NULL);
     183return;
     184}
     185
     186/* Nouvelle-Fonction */
     187static void destroy_pixtbase (Widget wdgp)
    164188{
    165189#ifdef DEBUG_PIXTB
     
    194218(long)(((PIXtBaseWidget)wdgp)->pixtbase.objet) );
    195219#endif
    196 if (!(wdgp->core.visible))  return;
    197 if ( ((PIXtBaseWidget)wdgp)->pixtbase.objet )
    198   {
     220if (!(wdgp->core.visible))  {
     221  ((PIXtBaseWidget)wdgp)->pixtbase.vis_expose_fg = 1;
     222  return;
     223}
     224if ( ((PIXtBaseWidget)wdgp)->pixtbase.objet ) {
    199225  XRectangle  xrec;
    200226  int x0, y0, dx, dy;
    201   XClipBox(region, &xrec);
    202   x0 = xrec.x;  y0 = xrec.y;
    203   dx = xrec.width;  dy = xrec.height;
     227  if (region) {
     228    XClipBox(region, &xrec);
     229    x0 = xrec.x;  y0 = xrec.y;
     230    dx = xrec.width;  dy = xrec.height;
     231  }
     232  else {
     233    x0 = y0 = 0;
     234    dx = wdgp->core.width;  dy = wdgp->core.height;
     235  }
    204236  (((PIXtBaseWidget)wdgp)->pixtbase.objet)->eXposeProcess(x0, y0, dx, dy);
    205   }
     237  ((PIXtBaseWidget)wdgp)->pixtbase.vis_expose_fg = 0;
     238}
    206239return;
    207240}
  • trunk/SophyaPI/PI/pixtbaseP.h

    r103 r3575  
    2424PIBaseWdgX  * objet;
    2525unsigned long myeventmask;
     26unsigned int vis_expose_fg;   // Gestion des expose_event avec fenetre non visible
    2627} PIXtBasePart;
    2728
Note: See TracChangeset for help on using the changeset viewer.