Changeset 20930

Show
Ignore:
Timestamp:
11/18/07 13:06:37 (1 year ago)
Author:
patrick
Message:

Put the code for getting the X11 display attributes in a reusable method.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • juggler/trunk/modules/gadgeteer/gadget/Devices/KeyboardMouseDevice/InputAreaXWin.cpp

    r19827 r20930  
    463463   mWidth = width; 
    464464   mHeight = height; 
     465} 
     466 
     467const XWindowAttributes InputAreaXWin::getDisplayAttributes() const 
     468{ 
     469   XWindowAttributes win_attrs; 
     470   XGetWindowAttributes(mXDisplay, 
     471                        RootWindow(mXDisplay, DefaultScreen(mXDisplay)), 
     472                        &win_attrs); 
     473 
     474   return win_attrs; 
    465475} 
    466476 
  • juggler/trunk/modules/gadgeteer/gadget/Devices/KeyboardMouseDevice/InputAreaXWin.h

    r19824 r20930  
    7171   void unlockMouse(XEvent* ev = NULL); 
    7272   void updateOriginAndSize(unsigned int width, unsigned int height); 
     73 
     74   /** 
     75    * Returns the X11 window attributes for the root display. 
     76    * 
     77    * @since 1.3.16 
     78    */ 
     79   const XWindowAttributes getDisplayAttributes() const; 
    7380 
    7481protected: 
  • juggler/trunk/modules/gadgeteer/gadget/Devices/KeyboardMouseDevice/InputWindowXWin.cpp

    r20880 r20930  
    461461 
    462462   // need screen size so we can convert origin from lower-left 
    463    XWindowAttributes winattrs; 
    464    XGetWindowAttributes(mXDisplay, RootWindow(mXDisplay, DefaultScreen(mXDisplay)), 
    465                         &winattrs); 
     463   const XWindowAttributes winattrs = getDisplayAttributes(); 
    466464 
    467465   // create it