Qt 4.8
Classes | Macros | Enumerations | Functions | Variables
qdnd_x11.cpp File Reference
#include "qplatformdefs.h"
#include "qapplication.h"
#include "qabstracteventdispatcher.h"
#include "qwidget.h"
#include "qpainter.h"
#include "qpixmap.h"
#include "qbitmap.h"
#include "qdesktopwidget.h"
#include "qevent.h"
#include "qiodevice.h"
#include "qpointer.h"
#include "qcursor.h"
#include "qelapsedtimer.h"
#include "qvariant.h"
#include "qvector.h"
#include "qurl.h"
#include "qdebug.h"
#include "qimagewriter.h"
#include "qbuffer.h"
#include "qtextcodec.h"
#include "qdnd_p.h"
#include "qapplication_p.h"
#include "qt_x11_p.h"
#include "qx11info_x11.h"
#include "qwidget_p.h"
#include "qcursor_p.h"
#include <X11/extensions/Xfixes.h>
#include "qdnd_x11.moc"

Go to the source code of this file.

Classes

class  QExtraWidget
 
class  QShapedPixmapWidget
 
struct  XdndData
 

Macros

#define DEBUG   if(0) qDebug
 
#define DNDDEBUG   if(0) qDebug()
 

Enumerations

enum  { XdndDropTransactionTimeout = 5000 }
 

Functions

static bool checkEmbedded (QWidget *w, const XEvent *xe)
 
static QWidgetfind_child (QWidget *tlw, QPoint &p)
 
static Window findRealWindow (const QPoint &pos, Window w, int md, bool ignoreNonXdndAwareWindows)
 
static Window findXdndAwareParent (Window window)
 
static int findXdndDropTransactionByTime (Time timestamp)
 
static int findXdndDropTransactionByWindow (Window window)
 
static void handle_xdnd_position (QWidget *, const XEvent *, bool)
 
static void handle_xdnd_status (QWidget *w, const XEvent *xe, bool)
 
static void qt_xdnd_cleanup ()
 
static void qt_xdnd_send_leave ()
 
static int qtaction_to_xdndaction (Qt::DropAction a)
 
static void restartXdndDropExpiryTimer ()
 
static bool windowInteractsWithPosition (const QPoint &pos, Window w, int shapeType)
 
static Bool xdnd_position_scanner (Display *, XEvent *event, XPointer)
 
static Bool xdnd_status_scanner (Display *, XEvent *event, XPointer)
 
static Qt::DropAction xdndaction_to_qtaction (Atom atom)
 
static bool xdndEnable (QWidget *w, bool on)
 
static QVariant xdndObtainData (const char *format, QVariant::Type requestedType)
 
static WId xdndProxy (WId w)
 

Variables

static QCursorcopyCursor = 0
 
static QWidgetcurrent_embedding_widget = 0
 
static const char *const default_pm []
 
static const int default_pm_hotx = -2
 
static const int default_pm_hoty = -16
 
static QPixmapdefaultPm = 0
 
static Qt::DropAction global_accepted_action = Qt::CopyAction
 
static int heartbeat = -1
 
static XEvent last_enter_event
 
static Qt::DropAction last_target_accepted_action = Qt::IgnoreAction
 
static QCursorlinkCursor = 0
 
static QCursormoveCursor = 0
 
static QCursornoDropCursor = 0
 
static Qt::DropActions possible_actions = Qt::IgnoreAction
 
static QPoint qt_xdnd_current_position
 
static Window qt_xdnd_current_proxy_target
 
static int qt_xdnd_current_screen = -1
 
static Window qt_xdnd_current_target
 
static QPointer< QWidgetqt_xdnd_current_widget
 
bool qt_xdnd_dragging = false
 
static Atom qt_xdnd_dragsource_xid = 0
 
const int qt_xdnd_max_type = 100
 
static Time qt_xdnd_source_current_time
 
static QRect qt_xdnd_source_sameanswer
 
static Time qt_xdnd_target_current_time
 
static Atom qt_xdnd_types [qt_xdnd_max_type+1]
 
static int transaction_expiry_timer = -1
 
static bool waiting_for_status = false
 
static XdndData xdnd_data = { 0, 0 }
 
const int xdnd_version = 5
 

Macro Definition Documentation

◆ DEBUG

#define DEBUG   if(0) qDebug

◆ DNDDEBUG

#define DNDDEBUG   if(0) qDebug()

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
XdndDropTransactionTimeout 

Definition at line 122 of file qdnd_x11.cpp.

Function Documentation

◆ checkEmbedded()

static bool checkEmbedded ( QWidget w,
const XEvent xe 
)
static

Definition at line 767 of file qdnd_x11.cpp.

Referenced by handle_xdnd_position(), QX11Data::xdndHandleDrop(), and QX11Data::xdndHandleLeave().

768 {
769  if (!w)
770  return false;
771 
773  qt_xdnd_current_target = ((QExtraWidget*)current_embedding_widget)->extraData()->xDndProxy;
779  }
780 
781  QWExtra* extra = ((QExtraWidget*)w)->extraData();
782  if (extra && extra->xDndProxy != 0) {
783 
784  if (current_embedding_widget != w) {
785 
786  last_enter_event.xany.window = extra->xDndProxy;
787  XSendEvent(X11->display, extra->xDndProxy, False, NoEventMask, &last_enter_event);
789  }
790 
791  ((XEvent*)xe)->xany.window = extra->xDndProxy;
792  XSendEvent(X11->display, extra->xDndProxy, False, NoEventMask, (XEvent*)xe);
793  if (qt_xdnd_current_widget != w) {
795  }
796  return true;
797  }
799  return false;
800 }
static QWidget * current_embedding_widget
Definition: qdnd_x11.cpp:249
static XEvent last_enter_event
Definition: qdnd_x11.cpp:250
static Window qt_xdnd_current_proxy_target
Definition: qdnd_x11.cpp:226
#define X11
Definition: qt_x11_p.h:724
union _XEvent XEvent
Definition: qwindowdefs.h:116
static Window qt_xdnd_current_target
Definition: qdnd_x11.cpp:224
static QPointer< QWidget > qt_xdnd_current_widget
Definition: qdnd_x11.cpp:230
static void qt_xdnd_send_leave()
Definition: qdnd_x11.cpp:1079
QWidget * window() const
Returns the window for this widget, i.e.
Definition: qwidget.cpp:4492

◆ find_child()

static QWidget* find_child ( QWidget tlw,
QPoint p 
)
static

Definition at line 732 of file qdnd_x11.cpp.

Referenced by handle_xdnd_position().

