From e4271a787fe12af82fb5ae30958b600fc84ef3c6 Mon Sep 17 00:00:00 2001 From: Vlad Zahorodnii Date: Wed, 12 May 2021 14:41:15 +0300 Subject: [PATCH] Scanner: Remove global version check libwayland-server ensures that the requested version is less than or equal to the global version. This change removes the global version check to simplify the generated code and reduce memory usage footprint, however the latter shouldn't be that noticeable. --- src/wayland/tools/qtwaylandscanner.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/wayland/tools/qtwaylandscanner.cpp b/src/wayland/tools/qtwaylandscanner.cpp index 0177ed8dc1..27bfdf8f0b 100644 --- a/src/wayland/tools/qtwaylandscanner.cpp +++ b/src/wayland/tools/qtwaylandscanner.cpp @@ -645,7 +645,6 @@ bool Scanner::process() printf(" struct ::wl_global *m_global;\n"); printf(" struct ::wl_display *m_display;\n"); printf(" struct wl_event_source *m_globalRemovedEvent;\n"); - printf(" uint32_t m_globalVersion;\n"); printf(" struct DisplayDestroyedListener : ::wl_listener {\n"); printf(" %s *parent;\n", interfaceName); printf(" };\n"); @@ -794,7 +793,6 @@ bool Scanner::process() printf(" {\n"); printf(" m_display = display;\n"); printf(" m_global = wl_global_create(display, &::%s_interface, version, this, bind_func);\n", interfaceName); - printf(" m_globalVersion = version;\n"); printf(" m_displayDestroyedListener.notify = %s::display_destroy_func;\n", interfaceName); printf(" m_displayDestroyedListener.parent = this;\n"); printf(" wl_display_add_destroy_listener(display, &m_displayDestroyedListener);\n"); @@ -831,7 +829,7 @@ bool Scanner::process() printf(" void %s::bind_func(struct ::wl_client *client, void *data, uint32_t version, uint32_t id)\n", interfaceName); printf(" {\n"); printf(" %s *that = static_cast<%s *>(data);\n", interfaceName, interfaceName); - printf(" that->add(client, id, qMin(that->m_globalVersion, version));\n"); + printf(" that->add(client, id, version);\n"); printf(" }\n"); printf("\n");