src/gui/kernel/qapplication_x11.cpp
changeset 19 fcece45ef507
parent 18 2f34d5167611
child 30 5dc02b23752f
equal deleted inserted replaced
18:2f34d5167611 19:fcece45ef507
    94 #   include <wacomcfg.h>
    94 #   include <wacomcfg.h>
    95 #   undef class
    95 #   undef class
    96 }
    96 }
    97 #endif
    97 #endif
    98 
    98 
       
    99 #ifndef QT_GUI_DOUBLE_CLICK_RADIUS
       
   100 #define QT_GUI_DOUBLE_CLICK_RADIUS 5
       
   101 #endif
       
   102 
       
   103 
    99 //#define ALIEN_DEBUG
   104 //#define ALIEN_DEBUG
   100 
   105 
   101 #if !defined(QT_NO_GLIB)
   106 #if !defined(QT_NO_GLIB)
   102 #  include "qguieventdispatcher_glib_p.h"
   107 #  include "qguieventdispatcher_glib_p.h"
   103 #endif
   108 #endif
   313 
   318 
   314     // XEMBED
   319     // XEMBED
   315     "_XEMBED\0"
   320     "_XEMBED\0"
   316     "_XEMBED_INFO\0"
   321     "_XEMBED_INFO\0"
   317 
   322 
       
   323     // Wacom old. (before version 0.10)
   318     "Wacom Stylus\0"
   324     "Wacom Stylus\0"
   319     "Wacom Cursor\0"
   325     "Wacom Cursor\0"
   320     "Wacom Eraser\0"
   326     "Wacom Eraser\0"
       
   327 
       
   328     // Tablet
       
   329     "STYLUS\0"
       
   330     "ERASER\0"
   321 };
   331 };
   322 
   332 
   323 Q_GUI_EXPORT QX11Data *qt_x11Data = 0;
   333 Q_GUI_EXPORT QX11Data *qt_x11Data = 0;
   324 
   334 
   325 /*****************************************************************************
   335 /*****************************************************************************
  2359                 if (devName == QLatin1String(WACOM_NAME)) {
  2369                 if (devName == QLatin1String(WACOM_NAME)) {
  2360                     deviceType = QTabletEvent::Stylus;
  2370                     deviceType = QTabletEvent::Stylus;
  2361                     gotStylus = true;
  2371                     gotStylus = true;
  2362                 }
  2372                 }
  2363 #else
  2373 #else
  2364                 if (devs->type == ATOM(XWacomStylus)) {
  2374                 if (devs->type == ATOM(XWacomStylus) || devs->type == ATOM(XTabletStylus)) {
  2365                     deviceType = QTabletEvent::Stylus;
  2375                     deviceType = QTabletEvent::Stylus;
  2366                     if (wacomDeviceName()->isEmpty())
  2376                     if (wacomDeviceName()->isEmpty())
  2367                         wacomDeviceName()->append(devs->name);
  2377                         wacomDeviceName()->append(devs->name);
  2368                     gotStylus = true;
  2378                     gotStylus = true;
  2369                 } else if (devs->type == ATOM(XWacomEraser)) {
  2379                 } else if (devs->type == ATOM(XWacomEraser) || devs->type == ATOM(XTabletEraser)) {
  2370                     deviceType = QTabletEvent::XFreeEraser;
  2380                     deviceType = QTabletEvent::XFreeEraser;
  2371                     gotEraser = true;
  2381                     gotEraser = true;
  2372                 }
  2382                 }
  2373 #endif
  2383 #endif
  2374                 if (deviceType == QTabletEvent::NoDevice)
  2384                 if (deviceType == QTabletEvent::NoDevice)
  4213             }
  4223             }
  4214             if (mouseActWindow == event->xbutton.window &&
  4224             if (mouseActWindow == event->xbutton.window &&
  4215                 mouseButtonPressed == button &&
  4225                 mouseButtonPressed == button &&
  4216                 (long)event->xbutton.time -(long)mouseButtonPressTime
  4226                 (long)event->xbutton.time -(long)mouseButtonPressTime
  4217                 < QApplication::doubleClickInterval() &&
  4227                 < QApplication::doubleClickInterval() &&
  4218                 qAbs(event->xbutton.x - mouseXPos) < 5 &&
  4228                 qAbs(event->xbutton.x - mouseXPos) < QT_GUI_DOUBLE_CLICK_RADIUS &&
  4219                 qAbs(event->xbutton.y - mouseYPos) < 5) {
  4229                 qAbs(event->xbutton.y - mouseYPos) < QT_GUI_DOUBLE_CLICK_RADIUS) {
  4220                 type = QEvent::MouseButtonDblClick;
  4230                 type = QEvent::MouseButtonDblClick;
  4221                 mouseButtonPressTime -= 2000;        // no double-click next time
  4231                 mouseButtonPressTime -= 2000;        // no double-click next time
  4222             } else {
  4232             } else {
  4223                 type = QEvent::MouseButtonPress;
  4233                 type = QEvent::MouseButtonPress;
  4224                 mouseButtonPressTime = event->xbutton.time;
  4234                 mouseButtonPressTime = event->xbutton.time;