733 {
734  QWidget *widget = tlw;
735 
736  p = widget->mapFromGlobal(p);
737  bool done = false;
738  while (!done) {
739  done = true;
740  if (((QExtraWidget*)widget)->extraData() &&
741  ((QExtraWidget*)widget)->extraData()->xDndProxy != 0)
742  break; // stop searching for widgets under the mouse cursor if found widget is a proxy.
743  QObjectList children = widget->children();
744  if (!children.isEmpty()) {
745  for(int i = children.size(); i > 0;) {
746  --i;
747  QWidget *w = qobject_cast<QWidget *>(children.at(i));
748  if (!w)
749  continue;
751  continue;
752  if (w->isVisible() &&
753  w->geometry().contains(p) &&
754  !w->isWindow()) {
755  widget = w;
756  done = false;
757  p = widget->mapFromParent(p);
758  break;
759  }
760  }
761  }
762  }
763  return widget;
764 }
QPointer< QWidget > widget
bool isWindow() const
Returns true if the widget is an independent window, otherwise returns false.
Definition: qwidget.h:945
bool isVisible() const
Definition: qwidget.h:1005
The QWidget class is the base class of all user interface objects.
Definition: qwidget.h:150
T * qobject_cast(QObject *object)
Definition: qobject.h:375
bool isEmpty() const
Returns true if the list contains no items; otherwise returns false.
Definition: qlist.h:152
bool testAttribute(Qt::WidgetAttribute) const
Returns true if attribute attribute is set on this widget; otherwise returns false.
Definition: qwidget.h:1041
const T & at(int i) const
Returns the item at index position i in the list.
Definition: qlist.h:468
bool contains(const QPoint &p, bool proper=false) const
Returns true if the given point is inside or on the edge of the rectangle, otherwise returns false...
Definition: qrect.cpp:1101
QPoint mapFromParent(const QPoint &) const
Translates the parent widget coordinate pos to widget coordinates.
Definition: qwidget.cpp:4473
int size() const
Returns the number of items in the list.
Definition: qlist.h:137
const QObjectList & children() const
Returns a list of child objects.
Definition: qobject.h:197
QPoint mapFromGlobal(const QPoint &) const
Translates the global screen coordinate pos to widget coordinates.
QRect geometry
the geometry of the widget relative to its parent and excluding the window frame
Definition: qwidget.h:158

◆ findRealWindow()

static Window findRealWindow ( const QPoint pos,
Window  w,
int  md,
bool  ignoreNonXdndAwareWindows 
)
static

Definition at line 1442 of file qdnd_x11.cpp.

1443 {
1444  if (xdnd_data.deco && w == xdnd_data.deco->effectiveWinId())
1445  return 0;
1446 
1447  if (md) {
1448  X11->ignoreBadwindow();
1449  XWindowAttributes attr;
1450  XGetWindowAttributes(X11->display, w, &attr);
1451  if (X11->badwindow())
1452  return 0;
1453 
1454  if (attr.map_state == IsViewable
1455  && QRect(attr.x,attr.y,attr.width,attr.height).contains(pos)) {
1456  bool windowContainsMouse = !ignoreNonXdndAwareWindows;
1457  {
1458  Atom type = XNone;
1459  int f;
1460  unsigned long n, a;
1461  unsigned char *data;
1462 
1463  XGetWindowProperty(X11->display, w, ATOM(XdndAware), 0, 0, False,
1464  AnyPropertyType, &type, &f,&n,&a,&data);
1465  if (data) XFree(data);
1466  if (type) {
1467 #ifdef QT_NO_SHAPE
1468  return w;
1469 #else // !QT_NO_SHAPE
1470  const QPoint relPos = pos - QPoint(attr.x,attr.y);
1471  // When ShapeInput and ShapeBounding are not set they return a single rectangle with the geometry of the window, this is why we
1472  // need an && here so that in the case one is set and the other is not we still get the correct result.
1473 #if defined(ShapeInput) && defined(ShapeBounding)
1474  windowContainsMouse = windowInteractsWithPosition(relPos, w, ShapeInput) && windowInteractsWithPosition(relPos, w, ShapeBounding);
1475 #elif defined(ShapeBounding)
1476  windowContainsMouse = windowInteractsWithPosition(relPos, w, ShapeBounding);
1477 #else
1478  windowContainsMouse = true;
1479 #endif
1480  if (windowContainsMouse)
1481  return w;
1482 #endif // QT_NO_SHAPE
1483  }
1484  }
1485 
1486  Window r, p;
1487  Window* c;
1488  uint nc;
1489  if (XQueryTree(X11->display, w, &r, &p, &c, &nc)) {
1490  r=0;
1491  for (uint i=nc; !r && i--;) {
1492  r = findRealWindow(pos-QPoint(attr.x,attr.y),
1493  c[i], md-1, ignoreNonXdndAwareWindows);
1494  }
1495  XFree(c);
1496  if (r)
1497  return r;
1498 
1499  // We didn't find a client window! Just use the
1500  // innermost window.
1501  }
1502 
1503  // No children!
1504  if (!windowContainsMouse)
1505  return 0;
1506  else
1507  return w;
1508  }
1509  }
1510  return 0;
1511 }
int type
Definition: qmetatype.cpp:239
unsigned char c[8]
Definition: qnumeric_p.h:62
WId effectiveWinId() const
Returns the effective window system identifier of the widget, i.
Definition: qwidget.cpp:2654
long ASN1_INTEGER_get ASN1_INTEGER * a
#define X11
Definition: qt_x11_p.h:724
static XdndData xdnd_data
Definition: qdnd_x11.cpp:321
static Window findRealWindow(const QPoint &pos, Window w, int md, bool ignoreNonXdndAwareWindows)
Definition: qdnd_x11.cpp:1442
#define ATOM(x)
Definition: qt_x11_p.h:723
static const char * data(const QByteArray &arr)
unsigned int uint
Definition: qglobal.h:996
bool contains(const QPoint &p, bool proper=false) const
Returns true if the given point is inside or on the edge of the rectangle, otherwise returns false...
Definition: qrect.cpp:1101
QShapedPixmapWidget * deco
Definition: qdnd_x11.cpp:317
The QPoint class defines a point in the plane using integer precision.
Definition: qpoint.h:53
The QRect class defines a rectangle in the plane using integer precision.
Definition: qrect.h:58
static bool windowInteractsWithPosition(const QPoint &pos, Window w, int shapeType)
Definition: qdnd_x11.cpp:1427

◆ findXdndAwareParent()

static Window findXdndAwareParent ( Window  window)
static

Definition at line 133 of file qdnd_x11.cpp.

Referenced by QX11Data::xdndHandleSelectionRequest().

