fix: harden Qt Wayland listener generation

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
This commit is contained in:
2026-05-07 20:54:59 +01:00
parent f194ae1530
commit ac04a7eb36
3 changed files with 16 additions and 2 deletions
@@ -0,0 +1,11 @@
--- a/src/tools/qtwaylandscanner/qtwaylandscanner.cpp
+++ b/src/tools/qtwaylandscanner/qtwaylandscanner.cpp
@@ -1294,7 +1294,7 @@ bool Scanner::process()
printf(" void %s::init_listener()\n", interfaceName);
printf(" {\n");
- printf(" %s_add_listener(m_%s, &m_%s_listener, this);\n", interfaceName, interfaceName, interfaceName);
+ printf(" if (m_%s) %s_add_listener(m_%s, &m_%s_listener, this);\n", interfaceName, interfaceName, interfaceName, interfaceName);
printf(" }\n");
}
}