From 3ff441d30570fd38f62d858b8c8e86e9d1ca3d8d Mon Sep 17 00:00:00 2001
From: Uli Schlachter <psychon@znc.in>
Date: Sat, 1 Jun 2013 16:57:19 +0200
Subject: [PATCH] xcb: Don't use Xlib's XBell() function

XBell() just sends a Bell request to the X11 server. This can be done
equally well (and with less ifdefs) through xcb's xcb_bell().

Change-Id: If41d955aa97acfe9e0a8b9fce05c11ebc146ce8e
Signed-off-by: Uli Schlachter <psychon@znc.in>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
---
 src/plugins/platforms/xcb/qxcbnativeinterface.cpp | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/src/plugins/platforms/xcb/qxcbnativeinterface.cpp b/src/plugins/platforms/xcb/qxcbnativeinterface.cpp
index 7d832a1c08..9e9fd2914f 100644
--- a/src/plugins/platforms/xcb/qxcbnativeinterface.cpp
+++ b/src/plugins/platforms/xcb/qxcbnativeinterface.cpp
@@ -95,12 +95,9 @@ QXcbNativeInterface::QXcbNativeInterface() :
 
 void QXcbNativeInterface::beep() // For QApplication::beep()
 {
-#ifdef XCB_USE_XLIB
-    ::Display *display = (::Display *)nativeResourceForScreen(QByteArrayLiteral("display"), QGuiApplication::primaryScreen());
-    XBell(display, 0);
-#else
-    fputc(7, stdout);
-#endif
+    QPlatformScreen *screen = QGuiApplication::primaryScreen()->handle();
+    xcb_connection_t *connection = static_cast<QXcbScreen *>(screen)->xcb_connection();
+    xcb_bell(connection, 0);
 }
 
 void *QXcbNativeInterface::nativeResourceForIntegration(const QByteArray &resourceString)