134 {
135  Window target = 0;
136  forever {
137  // check if window has XdndAware
138  Atom type = 0;
139  int f;
140  unsigned long n, a;
141  unsigned char *data = 0;
142  if (XGetWindowProperty(X11->display, window, ATOM(XdndAware), 0, 0, False,
143  AnyPropertyType, &type, &f,&n,&a,&data) == Success) {
144  if (data)
145  XFree(data);
146  if (type) {
147  target = window;
148  break;
149  }
150  }
151 
152  // try window's parent
153  Window root;
154  Window parent;
155  Window *children;
156  uint unused;
157  if (!XQueryTree(X11->display, window, &root, &parent, &children, &unused))
158  break;
159  if (children)
160  XFree(children);
161  if (window == root)
162  break;
163  window = parent;
164  }
165  return target;
166 }
int type
Definition: qmetatype.cpp:239
long ASN1_INTEGER_get ASN1_INTEGER * a
#define X11
Definition: qt_x11_p.h:724
#define ATOM(x)
Definition: qt_x11_p.h:723
NSWindow * window
static const char * data(const QByteArray &arr)
unsigned int uint
Definition: qglobal.h:996
#define forever
This macro is provided for convenience for writing infinite loops.
Definition: qglobal.h:2452

◆ findXdndDropTransactionByTime()

static int findXdndDropTransactionByTime ( Time  timestamp)
static

Definition at line 107 of file qdnd_x11.cpp.

Referenced by QX11Data::xdndHandleDrop(), and QX11Data::xdndHandleSelectionRequest().

108 {
109  int at = -1;
110  for (int i = 0; i < X11->dndDropTransactions.count(); ++i) {
111  const QXdndDropTransaction &t = X11->dndDropTransactions.at(i);
112  if (t.timestamp == timestamp) {
113  at = i;
114  break;
115  }
116  }
117  return at;
118 }
#define at(className, varName)
#define X11
Definition: qt_x11_p.h:724

◆ findXdndDropTransactionByWindow()

static int findXdndDropTransactionByWindow ( Window  window)
static

Definition at line 94 of file qdnd_x11.cpp.

Referenced by QX11Data::xdndHandleFinished(), and QX11Data::xdndHandleSelectionRequest().

95 {
96  int at = -1;
97  for (int i = 0; i < X11->dndDropTransactions.count(); ++i) {
98  const QXdndDropTransaction &t = X11->dndDropTransactions.at(i);
99  if (t.target == window || t.proxy_target == window) {
100  at = i;
101  break;
102  }
103  }
104  return at;
105 }
#define at(className, varName)
#define X11
Definition: qt_x11_p.h:724
NSWindow * window

◆ handle_xdnd_position()

static void handle_xdnd_position ( QWidget w,
const XEvent xe,
bool  passive 
)
static

Definition at line 842 of file qdnd_x11.cpp.

Referenced by findRealWindow(), findXdndAwareParent(), and QX11Data::xdndHandlePosition().

