14#include <private/qdnd_p.h>
22#include <qpa/qwindowsysteminterface.h>
24#include <private/qguiapplication_p.h>
25#include <private/qshapedpixmapdndwindow_p.h>
26#include <private/qsimpledrag_p.h>
27#include <private/qhighdpiscaling_p.h>
47 xcb_window_t
proxy = XCB_NONE;
53 proxy = *((xcb_window_t *)xcb_get_property_value(
reply.get()));
55 if (
proxy == XCB_NONE)
63 xcb_window_t
p = *((xcb_window_t *)xcb_get_property_value(
reply.get()));
105 currentWindow.
clear();
109 xdnd_dragsource = XCB_NONE;
111 waiting_for_status =
false;
112 current_target = XCB_NONE;
113 current_proxy_target = XCB_NONE;
115 source_time = XCB_CURRENT_TIME;
116 target_time = XCB_CURRENT_TIME;
126 source_sameanswer =
QRect();
136 o = initiatorWindow.
data();
149 for (
int i = 0;
i < fmts.size(); ++
i) {
151 for (
int j = 0;
j < atoms.size(); ++
j) {
153 drag_types.
append(atoms.at(
j));
157 if (drag_types.
size() > 3)
160 XCB_ATOM_ATOM, 32, drag_types.
size(), (
const void *)drag_types.
constData());
176 if (!dropped && !canceled &&
canDrop()) {
180 initiatorWindow.
clear();
188 return toDropAction(drop_actions.
first());
202 bool interacts =
false;
205 xcb_rectangle_t *rectangles = xcb_shape_get_rectangles_rectangles(
reply.get());
207 const int nRectangles = xcb_shape_get_rectangles_rectangles_length(
reply.get());
208 for (
int i = 0; !interacts &&
i < nRectangles; ++
i) {
217xcb_window_t QXcbDrag::findRealWindow(
const QPoint &
pos, xcb_window_t
w,
int md,
bool ignoreNonXdndAwareWindows)
227 if (
reply->map_state != XCB_MAP_STATE_VIEWABLE)
234 QRect windowRect(greply->x, greply->y, greply->width, greply->height);
235 if (windowRect.contains(
pos)) {
236 bool windowContainsMouse = !ignoreNonXdndAwareWindows;
240 XCB_GET_PROPERTY_TYPE_ANY, 0, 0);
241 bool isAware =
reply &&
reply->type != XCB_NONE;
243 const QPoint relPos =
pos - windowRect.topLeft();
248 if (windowContainsMouse &&
connection()->hasXShape())
251 windowContainsMouse =
true;
252 if (windowContainsMouse)
260 int nc = xcb_query_tree_children_length(
reply.get());
261 xcb_window_t *
c = xcb_query_tree_children(
reply.get());
265 r = findRealWindow(
pos - windowRect.topLeft(),
c[
i], md-1, ignoreNonXdndAwareWindows);
274 if (!windowContainsMouse)
285 xcb_window_t rootwin = current_virtual_desktop->
root();
287 rootwin, rootwin, globalPos.
x(), globalPos.
y());
296 xcb_window_t
src = rootwin;
298 qCDebug(lcQpaXDnd) <<
"checking target for XdndAware" <<
target;
313 bool aware =
reply &&
reply->type != XCB_NONE;
323 qCDebug(lcQpaXDnd) <<
"need to find real window";
324 target = findRealWindow(globalPos, rootwin, 6,
true);
326 target = findRealWindow(globalPos, rootwin, 6,
false);
343 if (source_sameanswer.
contains(globalPos) && source_sameanswer.
isValid())
352 if (virtualDesktop != current_virtual_desktop) {
358 current_virtual_desktop = virtualDesktop;
380 int target_version = 1;
389 target_version = *(uint32_t *)xcb_get_property_value(
reply.get());
394 if (
target != current_target) {
399 current_proxy_target = proxy_target;
401 int flags = target_version << 24;
402 if (drag_types.
size() > 3)
405 xcb_client_message_event_t enter;
406 enter.response_type = XCB_CLIENT_MESSAGE;
412 enter.data.data32[1] =
flags;
413 enter.data.data32[2] = drag_types.
size() > 0 ? drag_types.
at(0) : 0;
414 enter.data.data32[3] = drag_types.
size() > 1 ? drag_types.
at(1) : 0;
415 enter.data.data32[4] = drag_types.
size() > 2 ? drag_types.
at(2) : 0;
417 source_sameanswer =
QRect(globalPos.
x() - 2, globalPos.
y() - 2 , 5, 5);
419 qCDebug(lcQpaXDnd) <<
"sending XdndEnter to target:" <<
target;
424 xcb_send_event(
xcb_connection(),
false, proxy_target, XCB_EVENT_MASK_NO_EVENT, (
const char *)&enter);
425 waiting_for_status =
false;
429 if (waiting_for_status)
433 waiting_for_status =
true;
436 xcb_client_message_event_t
move;
437 move.response_type = XCB_CLIENT_MESSAGE;
443 move.data.data32[1] = 0;
444 move.data.data32[2] = (globalPos.
x() << 16) + globalPos.
y();
447 const auto requestedAction =
defaultAction(supportedActions, mods);
448 move.data.data32[4] = toXdndAction(requestedAction);
450 qCDebug(lcQpaXDnd) <<
"sending XdndPosition to target:" <<
target;
455 handle_xdnd_position(
w, &
move,
b, mods);
457 setActionList(requestedAction, supportedActions);
458 xcb_send_event(
xcb_connection(),
false, proxy_target, XCB_EVENT_MASK_NO_EVENT, (
const char *)&
move);
462 static const bool isUnity =
qgetenv(
"XDG_CURRENT_DESKTOP").toLower() ==
"unity";
463 if (isUnity && xdndCollectionWindow == XCB_NONE) {
465 if (
name ==
"XdndCollectionWindowImp"_L1)
466 xdndCollectionWindow =
target;
468 if (
target == xdndCollectionWindow) {
482 xcb_client_message_event_t
drop;
483 drop.response_type = XCB_CLIENT_MESSAGE;
485 drop.window = current_target;
489 drop.data.data32[1] = 0;
492 drop.data.data32[3] = 0;
503 current_proxy_target,
512 if (!
t.targetWindow && cleanup_timer == -1) {
513 cleanup_timer =
startTimer(XdndDropTransactionTimeout);
516 qCDebug(lcQpaXDnd) <<
"sending drop to target:" << current_target;
521 xcb_send_event(
xcb_connection(),
false, current_proxy_target, XCB_EVENT_MASK_NO_EVENT, (
const char *)&
drop);
536Qt::DropActions QXcbDrag::toDropActions(
const QList<xcb_atom_t> &atoms)
const
538 Qt::DropActions actions;
539 for (
const auto actionAtom : atoms) {
541 actions |= toDropAction(actionAtom);
563void QXcbDrag::readActionList()
565 drop_actions.
clear();
570 int length = xcb_get_property_value_length(
reply.get()) / 4;
572 xcb_atom_t *atoms = (xcb_atom_t *)xcb_get_property_value(
reply.get());
578void QXcbDrag::setActionList(
Qt::DropAction requestedAction, Qt::DropActions supportedActions)
580#ifndef QT_NO_CLIPBOARD
581 QList<xcb_atom_t> actions;
583 actions.append(toXdndAction(requestedAction));
585 auto checkAppend = [
this, requestedAction, supportedActions, &actions](
Qt::DropAction action) {
586 if (requestedAction != action && supportedActions & action)
587 actions.append(toXdndAction(action));
594 if (current_actions != actions) {
597 XCB_ATOM_ATOM, 32, actions.size(), actions.constData());
598 current_actions = actions;
603void QXcbDrag::startListeningForActionListChanges()
606 const uint32_t event_mask[] = { XCB_EVENT_MASK_PROPERTY_CHANGE };
607 xcb_change_window_attributes(
xcb_connection(), xdnd_dragsource, XCB_CW_EVENT_MASK, event_mask);
610void QXcbDrag::stopListeningForActionListChanges()
612 const uint32_t event_mask[] = { XCB_EVENT_MASK_NO_EVENT };
613 xcb_change_window_attributes(
xcb_connection(), xdnd_dragsource, XCB_CW_EVENT_MASK, event_mask);
617int QXcbDrag::findTransactionByWindow(xcb_window_t
window)
620 for (
int i = 0;
i < transactions.
size(); ++
i) {
621 const Transaction &
t = transactions.
at(
i);
630int QXcbDrag::findTransactionByTime(xcb_timestamp_t timestamp)
633 for (
int i = 0;
i < transactions.
size(); ++
i) {
634 const Transaction &
t = transactions.
at(
i);
635 if (
t.timestamp == timestamp) {
645static QWidget* current_embedding_widget =
nullptr;
646static xcb_client_message_event_t last_enter_event;
649static bool checkEmbedded(
QWidget*
w,
const XEvent* xe)
654 if (current_embedding_widget != 0 && current_embedding_widget !=
w) {
655 current_target = ((QExtraWidget*)current_embedding_widget)->extraData()->xDndProxy;
656 current_proxy_target = current_target;
657 qt_xdnd_send_leave();
659 current_proxy_target = 0;
660 current_embedding_widget = 0;
663 QWExtra* extra = ((QExtraWidget*)
w)->extraData();
664 if (extra && extra->xDndProxy != 0) {
666 if (current_embedding_widget !=
w) {
668 last_enter_event.xany.window = extra->xDndProxy;
669 XSendEvent(
X11->display, extra->xDndProxy,
False, NoEventMask, &last_enter_event);
670 current_embedding_widget =
w;
673 ((XEvent*)xe)->xany.window = extra->xDndProxy;
674 XSendEvent(
X11->display, extra->xDndProxy,
False, NoEventMask, (XEvent*)xe);
675 if (currentWindow !=
w) {
680 current_embedding_widget = 0;
688 qCDebug(lcQpaXDnd) <<
"target:" <<
event->window <<
"received XdndEnter";
692 int version = (int)(
event->data.data32[1] >> 24);
696 xdnd_dragsource =
event->data.data32[0];
697 startListeningForActionListChanges();
702 current_proxy_target =
proxy ?
proxy : xdnd_dragsource;
704 if (
event->data.data32[1] & 1) {
710 int length = xcb_get_property_value_length(
reply.get()) / 4;
711 if (
length > xdnd_max_type)
714 xcb_atom_t *atoms = (xcb_atom_t *)xcb_get_property_value(
reply.get());
721 for(
int i = 2;
i < 5;
i++) {
722 if (
event->data.data32[
i])
726 for(
int i = 0;
i < xdnd_types.
size(); ++
i)
730void QXcbDrag::handle_xdnd_position(
QPlatformWindow *
w,
const xcb_client_message_event_t *e,
731 Qt::MouseButtons
b, Qt::KeyboardModifiers mods)
735 qCDebug(lcQpaXDnd) <<
"target:" << e->window <<
"received XdndPosition";
737 QPoint p((e->data.data32[2] & 0xffff0000) >> 16, e->data.data32[2] & 0x0000ffff);
739 QRect geometry =
w->geometry();
745 if (
Q_UNLIKELY(e->data.data32[0] != xdnd_dragsource)) {
746 qCDebug(lcQpaXDnd,
"xdnd drag position from unexpected source (%x not %x)",
747 e->data.data32[0], xdnd_dragsource);
752 currentWindow =
w->window();
755 if (e->data.data32[3] != XCB_NONE) {
756 target_time = e->data.data32[3];
765 dropData = m_dropData;
766 supported_actions = toDropActions(drop_actions);
768 supported_actions |= Qt::DropActions(toDropAction(e->data.data32[4]));
775 w->window(), dropData,
p, supported_actions, buttons,
modifiers);
779 answerRect = qt_response.answerRect().translated(geometry.
topLeft()).intersected(geometry);
784 xcb_client_message_event_t response;
785 response.response_type = XCB_CLIENT_MESSAGE;
786 response.sequence = 0;
787 response.window = xdnd_dragsource;
788 response.format = 32;
791 response.data.data32[1] = qt_response.isAccepted();
792 response.data.data32[2] = 0;
793 response.data.data32[3] = 0;
794 response.data.data32[4] = toXdndAction(qt_response.acceptedAction());
796 accepted_drop_action = qt_response.acceptedAction();
798 if (answerRect.left() < 0)
799 answerRect.setLeft(0);
800 if (answerRect.right() > 4096)
801 answerRect.setRight(4096);
802 if (answerRect.top() < 0)
803 answerRect.setTop(0);
804 if (answerRect.bottom() > 4096)
805 answerRect.setBottom(4096);
806 if (answerRect.width() < 0)
807 answerRect.setWidth(0);
808 if (answerRect.height() < 0)
809 answerRect.setHeight(0);
812 target_time = XCB_CURRENT_TIME;
814 qCDebug(lcQpaXDnd) <<
"sending XdndStatus to source:" << xdnd_dragsource;
816 if (xdnd_dragsource ==
connection()->qtSelectionOwner())
817 handle_xdnd_status(&response);
820 XCB_EVENT_MASK_NO_EVENT, (
const char *)&response);
825 class ClientMessageScanner {
827 ClientMessageScanner(xcb_atom_t
a) : atom(
a) {}
829 bool operator() (xcb_generic_event_t *
event,
int type)
const {
830 if (
type != XCB_CLIENT_MESSAGE)
832 auto clientMessage =
reinterpret_cast<xcb_client_message_event_t *
>(
event);
833 return clientMessage->type == atom;
840 xcb_client_message_event_t *lastEvent =
const_cast<xcb_client_message_event_t *
>(
event);
842 while (
auto nextEvent =
connection()->eventQueue()->peek(scanner)) {
843 if (lastEvent !=
event)
845 lastEvent =
reinterpret_cast<xcb_client_message_event_t *
>(nextEvent);
848 handle_xdnd_position(
w, lastEvent);
849 if (lastEvent !=
event)
853void QXcbDrag::handle_xdnd_status(
const xcb_client_message_event_t *
event)
857 qCDebug(lcQpaXDnd) <<
"source:" <<
event->window <<
"received XdndStatus";
858 waiting_for_status =
false;
860 if (
event->data.data32[0] &&
event->data.data32[0] != current_target)
863 const bool dropPossible =
event->data.data32[1];
867 accepted_drop_action = toDropAction(
event->data.data32[4]);
873 if ((
event->data.data32[1] & 2) == 0) {
874 QPoint p((
event->data.data32[2] & 0xffff0000) >> 16,
event->data.data32[2] & 0x0000ffff);
875 QSize s((
event->data.data32[3] & 0xffff0000) >> 16,
event->data.data32[3] & 0x0000ffff);
876 source_sameanswer =
QRect(
p,
s);
878 source_sameanswer =
QRect();
887 xcb_client_message_event_t *lastEvent =
const_cast<xcb_client_message_event_t *
>(
event);
888 xcb_generic_event_t *nextEvent;
890 while ((nextEvent =
connection()->eventQueue()->peek(scanner))) {
891 if (lastEvent !=
event)
893 lastEvent = (xcb_client_message_event_t *)nextEvent;
896 handle_xdnd_status(lastEvent);
897 if (lastEvent !=
event)
904 qCDebug(lcQpaXDnd) <<
"target:" <<
event->window <<
"received XdndLeave";
906 if (!currentWindow ||
w != currentWindow.
data()->handle()) {
907 stopListeningForActionListChanges();
918 if (
event->data.data32[0] != xdnd_dragsource) {
920 qCDebug(lcQpaXDnd,
"xdnd drag leave from unexpected source (%x not %x",
921 event->data.data32[0], xdnd_dragsource);
924 stopListeningForActionListChanges();
929void QXcbDrag::send_leave()
935 xcb_client_message_event_t
leave;
936 leave.response_type = XCB_CLIENT_MESSAGE;
938 leave.window = current_target;
942 leave.data.data32[1] = 0;
943 leave.data.data32[2] = 0;
944 leave.data.data32[3] = 0;
945 leave.data.data32[4] = 0;
952 qCDebug(lcQpaXDnd) <<
"sending XdndLeave to target:" << current_target;
958 XCB_EVENT_MASK_NO_EVENT, (
const char *)&
leave);
962 Qt::MouseButtons
b, Qt::KeyboardModifiers mods)
965 qCDebug(lcQpaXDnd) <<
"target:" <<
event->window <<
"received XdndDrop";
967 if (!currentWindow) {
968 stopListeningForActionListChanges();
973 const uint32_t *l =
event->data.data32;
975 if (l[0] != xdnd_dragsource) {
976 qCDebug(lcQpaXDnd,
"xdnd drop from unexpected source (%x not %x", l[0], xdnd_dragsource);
984 Qt::DropActions supported_drop_actions;
989 int at = findTransactionByTime(target_time);
991 qCDebug(lcQpaXDnd) <<
"found one transaction via findTransactionByTime()";
992 dropData = transactions.
at(
at).drag->mimeData();
994 if (dropData && dropData->
hasImage())
1001 supported_drop_actions = Qt::DropActions(l[4]);
1004 dropData = m_dropData;
1005 supported_drop_actions = accepted_drop_action | toDropActions(drop_actions);
1015 currentWindow.
data(), dropData, currentPosition, supported_drop_actions,
1025 xcb_client_message_event_t finished = {};
1026 finished.response_type = XCB_CLIENT_MESSAGE;
1027 finished.sequence = 0;
1028 finished.window = xdnd_dragsource;
1029 finished.format = 32;
1031 finished.data.data32[0] = currentWindow ?
xcb_window(currentWindow.
data()) : XCB_NONE;
1032 finished.data.data32[1] = response.
isAccepted();
1033 finished.data.data32[2] = toXdndAction(acceptedAaction);
1035 qCDebug(lcQpaXDnd) <<
"sending XdndFinished to source:" << xdnd_dragsource;
1038 XCB_EVENT_MASK_NO_EVENT, (
char *)&finished);
1040 stopListeningForActionListChanges();
1048 qCDebug(lcQpaXDnd) <<
"source:" <<
event->window <<
"received XdndFinished";
1053 const unsigned long *l = (
const unsigned long *)
event->data.data32;
1055 int at = findTransactionByWindow(l[0]);
1058 Transaction
t = transactions.
takeAt(
at);
1085 qWarning(
"QXcbDrag::handleFinished - drop data has expired");
1088 waiting_for_status =
false;
1093 if (e->
timerId() == cleanup_timer) {
1094 bool stopTimer =
true;
1095 for (
int i = 0;
i < transactions.
size(); ++
i) {
1096 const Transaction &
t = transactions.
at(
i);
1097 if (
t.targetWindow) {
1103 std::chrono::milliseconds delta{
t.time.msecsTo(
currentTime)};
1104 if (delta > XdndDropTransactionTimeout) {
1112 t.drag->deleteLater();
1119 if (stopTimer && cleanup_timer != -1) {
1128 qCDebug(lcQpaXDnd) <<
"dnd was canceled";
1148 bool aware = gpReply && gpReply->type != XCB_NONE;
1158 xcb_window_t root = qtReply->root;
1159 xcb_window_t parent = qtReply->parent;
1169 qCDebug(lcQpaXDnd) <<
"handle selection request from target:" <<
event->requestor;
1170 q_padded_xcb_event<xcb_selection_notify_event_t> notify = {};
1171 notify.response_type = XCB_SELECTION_NOTIFY;
1172 notify.requestor =
event->requestor;
1173 notify.selection =
event->selection;
1174 notify.target = XCB_NONE;
1175 notify.property = XCB_NONE;
1176 notify.time =
event->time;
1188 at = findTransactionByTime(
event->time);
1192 at = findTransactionByWindow(
event->requestor);
1198 if (
event->time == XCB_CURRENT_TIME && current_target ==
target)
1201 at = findTransactionByWindow(
target);
1206 QDrag *transactionDrag =
nullptr;
1208 transactionDrag = transactions.
at(
at).drag;
1209 }
else if (
at == -2) {
1213 if (transactionDrag) {
1214 xcb_atom_t atomFormat =
event->target;
1218 &
data, &atomFormat, &dataFormat)) {
1221 atomFormat, dataFormat,
dataSize, (
const void *)
data.constData());
1222 notify.property =
event->property;
1223 notify.target = atomFormat;
1229 proxy_target =
event->requestor;
1231 xcb_send_event(
xcb_connection(),
false, proxy_target, XCB_EVENT_MASK_NO_EVENT, (
const char *)¬ify);
1253 proxy_id =
window->xcb_window();
1255 xcb_change_property(
xcb_connection(), XCB_PROP_MODE_REPLACE,
w->xcb_window(), xdnd_proxy,
1256 XCB_ATOM_WINDOW, 32, 1, &proxy_id);
1257 xcb_change_property(
xcb_connection(), XCB_PROP_MODE_REPLACE, proxy_id, xdnd_proxy,
1258 XCB_ATOM_WINDOW, 32, 1, &proxy_id);
1265 qCDebug(lcQpaXDnd) <<
"setting XdndAware for" <<
window->xcb_window();
1276 delete desktop_proxy;
1277 desktop_proxy =
nullptr;
1279 qCDebug(lcQpaXDnd) <<
"not deleting XDndAware";
1320 QList<xcb_atom_t> atoms =
drag->xdnd_types;
1321 bool hasUtf8 =
false;
1326#ifndef QT_NO_CLIPBOARD
1345 for (
int i = 0;
i <
drag->xdnd_types.
size(); ++
i) {
void updateCursor(Qt::DropAction action)
void moveShapedPixmapWindow(const QPoint &deviceIndependentPosition)
Move the drag label to globalPos, which is interpreted in device independent coordinates.
void setUseCompositing(bool on)
QShapedPixmapWindow * shapedPixmapWindow() const
virtual bool eventFilter(QObject *o, QEvent *e) override
Filters events if this object has been installed as an event filter for the watched object.
virtual void drop(const QPoint &globalPos, Qt::MouseButtons b, Qt::KeyboardModifiers mods)=0
void recreateShapedPixmapWindow(QScreen *screen, const QPoint &pos)
void setExecutedDropAction(Qt::DropAction da)
void setScreen(QScreen *screen)
qsizetype size() const noexcept
Returns the number of bytes in this byte array.
static QPoint pos()
Returns the position of the cursor (hot spot) of the primary screen in global screen coordinates.
QMimeData * mimeData() const
Returns the MIME data that is encapsulated by the drag object.
Qt::DropActions supportedActions() const
Returns the set of possible drop actions for this drag operation.
static QWindow * currentMouseWindow
static Qt::KeyboardModifiers keyboardModifiers()
Returns the current state of the modifier keys on the keyboard.
static Qt::MouseButtons mouseButtons()
Returns the current state of the buttons on the mouse.
static QPoint mapPositionFromNative(const QPoint &pos, const QPlatformScreen *platformScreen)
QStringList formats() const override
Returns a list of formats supported by the object.
static QStringList formatsHelper(const QMimeData *data)
qsizetype size() const noexcept
const_pointer constData() const noexcept
bool isEmpty() const noexcept
void removeAt(qsizetype i)
const_reference at(qsizetype i) const noexcept
const T & constFirst() const noexcept
void reserve(qsizetype size)
void append(parameter_type t)
bool hasImage() const
Returns true if the object can return an image; otherwise returns false.
QByteArray data(const QString &mimetype) const
Returns the data stored in the object in the format described by the MIME type specified by mimeType.
int startTimer(int interval, Qt::TimerType timerType=Qt::CoarseTimer)
This is an overloaded function that will start a timer of type timerType and a timeout of interval mi...
void killTimer(int id)
Kills the timer with timer identifier, id.
void deleteLater()
\threadsafe
\inmodule QtCore\reentrant
constexpr int x() const noexcept
Returns the x coordinate of this point.
constexpr int y() const noexcept
Returns the y coordinate of this point.
T * data() const noexcept
\inmodule QtCore\reentrant
constexpr bool isValid() const noexcept
Returns true if the rectangle is valid, otherwise returns false.
constexpr QPoint topLeft() const noexcept
Returns the position of the rectangle's top-left corner.
bool contains(const QRect &r, bool proper=false) const noexcept
This is an overloaded member function, provided for convenience. It differs from the above function o...
\macro QT_RESTRICTED_CAST_FROM_ASCII
QByteArray toLatin1() const &
\inmodule QtCore \reentrant
static QTime currentTime()
Returns the current time as reported by the system clock.
int timerId() const
Returns the unique timer identifier, which is the same identifier as returned from QObject::startTime...
QByteArray atomName(xcb_atom_t atom)
QXcbKeyboard * keyboard() const
xcb_timestamp_t time() const
xcb_window_t qtSelectionOwner()
Qt::MouseButtons queryMouseButtons() const
QXcbWindow * platformWindowFromId(xcb_window_t id)
void addWindowEventListener(xcb_window_t id, QXcbWindowEventListener *eventListener)
void removeWindowEventListener(xcb_window_t id)
static void queryPointer(QXcbConnection *c, QXcbVirtualDesktop **virtualDesktop, QPoint *pos, int *keybMask=nullptr)
void move(const QPoint &globalPos, Qt::MouseButtons b, Qt::KeyboardModifiers mods) override
Qt::DropAction defaultAction(Qt::DropActions possibleActions, Qt::KeyboardModifiers modifiers) const override
void timerEvent(QTimerEvent *e) override
This event handler can be reimplemented in a subclass to receive timer events for the object.
bool findXdndAwareTarget(const QPoint &globalPos, xcb_window_t *target_out)
xcb_timestamp_t targetTime()
void handleEnter(QPlatformWindow *window, const xcb_client_message_event_t *event, xcb_window_t proxy=0)
void drop(const QPoint &globalPos, Qt::MouseButtons b, Qt::KeyboardModifiers mods) override
void handleStatus(const xcb_client_message_event_t *event)
void handleDrop(QPlatformWindow *, const xcb_client_message_event_t *event, Qt::MouseButtons b={ }, Qt::KeyboardModifiers mods={ })
friend class QXcbDropData
void handleFinished(const xcb_client_message_event_t *event)
bool eventFilter(QObject *o, QEvent *e) override
Filters events if this object has been installed as an event filter for the watched object.
void handlePosition(QPlatformWindow *w, const xcb_client_message_event_t *event)
void startDrag() override
bool ownsDragObject() const override
Returns bool indicating whether QPlatformDrag takes ownership and therefore responsibility of deletin...
void handleLeave(QPlatformWindow *w, const xcb_client_message_event_t *event)
QXcbDrag(QXcbConnection *c)
void handleSelectionRequest(const xcb_selection_request_event_t *event)
bool dndEnable(QXcbWindow *win, bool on)
void handlePropertyNotifyEvent(const xcb_property_notify_event_t *event) override
QVariant retrieveData_sys(const QString &mimeType, QMetaType type) const override
bool hasFormat_sys(const QString &mimeType) const override
QVariant xdndObtainData(const QByteArray &format, QMetaType requestedType) const
QXcbDropData(QXcbDrag *d)
QStringList formats_sys() const override
Qt::KeyboardModifiers queryKeyboardModifiers() const override
static QVariant mimeConvertToFormat(QXcbConnection *connection, xcb_atom_t a, const QByteArray &data, const QString &format, QMetaType requestedType, bool hasUtf8)
static QList< xcb_atom_t > mimeAtomsForFormat(QXcbConnection *connection, const QString &format)
static xcb_atom_t mimeAtomForFormat(QXcbConnection *connection, const QString &format, QMetaType requestedType, const QList< xcb_atom_t > &atoms, bool *hasUtf8)
static bool mimeDataForAtom(QXcbConnection *connection, xcb_atom_t a, QMimeData *mimeData, QByteArray *data, xcb_atom_t *atomFormat, int *dataFormat)
static QString mimeAtomToString(QXcbConnection *connection, xcb_atom_t a)
QXcbConnection * connection() const
xcb_connection_t * xcb_connection() const
xcb_atom_t atom(QXcbAtom::Atom atom) const
bool compositingActive() const
xcb_window_t root() const
QList< QPlatformScreen * > screens() const
QXcbScreen * screenAt(const QPoint &pos) const
static QString windowTitle(const QXcbConnection *conn, xcb_window_t window)
EGLImageKHR int int EGLuint64KHR * modifiers
T toNativePixels(const T &value, const C *context)
Combined button and popup list for selecting options.
DBusConnection * connection
#define qCDebug(category,...)
constexpr const T & qMin(const T &a, const T &b)
GLboolean GLboolean GLboolean b
GLuint64 GLenum void * handle
GLint GLint GLint GLint GLint x
[0]
GLfloat GLfloat GLfloat w
[0]
GLint GLsizei GLsizei height
GLboolean GLboolean GLboolean GLboolean a
[7]
GLenum GLuint GLenum GLsizei length
GLint GLsizei GLsizei GLenum GLenum GLsizei void * data
GLint GLsizei GLsizei GLenum format
Q_CORE_EXPORT QByteArray qgetenv(const char *varName)
static double currentTime()
#define Q_XCB_REPLY(call,...)
#define Q_XCB_REPLY_UNCHECKED(call,...)
static xcb_window_t xdndProxy(QXcbConnection *c, xcb_window_t w)
static xcb_window_t findXdndAwareParent(QXcbConnection *c, xcb_window_t window)
static xcb_window_t xcb_window(QPlatformWindow *w)
static bool windowInteractsWithPosition(xcb_connection_t *connection, const QPoint &pos, xcb_window_t w, xcb_shape_sk_t shapeType)
static bool translate(xcb_connection_t *connection, xcb_window_t child, xcb_window_t parent, int *x, int *y)
application x qt windows mime
[2]
bool contains(const AT &t) const noexcept