diff options
author | Jørgen Lind <jorgen.lind@digia.com> | 2013-04-25 15:15:20 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-04-26 14:18:16 +0200 |
commit | 7288625c52749f566570a7e7ef047faa8171b18c (patch) | |
tree | c4c3d0e2808bc868a6440060f7db661417268d0f /src/plugins/platforms/xcb/qxcbconnection.cpp | |
parent | f8e2a8469f91ac1a7daf73c8ed9c24195e5b5a56 (diff) |
Moving logic from Qt4 for grabbing the X server
Basically you don't want to grab the X server while your debugging.
Also added an environment variable which lets you force to not grab
the X server
Change-Id: Iba03f11c8f486ce71c55fac7716bffcb7cc8cb98
Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
Diffstat (limited to 'src/plugins/platforms/xcb/qxcbconnection.cpp')
-rw-r--r-- | src/plugins/platforms/xcb/qxcbconnection.cpp | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/src/plugins/platforms/xcb/qxcbconnection.cpp b/src/plugins/platforms/xcb/qxcbconnection.cpp index de3d487c4b..0597b18679 100644 --- a/src/plugins/platforms/xcb/qxcbconnection.cpp +++ b/src/plugins/platforms/xcb/qxcbconnection.cpp @@ -242,8 +242,9 @@ void QXcbConnection::updateScreens() ((QXcbIntegration*)QGuiApplicationPrivate::platformIntegration())->screenAdded(screen); } -QXcbConnection::QXcbConnection(QXcbNativeInterface *nativeInterface, const char *displayName) +QXcbConnection::QXcbConnection(QXcbNativeInterface *nativeInterface, bool canGrabServer, const char *displayName) : m_connection(0) + , m_canGrabServer(canGrabServer) , m_primaryScreen(0) , m_displayName(displayName ? QByteArray(displayName) : qgetenv("DISPLAY")) , m_nativeInterface(nativeInterface) @@ -952,6 +953,18 @@ void QXcbConnection::setFocusWindow(QXcbWindow *w) m_focusWindow = w; } +void QXcbConnection::grabServer() +{ + if (m_canGrabServer) + xcb_grab_server(m_connection); +} + +void QXcbConnection::ungrabServer() +{ + if (m_canGrabServer) + xcb_ungrab_server(m_connection); +} + void QXcbConnection::sendConnectionEvent(QXcbAtom::Atom a, uint id) { xcb_client_message_event_t event; |