843 {
844  const unsigned long *l = (const unsigned long *)xe->xclient.data.l;
845 
846  QPoint p((l[2] & 0xffff0000) >> 16, l[2] & 0x0000ffff);
847  QWidget * c = find_child(w, p); // changes p to to c-local coordinates
848 
849  if (!passive && checkEmbedded(c, xe))
850  return;
851 
852  if (!c || (!c->acceptDrops() && (c->windowType() == Qt::Desktop)))
853  return;
854 
855  if (l[0] != qt_xdnd_dragsource_xid) {
856  DEBUG("xdnd drag position from unexpected source (%08lx not %08lx)", l[0], qt_xdnd_dragsource_xid);
857  return;
858  }
859 
860  // timestamp from the source
861  if (l[3] != 0) {
862  // Some X server/client combination swallow the first 32 bit and
863  // interpret a set bit 31 as negative sign.
864  qt_xdnd_target_current_time = X11->userTime =
865  ((sizeof(Time) == 8 && xe->xclient.data.l[3] < 0)
866  ? uint(l[3])
867  : l[3]);
868  }
869 
870  QDragManager *manager = QDragManager::self();
871  QMimeData *dropData = manager->object ? manager->dragPrivate()->data : manager->dropData;
872 
873  XClientMessageEvent response;
874  response.type = ClientMessage;
875  response.window = qt_xdnd_dragsource_xid;
876  response.format = 32;
877  response.message_type = ATOM(XdndStatus);
878  response.data.l[0] = w->effectiveWinId();
879  response.data.l[1] = 0; // flags
880  response.data.l[2] = 0; // x, y
881  response.data.l[3] = 0; // w, h
882  response.data.l[4] = 0; // action
883 
884  if (!passive) { // otherwise just reject
885  while (c && !c->acceptDrops() && !c->isWindow()) {
886  p = c->mapToParent(p);
887  c = c->parentWidget();
888  }
889  QWidget *target_widget = c && c->acceptDrops() ? c : 0;
890 
891  QRect answerRect(c->mapToGlobal(p), QSize(1,1));
892 
893  if (manager->object) {
895  } else {
896  possible_actions = Qt::DropActions(xdndaction_to_qtaction(l[4]));
897 // possible_actions |= Qt::CopyAction;
898  }
900 
901  Qt::DropAction accepted_action = Qt::IgnoreAction;
902 
903 
904  if (target_widget != qt_xdnd_current_widget) {
906  QDragLeaveEvent e;
908  }
909  if (qt_xdnd_current_widget != target_widget) {
910  qt_xdnd_current_widget = target_widget;
911  }
912  if (target_widget) {
914 
917  QApplication::sendEvent(target_widget, &de);
918  if (de.isAccepted() && de.dropAction() != Qt::IgnoreAction)
919  last_target_accepted_action = de.dropAction();
920  }
921  }
922 
923  DEBUG() << "qt_handle_xdnd_position action=" << X11->xdndAtomToString(l[4]);
924  if (!target_widget) {
925  answerRect = QRect(p, QSize(1, 1));
926  } else {
929 
931  me.setDropAction(last_target_accepted_action);
932  me.accept();
933  }
934  QApplication::sendEvent(c, &me);
935  if (me.isAccepted()) {
936  response.data.l[1] = 1; // yes
937  accepted_action = me.dropAction();
938  last_target_accepted_action = accepted_action;
939  } else {
940  response.data.l[0] = 0;
942  }
943  answerRect = me.answerRect().intersected(c->rect());
944  }
945  answerRect = QRect(c->mapToGlobal(answerRect.topLeft()), answerRect.size());
946 
947  if (answerRect.left() < 0)
948  answerRect.setLeft(0);
949  if (answerRect.right() > 4096)
950  answerRect.setRight(4096);
951  if (answerRect.top() < 0)
952  answerRect.setTop(0);
953  if (answerRect.bottom() > 4096)
954  answerRect.setBottom(4096);
955  if (answerRect.width() < 0)
956  answerRect.setWidth(0);
957  if (answerRect.height() < 0)
958  answerRect.setHeight(0);
959 
960  response.data.l[2] = (answerRect.x() << 16) + answerRect.y();
961  response.data.l[3] = (answerRect.width() << 16) + answerRect.height();
962  response.data.l[4] = qtaction_to_xdndaction(accepted_action);
963  }
964 
965  // reset
966  qt_xdnd_target_current_time = CurrentTime;
967 
969  if (source && (source->windowType() == Qt::Desktop) && !source->acceptDrops())
970  source = 0;
971 
972  DEBUG() << "sending XdndStatus";
973  if (source)
974  handle_xdnd_status(source, (const XEvent *)&response, passive);
975  else
976  XSendEvent(X11->display, qt_xdnd_dragsource_xid, False, NoEventMask, (XEvent*)&response);
977 }
QWidget * parentWidget() const
Returns the parent of this widget, or 0 if it does not have any parent widget.
Definition: qwidget.h:1035
Qt::DropActions possible_actions
Definition: qdnd_p.h:182
static int qtaction_to_xdndaction(Qt::DropAction a)
Definition: qdnd_x11.cpp:189
unsigned char c[8]
Definition: qnumeric_p.h:62
static Time qt_xdnd_target_current_time
Definition: qdnd_x11.cpp:233
static QPoint qt_xdnd_current_position
Definition: qdnd_x11.cpp:231
bool isWindow() const
Returns true if the widget is an independent window, otherwise returns false.
Definition: qwidget.h:945
WId effectiveWinId() const
Returns the effective window system identifier of the widget, i.
Definition: qwidget.cpp:2654
QDrag * object
Definition: qdnd_p.h:238
static QWidget * find_child(QWidget *tlw, QPoint &p)
Definition: qdnd_x11.cpp:732
static Qt::DropAction xdndaction_to_qtaction(Atom atom)
Definition: qdnd_x11.cpp:178
The QWidget class is the base class of all user interface objects.
Definition: qwidget.h:150
The QDragMoveEvent class provides an event which is sent while a drag and drop action is in progress...
Definition: qevent.h:530
#define X11
Definition: qt_x11_p.h:724
union _XEvent XEvent
Definition: qwindowdefs.h:116
#define ATOM(x)
Definition: qt_x11_p.h:723
static Qt::DropAction last_target_accepted_action
Definition: qdnd_x11.cpp:242
static QWidget * find(WId)
Returns a pointer to the widget with window identifer/handle id.
Definition: qwidget.cpp:2517
unsigned int uint
Definition: qglobal.h:996
static void handle_xdnd_status(QWidget *w, const XEvent *xe, bool)
Definition: qdnd_x11.cpp:1001
static bool sendEvent(QObject *receiver, QEvent *event)
Sends event event directly to receiver receiver, using the notify() function.
The QDragLeaveEvent class provides an event that is sent to a widget when a drag and drop action leav...
Definition: qevent.h:577
DropAction
Definition: qnamespace.h:1597
static bool checkEmbedded(QWidget *w, const XEvent *xe)
Definition: qdnd_x11.cpp:767
The QMimeData class provides a container for data that records information about its MIME type...
Definition: qmimedata.h:57
static Atom qt_xdnd_dragsource_xid
Definition: qdnd_x11.cpp:213
bool acceptDrops
whether drop events are enabled for this widget
Definition: qwidget.h:197
static Qt::DropActions possible_actions
Definition: qdnd_x11.cpp:246
static QDragManager * self()
Definition: qdnd.cpp:163
static QPointer< QWidget > qt_xdnd_current_widget
Definition: qdnd_x11.cpp:230
static Qt::KeyboardModifiers keyboardModifiers()
Returns the current state of the modifier keys on the keyboard.
void setLeft(int pos)
Sets the left edge of the rectangle to the given x coordinate.
Definition: qrect.h:258
QRect rect
the internal geometry of the widget excluding any window frame
Definition: qwidget.h:168
QMimeData * data
Definition: qdnd_p.h:179
QDropData * dropData
Definition: qdnd_p.h:251
The QDragEnterEvent class provides an event which is sent to a widget when a drag and drop action ent...
Definition: qevent.h:555
The QPoint class defines a point in the plane using integer precision.
Definition: qpoint.h:53
QPoint mapToParent(const QPoint &) const
Translates the widget coordinate pos to a coordinate in the parent widget.
Definition: qwidget.cpp:4459
The QRect class defines a rectangle in the plane using integer precision.
Definition: qrect.h:58
QFactoryLoader * l
The QSize class defines the size of a two-dimensional object using integer point precision.
Definition: qsize.h:53
Qt::WindowType windowType() const
Returns the window type of this widget.
Definition: qwidget.h:937
static Qt::MouseButtons mouseButtons()
Returns the current state of the buttons on the mouse.
#define DEBUG
Definition: qdnd_x11.cpp:85
QDragPrivate * dragPrivate() const
Definition: qdnd_p.h:231
QPoint mapToGlobal(const QPoint &) const
Translates the widget coordinate pos to global screen coordinates.

◆ handle_xdnd_status()

static void handle_xdnd_status ( QWidget w,
const XEvent xe,
bool   
)
static

Definition at line 1001 of file qdnd_x11.cpp.

Referenced by findXdndAwareParent(), handle_xdnd_position(), and QX11Data::xdndHandleStatus().

1002 {
1003  const unsigned long *l = (const unsigned long *)xe->xclient.data.l;
1004  // ignore late status messages
1005  if (l[0] && l[0] != qt_xdnd_current_proxy_target)
1006  return;
1007  Qt::DropAction newAction = (l[1] & 0x1) ? xdndaction_to_qtaction(l[4]) : Qt::IgnoreAction;
1008 
1009  if ((int)(l[1] & 2) == 0) {
1010  QPoint p((l[2] & 0xffff0000) >> 16, l[2] & 0x0000ffff);
1011  QSize s((l[3] & 0xffff0000) >> 16, l[3] & 0x0000ffff);
1013  } else {
1015  }
1016  QDragManager *manager = QDragManager::self();
1017  manager->willDrop = (l[1] & 0x1);
1018  if (global_accepted_action != newAction)
1019  manager->emitActionChanged(newAction);
1020  global_accepted_action = newAction;
1021  manager->updateCursor();
1022  waiting_for_status = false;
1023 }
void updateCursor()
Definition: qdnd_mac.mm:268
static Qt::DropAction xdndaction_to_qtaction(Atom atom)
Definition: qdnd_x11.cpp:178
void emitActionChanged(Qt::DropAction newAction)
Definition: qdnd_p.h:253
static Window qt_xdnd_current_proxy_target
Definition: qdnd_x11.cpp:226
static QRect qt_xdnd_source_sameanswer
Definition: qdnd_x11.cpp:222
DropAction
Definition: qnamespace.h:1597
static Qt::DropAction global_accepted_action
Definition: qdnd_x11.cpp:245
bool willDrop
Definition: qdnd_p.h:244
static QDragManager * self()
Definition: qdnd.cpp:163
static bool waiting_for_status
Definition: qdnd_x11.cpp:239
The QPoint class defines a point in the plane using integer precision.
Definition: qpoint.h:53
if(void) toggleToolbarShown
The QRect class defines a rectangle in the plane using integer precision.
Definition: qrect.h:58
QFactoryLoader * l
The QSize class defines the size of a two-dimensional object using integer point precision.
Definition: qsize.h:53

