Ignore:
Timestamp:
Nov 25, 2008, 5:28:38 PM (16 years ago)
Author:
garnier
Message:

pre-tag revision and some improvments

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/visualization/OpenGL/src/G4OpenGLXViewer.cc

    r850 r891  
    218218  y_origin = 0;
    219219  size_hints = XAllocSizeHints();
    220   const G4String& XGeometryString = fVP.GetXGeometryString();
    221   int screen_num = DefaultScreen(dpy);
    222   if (!XGeometryString.empty()) {
    223     G4int geometryResultMask = XParseGeometry
    224       ((char*)XGeometryString.c_str(),
    225        &x_origin, &y_origin, &width, &height);
    226     if (geometryResultMask & (WidthValue | HeightValue)) {
    227       if (geometryResultMask & XValue) {
    228         if (geometryResultMask & XNegative) {
    229           x_origin = DisplayWidth(dpy, screen_num) + x_origin - width;
    230         }
    231         size_hints->flags |= PPosition;
    232         size_hints->x = x_origin;
    233       }
    234       if (geometryResultMask & YValue) {
    235         if (geometryResultMask & YNegative) {
    236           y_origin = DisplayHeight(dpy, screen_num) + y_origin - height;
    237         }
    238         size_hints->flags |= PPosition;
    239         size_hints->y = y_origin;
    240       }
    241     } else {
    242       G4cout << "ERROR: Geometry string \""
    243              << XGeometryString
    244              << "\" invalid.  Using \"600x600\"."
    245              << G4endl;
    246       width = 600;
    247       height = 600;
    248     }
    249   }
    250   size_hints->width = width;
    251   size_hints->height = height;
     220
     221  // already done in G4VViewer at creation
     222
     223//   const G4String& XGeometryString = fVP.GetXGeometryString();
     224//   int screen_num = DefaultScreen(dpy);
     225//   if (!XGeometryString.empty()) {
     226//     G4int geometryResultMask = XParseGeometry
     227//       ((char*)XGeometryString.c_str(),
     228//        &x_origin, &y_origin, &width, &height);
     229//     if (geometryResultMask & (WidthValue | HeightValue)) {
     230//       if (geometryResultMask & XValue) {
     231//      if (geometryResultMask & XNegative) {
     232//        x_origin = DisplayWidth(dpy, screen_num) + x_origin - width;
     233//      }
     234//      size_hints->flags |= PPosition;
     235//      size_hints->x = x_origin;
     236//       }
     237//       if (geometryResultMask & YValue) {
     238//      if (geometryResultMask & YNegative) {
     239//        y_origin = DisplayHeight(dpy, screen_num) + y_origin - height;
     240//      }
     241//      size_hints->flags |= PPosition;
     242//      size_hints->y = y_origin;
     243//       }
     244//     } else {
     245//       G4cout << "ERROR: Geometry string \""
     246//           << XGeometryString
     247//           << "\" invalid.  Using \"600x600\"."
     248//           << G4endl;
     249//       width = 600;
     250//       height = 600;
     251//     }
     252//   }
     253//  size_hints->width = width;
     254//  size_hints->height = height;
     255
     256#ifdef G4DEBUG
     257  printf("CreateWindow Size:%d=%d - %d=%d \n",width,fVP.GetWindowSizeHintX(),height, fVP.GetWindowSizeHintY());
     258#endif
     259
     260  size_hints->width = fVP.GetWindowSizeHintX();
     261  size_hints->height = fVP.GetWindowSizeHintY();
    252262  size_hints->flags |= PSize;
    253263
Note: See TracChangeset for help on using the changeset viewer.