summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/xcb/qxcbconnection.cpp
diff options
context:
space:
mode:
authorTasuku Suzuki <tasuku.suzuki@nokia.com>2012-05-17 05:16:10 +0900
committerQt by Nokia <qt-info@nokia.com>2012-05-26 00:34:40 +0200
commit576d4a1cce4a58cca9dddfb8b3878b66169aabcf (patch)
tree438d90dec1c722f2fcd1d129a2b5f58bdc03905c /src/plugins/platforms/xcb/qxcbconnection.cpp
parentad7d953963a1cf0d3a082eb374c6a6cd229062b4 (diff)
Fix xcb plugin compilation for -qconfig large
Change-Id: I1ee1fb9c140396e83272d607ee4dd63ce2c50b8d Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com> Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
Diffstat (limited to 'src/plugins/platforms/xcb/qxcbconnection.cpp')
-rw-r--r--src/plugins/platforms/xcb/qxcbconnection.cpp22
1 files changed, 21 insertions, 1 deletions
diff --git a/src/plugins/platforms/xcb/qxcbconnection.cpp b/src/plugins/platforms/xcb/qxcbconnection.cpp
index 3d17e38159..d9c3352747 100644
--- a/src/plugins/platforms/xcb/qxcbconnection.cpp
+++ b/src/plugins/platforms/xcb/qxcbconnection.cpp
@@ -186,8 +186,12 @@ QXcbConnection::QXcbConnection(QXcbNativeInterface *nativeInterface, const char
m_wmSupport.reset(new QXcbWMSupport(this));
m_keyboard = new QXcbKeyboard(this);
+#ifndef QT_NO_CLIPBOARD
m_clipboard = new QXcbClipboard(this);
+#endif
+#ifndef QT_NO_DRAGANDDROP
m_drag = new QXcbDrag(this);
+#endif
#ifdef XCB_USE_DRI2
initializeDri2();
@@ -197,8 +201,12 @@ QXcbConnection::QXcbConnection(QXcbNativeInterface *nativeInterface, const char
QXcbConnection::~QXcbConnection()
{
+#ifndef QT_NO_CLIPBOARD
delete m_clipboard;
-
+#endif
+#ifndef QT_NO_DRAGANDDROP
+ delete m_drag;
+#endif
// Delete screens in reverse order to avoid crash in case of multiple screens
while (!m_screens.isEmpty())
delete m_screens.takeLast();
@@ -562,15 +570,23 @@ void QXcbConnection::handleXcbEvent(xcb_generic_event_t *event)
case XCB_SELECTION_REQUEST:
{
xcb_selection_request_event_t *sr = (xcb_selection_request_event_t *)event;
+#ifndef QT_NO_DRAGANDDROP
if (sr->selection == atom(QXcbAtom::XdndSelection))
m_drag->handleSelectionRequest(sr);
else
+#endif
+ {
+#ifndef QT_NO_CLIPBOARD
m_clipboard->handleSelectionRequest(sr);
+#endif
+ }
break;
}
case XCB_SELECTION_CLEAR:
setTime(((xcb_selection_clear_event_t *)event)->time);
+#ifndef QT_NO_CLIPBOARD
m_clipboard->handleSelectionClearRequest((xcb_selection_clear_event_t *)event);
+#endif
handled = true;
break;
case XCB_SELECTION_NOTIFY:
@@ -594,7 +610,9 @@ void QXcbConnection::handleXcbEvent(xcb_generic_event_t *event)
if (!handled) {
if (response_type == xfixes_first_event + XCB_XFIXES_SELECTION_NOTIFY) {
setTime(((xcb_xfixes_selection_notify_event_t *)event)->timestamp);
+#ifndef QT_NO_CLIPBOARD
m_clipboard->handleXFixesSelectionRequest((xcb_xfixes_selection_notify_event_t *)event);
+#endif
handled = true;
} else if (has_randr_extension && response_type == xrandr_first_event + XCB_RANDR_SCREEN_CHANGE_NOTIFY) {
xcb_randr_screen_change_notify_event_t *change_event = (xcb_randr_screen_change_notify_event_t *)event;
@@ -744,11 +762,13 @@ void QXcbConnection::handleClientMessageEvent(const xcb_client_message_event_t *
if (event->format != 32)
return;
+#ifndef QT_NO_DRAGANDDROP
if (event->type == atom(QXcbAtom::XdndStatus)) {
drag()->handleStatus(event);
} else if (event->type == atom(QXcbAtom::XdndFinished)) {
drag()->handleFinished(event);
}
+#endif
QXcbWindow *window = platformWindowFromId(event->window);
if (!window)