◆ qt_xdnd_cleanup()

void qt_xdnd_cleanup ( )
static

Definition at line 713 of file qdnd_x11.cpp.

Referenced by qtaction_to_xdndaction(), and QX11Data::xdndSetup().

714 {
715  delete noDropCursor;
716  noDropCursor = 0;
717  delete copyCursor;
718  copyCursor = 0;
719  delete moveCursor;
720  moveCursor = 0;
721  delete linkCursor;
722  linkCursor = 0;
723  delete defaultPm;
724  defaultPm = 0;
725  delete xdnd_data.desktop_proxy;
727  delete xdnd_data.deco;
728  xdnd_data.deco = 0;
729 }
QWidget * desktop_proxy
Definition: qdnd_x11.cpp:318
static QCursor * copyCursor
Definition: qdnd_x11.cpp:255
static QPixmap * defaultPm
Definition: qdnd_x11.cpp:258
static QCursor * noDropCursor
Definition: qdnd_x11.cpp:253
static XdndData xdnd_data
Definition: qdnd_x11.cpp:321
static QCursor * moveCursor
Definition: qdnd_x11.cpp:254
static QCursor * linkCursor
Definition: qdnd_x11.cpp:256
QShapedPixmapWidget * deco
Definition: qdnd_x11.cpp:317

◆ qt_xdnd_send_leave()

void qt_xdnd_send_leave ( )
static

Definition at line 1079 of file qdnd_x11.cpp.

Referenced by checkEmbedded(), findRealWindow(), and qtaction_to_xdndaction().

1080 {
1082  return;
1083 
1084  QDragManager *manager = QDragManager::self();
1085 
1086  XClientMessageEvent leave;
1087  leave.type = ClientMessage;
1088  leave.window = qt_xdnd_current_target;
1089  leave.format = 32;
1090  leave.message_type = ATOM(XdndLeave);
1091  leave.data.l[0] = manager->dragPrivate()->source->effectiveWinId();
1092  leave.data.l[1] = 0; // flags
1093  leave.data.l[2] = 0; // x, y
1094  leave.data.l[3] = 0; // w, h
1095  leave.data.l[4] = 0; // just null
1096 
1098 
1099  if (w && (w->windowType() == Qt::Desktop) && !w->acceptDrops())
1100  w = 0;
1101 
1102  if (w)
1103  X11->xdndHandleLeave(w, (const XEvent *)&leave, false);
1104  else
1105  XSendEvent(X11->display, qt_xdnd_current_proxy_target, False,
1106  NoEventMask, (XEvent*)&leave);
1107 
1108  // reset the drag manager state
1109  manager->willDrop = false;
1113  manager->updateCursor();
1117  waiting_for_status = false;
1118 }
void updateCursor()
Definition: qdnd_mac.mm:268
WId effectiveWinId() const
Returns the effective window system identifier of the widget, i.
Definition: qwidget.cpp:2654
The QWidget class is the base class of all user interface objects.
Definition: qwidget.h:150
void emitActionChanged(Qt::DropAction newAction)
Definition: qdnd_p.h:253
static Window qt_xdnd_current_proxy_target
Definition: qdnd_x11.cpp:226
#define X11
Definition: qt_x11_p.h:724
union _XEvent XEvent
Definition: qwindowdefs.h:116
#define ATOM(x)
Definition: qt_x11_p.h:723
static QWidget * find(WId)
Returns a pointer to the widget with window identifer/handle id.
Definition: qwidget.cpp:2517
static Window qt_xdnd_current_target
Definition: qdnd_x11.cpp:224
QWidget * source
Definition: qdnd_p.h:177
static Qt::DropAction global_accepted_action
Definition: qdnd_x11.cpp:245
bool acceptDrops
whether drop events are enabled for this widget
Definition: qwidget.h:197
bool willDrop
Definition: qdnd_p.h:244
static QDragManager * self()
Definition: qdnd.cpp:163
static bool waiting_for_status
Definition: qdnd_x11.cpp:239
static Time qt_xdnd_source_current_time
Definition: qdnd_x11.cpp:227
Qt::WindowType windowType() const
Returns the window type of this widget.
Definition: qwidget.h:937
QDragPrivate * dragPrivate() const
Definition: qdnd_p.h:231

◆ qtaction_to_xdndaction()

static int qtaction_to_xdndaction ( Qt::DropAction  a)
static

Definition at line 189 of file qdnd_x11.cpp.

Referenced by findRealWindow(), handle_xdnd_position(), and QX11Data::xdndHandleDrop().

190 {
191  switch (a) {
192  case Qt::CopyAction:
193  return ATOM(XdndActionCopy);
194  case Qt::LinkAction:
195  return ATOM(XdndActionLink);
196  case Qt::MoveAction:
198  return ATOM(XdndActionMove);
199  case Qt::IgnoreAction:
200  return XNone;
201  default:
202  return ATOM(XdndActionCopy);
203  }
204 }
long ASN1_INTEGER_get ASN1_INTEGER * a
#define ATOM(x)
Definition: qt_x11_p.h:723

◆ restartXdndDropExpiryTimer()

static void restartXdndDropExpiryTimer ( )
static

Definition at line 124 of file qdnd_x11.cpp.

Referenced by findRealWindow(), QX11Data::xdndHandleFinished(), and QX11Data::xdndHandleSelectionRequest().

125 {
126  if (transaction_expiry_timer != -1)
129 }
int startTimer(int interval)
Starts a timer and returns a timer identifier, or returns zero if it could not start a timer...
Definition: qobject.cpp:1623
static int transaction_expiry_timer
Definition: qdnd_x11.cpp:121
static QDragManager * self()
Definition: qdnd.cpp:163
void killTimer(int id)
Kills the timer with timer identifier, id.
Definition: qobject.cpp:1650

◆ windowInteractsWithPosition()

