[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference bulova::decw_jan-89_to_nov-90

Title:DECWINDOWS 26-JAN-89 to 29-NOV-90
Notice:See 1639.0 for VMS V5.3 kit; 2043.0 for 5.4 IFT kit
Moderator:STAR::VATNE
Created:Mon Oct 30 1989
Last Modified:Mon Dec 31 1990
Last Successful Update:Fri Jun 06 1997
Number of topics:3726
Total number of notes:19516

3443.0. "after dxwm is killed..." by TPOVC::JOHNNYHO () Tue Oct 09 1990 10:43

    A strategic customer is porting their X Window based ECAD software to
    our DECstation 3100 running UWS V4.0. The following is his description
    of the problem he came across.
    
    "Our X Window System based schematic editor provides rubberbanding
    effect for moving objects, and it works well on Sun and IBM RS6000.
    But, when we tried to move certain number of objects(e.g. 8 or 16
    gates) on DS3100, the cursor happened to be disappeared after few
    restricted movements and there is no more rubberbanding effect. By the
    way, for some unknown reasons, there are a few white spots shown in the
    upper region of the objects to be moved. However, it still functions
    correctly once the destination specified by the mouse button. In other
    cases, it seems okay to move some other number of objects. Since this
    editor *HAS ITS OWN WINDOW MANAGER*, the 'dxwm' is killed before we run
    the program."
    
    Any idea how to fix it? Thank for any help.
    
    Johnny
T.RTitleUserPersonal
Name
DateLines
3443.1more info, please.OXNARD::KLEEKen LeeTue Oct 09 1990 14:1010
    Is the missing cursor the X cursor (drawn by the X server) or some
    cursor drawn by their application?  If it's their own cursor, are they
    getting motion events to position it?
    
    Rubberbanding is the responsibility of the application.  Is it
    receiving the correct motion events?
    
    Thanks.
    
    Ken
3443.2detail descriptionTPOVC::JOHNNYHOTue Oct 16 1990 09:3338
Reply .1 
    1. They are using X Windows' cursor. Not their own.
    2. About the motion event, please refer .3.
    
    
I've visited the customer and got part of their source code which does
rubberbanding. I've posted the program in the next entry(.3). Well, in
computer graphics area, actually it should be called "echo". Not
"rubberbanding"!

The following are the steps I went through then the strange thing happened.

1. Kill DECwindows Window Manager.
2. Start their application, an Electronic Schematic Editor written on X
   Windows system.
3. To move objects, I first specify the object by clicking the mouse on it.
   The object will be highlighted, that is, its color changed to white color.
4. Select "MOVE" command in manu.
5. Click on the object again and the object(echo) SHOULD BE moved along with
   cursor.
6. Move cursor to destination and click again. The object should be redrawn
   on the new position with its original color.

When I selected one object to move, no problem! Two objects, fine! Three
objects, fine! The strange thing didn't happen until I select nine or more
objects to move.  It happened in step 5. The objects only moved a little bit
then "frozen". But I can still move the cursor to destination and the objects 
redrawn correctly.

It seems to me that the server can not handle the cursor motion events and
redraw the objects as fast as the cursor movement so the event queue were
"traffic jammed". All the stuck events were discarded and only the last one
was handled(step 6).

Any idea?

Johnny
    
3443.3Part of the programTPOVC::JOHNNYHOTue Oct 16 1990 09:3782
/* grab pointer */
XGrabPointer (dpy,window, False,
        (ButtonPressMask | ButtonReleaseMask
        PointerMotionMask | PointerMotionHintMask),
        GrabModeAsync,GrabModeAasync,window,Hand2Cursor,
        CurrentTime);


/* draw initial selected objects */
IceRubberBand(checklist,ox,oy,db_x,db_y);


while( TRUE)
{
  XNextEvent( dpy, &event);
  switch( event.type)
  {

     case ButtonPress:
          button = event.xbutton.button;
          while( TRUE)
          {
             /* get rid of presses on other buttons */
             while( XCheckTypedEvent( dpy, ButtonPress, &event));
             /* wait for release, if on correct button then break */
             XMaskEvent( dpy, ButtonReleaseMask, &event);
             if( event.xbutton.button == button) break;
          }

          /* get window-based coordinate */
          pos_x = event.xbutton.x;
          pox_y = event.xbutton.y;

          /* get grid-based coordinates */
          IceCheckXY( checklist, &pos_x, &pos_y);
          WindowToDatabase(checklist,pos_x,pos_y,&x1,&y1);
          x2 = x1 + width;
          y2 = y1 + height;
   
          /* check range */
          if (!LocateInSheet(x1,y1) || !LocateInSheet(x2,y2))
          {
                 IceError("Area is out of editing window\n");
                 IceRubberBand(checklist,ox,oy,db_x,db_y);
                 XUngrabPointer(dpy,CurrentTime);
                 return(False);

          }

          /* clear rubber-bandimage */
          IceRubberBand(checklist,ox,oy,db_x,db_y);

          /* return new value */
          new_area->x1 = x1;    new_area->y1 = y1;
          new_area->x2 = x2;    new_area->y2 = y2;

          XDefineCurssor( dpy, window, SchCursor);
          XUngrabPointer( dpy,CurrentTime);
          return(True);

     case MotionNotify:

          /* rubber_band operation */
          while( XCheckMaskEvent( dpy, ButtonMotionMask,  &event));
          /* check if pointer locates on the same window */
          if( !XQueryPointer( dppy, window, &root, &sub_win, &root_x, &root_y,
			      &pos_x, &pos_y, &ptrmask)) break;
     
          /* redraw previous cell image */
          IceRubberBand(checklist,ox,oy,db_x,db_y);

          /* draw current cell image */
          IceCheckXY( checklist, &pos_x, &pos_y);/* if grid on */

          /* transform to grid based coordinates */
          WindowToDatabase(checklist, pos_x,pos_y,&db_x,&db_y);

          IceRubberBand(checklist,ox,oy,db_x,db_y);

          break; 

3443.4a guess at what your problem isOXNARD::KLEEKen LeeTue Oct 16 1990 14:259
    The code in .3 doesn't say much.  Are they trying to drag color
    objects?  Do they reserve part of the colormap for this or are they
    using bit logic?  Are the other systems mentioned in .0 also color? 
    Dragging large numbers of color objects is expensive.  Most systems
    that have to do this use special tricks, such as reserved color planes,
    to improve performance.
    
    Ken
    
3443.5memory?OXNARD::KLEEKen LeeTue Oct 16 1990 15:437
    Another possibility is massive paging due to memory limitations.  How
    much physical memory do these machines have?  How large are the client
    programs?  Do you have the same problems when client and server are run
    on separate machines?
    
    Ken
    
3443.6answer part of your questionTPOVC::JOHNNYHOThu Oct 18 1990 01:4016
    >> Are they trying to drag color objects?
    
    They are not dragging color objects! The objects do show their own colors
    before I select them. But those objects are redrawn using white color
    after they are selected and before placed in destination. So they are all
    in white color while they're moving.
    
    >> Do they reserve part of the colormap for this or are they using bit
    logic?
    
    The customer is using default color map and doesn't change any of the
    entry.
    
    >> Are the other systems mentioned in .0 also color?
    
    Yes, they are color Sun 3/60 and RS6000.
3443.7HGABSS::SAMMYKAMSammy Kam, Asia EngineeringMon Oct 22 1990 05:1212
    re : .2
    
    The major difference in moving 1 object and 9 objects is that more
    GraphicsExpose events will be sent to the client (I assume your customer 
    use XCopyArea or XCopyPlane to move the objects).
    Try setting graphics_exposure to False in the GC used for copying
    objects.
    
    Hope this helps,
    
    Sammy