summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/xcb/qxcbconnection.cpp
diff options
context:
space:
mode:
authorRolf Eike Beer <eb@emlix.com>2013-12-05 17:33:24 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2014-03-14 18:23:06 +0100
commit6d858a0fdb896d2c4f9f6411f691f0648c084cd7 (patch)
tree4a467ea3972f6f1f3c34ff3799f8f0518d3272cc /src/plugins/platforms/xcb/qxcbconnection.cpp
parentcbf5aa625d1a41156880cccbe081e84fc0c1067e (diff)
XCB plugin: query screen resources without _current
xcb_randr_get_screen_resources() and xcb_randr_get_screen_resources_current() do basically the same, but for one case: if nothing has queried these information ever before. So if an application is the very first client ever to connect to an X server it may just return nothing. A call to xcb_randr_get_screen_info_reply() will then cause the X server to allocate the needed information and send an update notification, resulting in a second QXcbScreen being created, but the other one is still around and probably used. The behavior I observed with a simple test application was that the application was not visible on the screen when it was the first client ever on the X server. Killing the application and starting it again made it work just fine. Change-Id: Id64f267e8ebcfa5b39d21d98307170a09e5169df Reviewed-by: Uli Schlachter <psychon@znc.in> Reviewed-by: Gatis Paeglis <gatis.paeglis@digia.com> Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
Diffstat (limited to 'src/plugins/platforms/xcb/qxcbconnection.cpp')
-rw-r--r--src/plugins/platforms/xcb/qxcbconnection.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/plugins/platforms/xcb/qxcbconnection.cpp b/src/plugins/platforms/xcb/qxcbconnection.cpp
index 030090d98d..a68ae8cf71 100644
--- a/src/plugins/platforms/xcb/qxcbconnection.cpp
+++ b/src/plugins/platforms/xcb/qxcbconnection.cpp
@@ -144,23 +144,23 @@ void QXcbConnection::updateScreens()
xcb_generic_error_t *error = NULL;
xcb_randr_get_output_primary_cookie_t primaryCookie =
xcb_randr_get_output_primary(xcb_connection(), xcbScreen->root);
- xcb_randr_get_screen_resources_current_cookie_t resourcesCookie =
- xcb_randr_get_screen_resources_current(xcb_connection(), xcbScreen->root);
+ xcb_randr_get_screen_resources_cookie_t resourcesCookie =
+ xcb_randr_get_screen_resources(xcb_connection(), xcbScreen->root);
xcb_randr_get_output_primary_reply_t *primary =
xcb_randr_get_output_primary_reply(xcb_connection(), primaryCookie, &error);
if (!primary || error) {
qWarning("QXcbConnection: Failed to get the primary output of the screen");
free(error);
} else {
- xcb_randr_get_screen_resources_current_reply_t *resources =
- xcb_randr_get_screen_resources_current_reply(xcb_connection(), resourcesCookie, &error);
+ xcb_randr_get_screen_resources_reply_t *resources =
+ xcb_randr_get_screen_resources_reply(xcb_connection(), resourcesCookie, &error);
if (!resources || error) {
qWarning("QXcbConnection: Failed to get the screen resources");
free(error);
} else {
xcb_timestamp_t timestamp = resources->config_timestamp;
- outputCount = xcb_randr_get_screen_resources_current_outputs_length(resources);
- xcb_randr_output_t *outputs = xcb_randr_get_screen_resources_current_outputs(resources);
+ outputCount = xcb_randr_get_screen_resources_outputs_length(resources);
+ xcb_randr_output_t *outputs = xcb_randr_get_screen_resources_outputs(resources);
for (int i = 0; i < outputCount; i++) {
xcb_randr_get_output_info_reply_t *output =