static bool windowInteractsWithPosition ( const QPoint pos,
Window  w,
int  shapeType 
)
static

Definition at line 1427 of file qdnd_x11.cpp.

Referenced by findRealWindow().

1428 {
1429  int nrectanglesRet, dummyOrdering;
1430  XRectangle *rectangles = XShapeGetRectangles(QX11Info::display(), w, shapeType, &nrectanglesRet, &dummyOrdering);
1431  bool interacts = false;
1432  if (rectangles) {
1433  for (int i = 0; !interacts && i < nrectanglesRet; ++i)
1434  interacts = QRect(rectangles[i].x, rectangles[i].y, rectangles[i].width, rectangles[i].height).contains(pos);
1435  XFree(rectangles);
1436  }
1437  return interacts;
1438 }
bool contains(const QPoint &p, bool proper=false) const
Returns true if the given point is inside or on the edge of the rectangle, otherwise returns false...
Definition: qrect.cpp:1101
The QRect class defines a rectangle in the plane using integer precision.
Definition: qrect.h:58
static Display * display()
Returns the default display for the application.

◆ xdnd_position_scanner()

static Bool xdnd_position_scanner ( Display ,
XEvent event,
XPointer   
)
static

Definition at line 979 of file qdnd_x11.cpp.

Referenced by QX11Data::xdndHandlePosition().

980 {
981  if (event->type != ClientMessage)
982  return false;
983  XClientMessageEvent *ev = &event->xclient;
984 
985  if (ev->message_type == ATOM(XdndPosition))
986  return true;
987 
988  return false;
989 }
EventRef event
#define ATOM(x)
Definition: qt_x11_p.h:723

◆ xdnd_status_scanner()

static Bool xdnd_status_scanner ( Display ,
XEvent event,
XPointer   
)
static

Definition at line 1025 of file qdnd_x11.cpp.

Referenced by QX11Data::xdndHandleStatus().

1026 {
1027  if (event->type != ClientMessage)
1028  return false;
1029  XClientMessageEvent *ev = &event->xclient;
1030 
1031  if (ev->message_type == ATOM(XdndStatus))
1032  return true;
1033 
1034  return false;
1035 }
EventRef event
#define ATOM(x)
Definition: qt_x11_p.h:723

◆ xdndaction_to_qtaction()

static Qt::DropAction xdndaction_to_qtaction ( Atom  atom)
static

Definition at line 178 of file qdnd_x11.cpp.

Referenced by handle_xdnd_position(), and handle_xdnd_status().

179 {
180  if (atom == ATOM(XdndActionCopy) || atom == 0)
181  return Qt::CopyAction;
182  if (atom == ATOM(XdndActionLink))
183  return Qt::LinkAction;
184  if (atom == ATOM(XdndActionMove))
185  return Qt::MoveAction;
186  return Qt::CopyAction;
187 }
#define ATOM(x)
Definition: qt_x11_p.h:723

◆ xdndEnable()

static bool xdndEnable ( QWidget w,
bool  on 
)
static

Definition at line 363 of file qdnd_x11.cpp.

Referenced by QX11Data::dndEnable().

364 {
365  DNDDEBUG << "xdndEnable" << w << on;
366  if (on) {
367  QWidget * xdnd_widget = 0;
368  if ((w->windowType() == Qt::Desktop)) {
369  if (xdnd_data.desktop_proxy) // *WE* already have one.
370  return false;
371 
372  // As per Xdnd4, use XdndProxy
373  XGrabServer(X11->display);
375  WId proxy_id = xdndProxy(w->effectiveWinId());
376 
377  if (!proxy_id) {
378  xdnd_widget = xdnd_data.desktop_proxy = new QWidget;
379  proxy_id = xdnd_data.desktop_proxy->effectiveWinId();
380  XChangeProperty (X11->display, w->effectiveWinId(), ATOM(XdndProxy),
381  XA_WINDOW, 32, PropModeReplace, (unsigned char *)&proxy_id, 1);
382  XChangeProperty (X11->display, proxy_id, ATOM(XdndProxy),
383  XA_WINDOW, 32, PropModeReplace, (unsigned char *)&proxy_id, 1);
384  }
385 
386  XUngrabServer(X11->display);
387  } else {
388  xdnd_widget = w->window();
389  }
390  if (xdnd_widget) {
391  DNDDEBUG << "setting XdndAware for" << xdnd_widget << xdnd_widget->effectiveWinId();
392  Atom atm = (Atom)xdnd_version;
394  XChangeProperty(X11->display, xdnd_widget->effectiveWinId(), ATOM(XdndAware),
395  XA_ATOM, 32, PropModeReplace, (unsigned char *)&atm, 1);
396  return true;
397  } else {
398  return false;
399  }
400  } else {
401  if ((w->windowType() == Qt::Desktop)) {
402  XDeleteProperty(X11->display, w->internalWinId(), ATOM(XdndProxy));
403  delete xdnd_data.desktop_proxy;
405  } else {
406  DNDDEBUG << "not deleting XDndAware";
407  }
408  return true;
409  }
410 }
unsigned long WId
Definition: qwindowdefs.h:119
QWidget * desktop_proxy
Definition: qdnd_x11.cpp:318
WId effectiveWinId() const
Returns the effective window system identifier of the widget, i.
Definition: qwidget.cpp:2654
The QWidget class is the base class of all user interface objects.
Definition: qwidget.h:150
#define Q_ASSERT(cond)
Definition: qglobal.h:1823
#define X11
Definition: qt_x11_p.h:724
static XdndData xdnd_data
Definition: qdnd_x11.cpp:321
#define ATOM(x)
Definition: qt_x11_p.h:723
bool testAttribute(Qt::WidgetAttribute) const
Returns true if attribute attribute is set on this widget; otherwise returns false.
Definition: qwidget.h:1041
static WId xdndProxy(WId w)
Definition: qdnd_x11.cpp:335
#define DNDDEBUG
Definition: qdnd_x11.cpp:91
const int xdnd_version
Definition: qdnd_x11.cpp:176
WId internalWinId() const
Returns the window system identifier of the widget, or 0 if the widget is not created yet...
Definition: qwidget.h:244
QWidget * window() const
Returns the window for this widget, i.e.
Definition: qwidget.cpp:4492
Qt::WindowType windowType() const
Returns the window type of this widget.
Definition: qwidget.h:937

◆ xdndObtainData()

static QVariant xdndObtainData ( const char *  format,
QVariant::Type  requestedType 
)
static

Definition at line 1883 of file qdnd_x11.cpp.

1884 {
1885  QByteArray result;
1886 
1887  QWidget* w;
1888  QDragManager *manager = QDragManager::self();
1889  if (qt_xdnd_dragsource_xid && manager->object &&
1891  && (!(w->windowType() == Qt::Desktop) || w->acceptDrops()))
1892  {
1894  const QString mimeType = QString::fromLatin1(format);
1895  if (o->data->hasFormat(mimeType)) {
1896  result = o->data->data(mimeType);
1897  } else if (mimeType.startsWith(QLatin1String("image/")) && o->data->hasImage()) {
1898  // ### duplicated from QInternalMimeData::renderDataHelper
1899  QImage image = qvariant_cast<QImage>(o->data->imageData());
1900  QBuffer buf(&result);
1901  buf.open(QBuffer::WriteOnly);
1902  image.save(&buf, mimeType.mid(mimeType.indexOf(QLatin1Char('/')) + 1).toLatin1().toUpper());
1903  }
1904  return result;
1905  }
1906 
1907  QList<Atom> atoms;
1908  int i = 0;
1909  while ((qt_xdnd_types[i])) {
1910  atoms.append(qt_xdnd_types[i]);
1911  ++i;
1912  }
1913  QByteArray encoding;
1914  Atom a = X11->xdndMimeAtomForFormat(QLatin1String(format), requestedType, atoms, &encoding);
1915  if (!a)
1916  return result;
1917 
1918  if (XGetSelectionOwner(X11->display, ATOM(XdndSelection)) == XNone)
1919  return result; // should never happen?
1920 
1923  tw = new QWidget;
1924 
1925  XConvertSelection(X11->display, ATOM(XdndSelection), a, ATOM(XdndSelection), tw->effectiveWinId(),
1927  XFlush(X11->display);
1928 
1929  XEvent xevent;
1930  bool got=X11->clipboardWaitForEvent(tw->effectiveWinId(), SelectionNotify, &xevent, 5000);
1931  if (got) {
1932  Atom type;
1933 
1934  if (X11->clipboardReadProperty(tw->effectiveWinId(), ATOM(XdndSelection), true, &result, 0, &type, 0)) {
1935  if (type == ATOM(INCR)) {
1936  int nbytes = result.size() >= 4 ? *((int*)result.data()) : 0;
1937  result = X11->clipboardReadIncrementalProperty(tw->effectiveWinId(), ATOM(XdndSelection), nbytes, false);
1938  } else if (type != a && type != XNone) {
1939  DEBUG("Qt clipboard: unknown atom %ld", type);
1940  }
1941  }
1942  }
1944  delete tw;
1945 
1946  return X11->xdndMimeConvertToFormat(a, result, QLatin1String(format), requestedType, encoding);
1947 }
int type
Definition: qmetatype.cpp:239
char * data()
Returns a pointer to the data stored in the byte array.
Definition: qbytearray.h:429
static Time qt_xdnd_target_current_time
Definition: qdnd_x11.cpp:233
WId effectiveWinId() const
Returns the effective window system identifier of the widget, i.
Definition: qwidget.cpp:2654
QDrag * object
Definition: qdnd_p.h:238
The QByteArray class provides an array of bytes.
Definition: qbytearray.h:135
static Atom qt_xdnd_types[qt_xdnd_max_type+1]
Definition: qdnd_x11.cpp:217
QString toUpper() const Q_REQUIRED_RESULT
Returns an uppercase copy of the string.
Definition: qstring.cpp:5483
The QWidget class is the base class of all user interface objects.
Definition: qwidget.h:150
bool save(const QString &fileName, const char *format=0, int quality=-1) const
Saves the image to the file with the given fileName, using the given image file format and quality fa...
Definition: qimage.cpp:5346
bool startsWith(const QString &s, Qt::CaseSensitivity cs=Qt::CaseSensitive) const
Returns true if the string starts with s; otherwise returns false.
Definition: qstring.cpp:3734
QLatin1String(DBUS_INTERFACE_DBUS))) Q_GLOBAL_STATIC_WITH_ARGS(QString
long ASN1_INTEGER_get ASN1_INTEGER * a
QByteArray data(const QString &mimetype) const
Returns the data stored in the object in the format described by the MIME type specified by mimeType...
Definition: qmimedata.cpp:524
The QBuffer class provides a QIODevice interface for a QByteArray.
Definition: qbuffer.h:57
The QString class provides a Unicode character string.
Definition: qstring.h:83
#define X11
Definition: qt_x11_p.h:724
union _XEvent XEvent
Definition: qwindowdefs.h:116
#define ATOM(x)
Definition: qt_x11_p.h:723
void append(const T &t)
Inserts value at the end of the list.
Definition: qlist.h:507
static QWidget * find(WId)
Returns a pointer to the widget with window identifer/handle id.
Definition: qwidget.cpp:2517
The QImage class provides a hardware-independent image representation that allows direct access to th...
Definition: qimage.h:87
int indexOf(QChar c, int from=0, Qt::CaseSensitivity cs=Qt::CaseSensitive) const
Definition: qstring.cpp:2838
The QLatin1String class provides a thin wrapper around an US-ASCII/Latin-1 encoded string literal...
Definition: qstring.h:654
static Atom qt_xdnd_dragsource_xid
Definition: qdnd_x11.cpp:213
bool acceptDrops
whether drop events are enabled for this widget
Definition: qwidget.h:197
static QDragManager * self()
Definition: qdnd.cpp:163
QVariant imageData() const
Returns a QVariant storing a QImage if the object can return an image; otherwise returns a null varia...
Definition: qmimedata.cpp:442
bool hasImage() const
Returns true if the object can return an image; otherwise returns false.
Definition: qmimedata.cpp:471
QString mid(int position, int n=-1) const Q_REQUIRED_RESULT
Returns a string that contains n characters of this string, starting at the specified position index...
Definition: qstring.cpp:3706
virtual bool hasFormat(const QString &mimetype) const
Returns true if the object can return data for the MIME type specified by mimeType; otherwise returns...
Definition: qmimedata.cpp:563
static QPointer< QWidget > qt_xdnd_current_widget
Definition: qdnd_x11.cpp:230
QMimeData * data
Definition: qdnd_p.h:179
static QString fromLatin1(const char *, int size=-1)
Returns a QString initialized with the first size characters of the Latin-1 string str...
Definition: qstring.cpp:4188
int size() const
Returns the number of bytes in this byte array.
Definition: qbytearray.h:402
Qt::WindowType windowType() const
Returns the window type of this widget.
Definition: qwidget.h:937
#define DEBUG
Definition: qdnd_x11.cpp:85
QDragPrivate * dragPrivate() const
Definition: qdnd_p.h:231
The QLatin1Char class provides an 8-bit ASCII/Latin-1 character.
Definition: qchar.h:55
The QList class is a template class that provides lists.
Definition: qdatastream.h:62
T qvariant_cast(const QVariant &value)
Returns the given value converted to the template type T.
Definition: qvariant.h:571

◆ xdndProxy()

static WId xdndProxy ( WId  w)
static

Definition at line 335 of file qdnd_x11.cpp.

Referenced by findRealWindow(), and xdndEnable().

336 {
337  Atom type = XNone;
338  int f;
339  unsigned long n, a;
340  unsigned char *retval = 0;
341  XGetWindowProperty(X11->display, w, ATOM(XdndProxy), 0, 1, False,
342  XA_WINDOW, &type, &f,&n,&a,&retval);
343  WId *proxy_id_ptr = (WId *)retval;
344  WId proxy_id = 0;
345  if (type == XA_WINDOW && proxy_id_ptr) {
346  proxy_id = *proxy_id_ptr;
347  XFree(proxy_id_ptr);
348  proxy_id_ptr = 0;
349  // Already exists. Real?
350  X11->ignoreBadwindow();
351  XGetWindowProperty(X11->display, proxy_id, ATOM(XdndProxy), 0, 1, False,
352  XA_WINDOW, &type, &f,&n,&a,&retval);
353  proxy_id_ptr = (WId *)retval;
354  if (X11->badwindow() || type != XA_WINDOW || !proxy_id_ptr || *proxy_id_ptr != proxy_id)
355  // Bogus - we will overwrite.
356  proxy_id = 0;
357  }
358  if (proxy_id_ptr)
359  XFree(proxy_id_ptr);
360  return proxy_id;
361 }
unsigned long WId
Definition: qwindowdefs.h:119
int type
Definition: qmetatype.cpp:239
long ASN1_INTEGER_get ASN1_INTEGER * a
#define X11
Definition: qt_x11_p.h:724
#define ATOM(x)
Definition: qt_x11_p.h:723

Variable Documentation

◆ copyCursor

QCursor* copyCursor = 0
static

Definition at line 255 of file qdnd_x11.cpp.

Referenced by qt_xdnd_cleanup().

◆ current_embedding_widget

QWidget* current_embedding_widget = 0
static

Definition at line 249 of file qdnd_x11.cpp.

Referenced by findRealWindow(), and QX11Data::xdndHandleFinished().

◆ default_pm

const char* const default_pm[]
static
Initial value:
= {
"13 9 3 1",
". c None",
" c #000000",
"X c #FFFFFF",
"X X X X X X X",
" X X X X X X ",
"X ......... X",
" X.........X ",
"X ......... X",
" X.........X ",
"X ......... X",
" X X X X X X ",
"X X X X X X X"
}

Definition at line 262 of file qdnd_x11.cpp.

◆ default_pm_hotx

const int default_pm_hotx = -2
static

Definition at line 260 of file qdnd_x11.cpp.

◆ default_pm_hoty

const int default_pm_hoty = -16
static

Definition at line 261 of file qdnd_x11.cpp.

◆ defaultPm

QPixmap* defaultPm = 0
static

Definition at line 258 of file qdnd_x11.cpp.

Referenced by qt_xdnd_cleanup().

◆ global_accepted_action

Qt::DropAction global_accepted_action = Qt::CopyAction
static

◆ heartbeat

int heartbeat = -1
static

Definition at line 220 of file qdnd_x11.cpp.

Referenced by QX11Data::dndEnable(), and findRealWindow().

◆ last_enter_event

XEvent last_enter_event
static

Definition at line 250 of file qdnd_x11.cpp.

Referenced by checkEmbedded(), and QX11Data::xdndHandleEnter().

◆ last_target_accepted_action

Qt::DropAction last_target_accepted_action = Qt::IgnoreAction
static

Definition at line 242 of file qdnd_x11.cpp.

Referenced by handle_xdnd_position().

◆ linkCursor

QCursor* linkCursor = 0
static

Definition at line 256 of file qdnd_x11.cpp.

Referenced by qt_xdnd_cleanup().

◆ moveCursor

QCursor* moveCursor = 0
static

◆ noDropCursor

QCursor* noDropCursor = 0
static

Definition at line 253 of file qdnd_x11.cpp.

Referenced by qt_xdnd_cleanup().

◆ possible_actions

Qt::DropActions possible_actions = Qt::IgnoreAction
static

Definition at line 246 of file qdnd_x11.cpp.

Referenced by findRealWindow(), handle_xdnd_position(), and QX11Data::xdndHandleDrop().

◆ qt_xdnd_current_position

QPoint qt_xdnd_current_position
static

Definition at line 231 of file qdnd_x11.cpp.

◆ qt_xdnd_current_proxy_target

Window qt_xdnd_current_proxy_target
static

◆ qt_xdnd_current_screen

int qt_xdnd_current_screen = -1
static

Definition at line 235 of file qdnd_x11.cpp.

Referenced by findRealWindow().

◆ qt_xdnd_current_target

Window qt_xdnd_current_target
static

◆ qt_xdnd_current_widget

QPointer<QWidget> qt_xdnd_current_widget
static

Definition at line 230 of file qdnd_x11.cpp.

Referenced by xdndObtainData().

◆ qt_xdnd_dragging

bool qt_xdnd_dragging = false

◆ qt_xdnd_dragsource_xid

Atom qt_xdnd_dragsource_xid = 0
static

◆ qt_xdnd_max_type

const int qt_xdnd_max_type = 100

Definition at line 216 of file qdnd_x11.cpp.

Referenced by QX11Data::xdndHandleEnter().

◆ qt_xdnd_source_current_time

Time qt_xdnd_source_current_time
static

◆ qt_xdnd_source_sameanswer

QRect qt_xdnd_source_sameanswer
static

Definition at line 222 of file qdnd_x11.cpp.

◆ qt_xdnd_target_current_time

Time qt_xdnd_target_current_time
static

Definition at line 233 of file qdnd_x11.cpp.

Referenced by handle_xdnd_position(), QX11Data::xdndHandleDrop(), and xdndObtainData().

◆ qt_xdnd_types

Atom qt_xdnd_types[qt_xdnd_max_type+1]
static

◆ transaction_expiry_timer

int transaction_expiry_timer = -1
static

Definition at line 121 of file qdnd_x11.cpp.

Referenced by restartXdndDropExpiryTimer().

◆ waiting_for_status

bool waiting_for_status = false
static

◆ xdnd_data

XdndData xdnd_data = { 0, 0 }
static

Definition at line 321 of file qdnd_x11.cpp.

◆ xdnd_version

const int xdnd_version = 5

Definition at line 176 of file qdnd_x11.cpp.

Referenced by findRealWindow(), xdndEnable(), and QX11Data::xdndHandleEnter().