xfixes: clean up request handling
- Feb 21, 2025
-
-
Enrico Weigelt, metux IT consult . authored
In general safer coding practise to always use calloc() instead of risking forgetting to zero-out some fields. Signed-off-by:
Enrico Weigelt, metux IT consult <info@metux.net>
-
Enrico Weigelt, metux IT consult . authored
Canonicalize all reply structs onto stack allocation and static initialization, like already done in most other extension. So make the code easier to understand and allow further simplifications by subsequent commits (we can then use generic macros for doing the actual sending, as well as byteorder swapping, size computation, etc), Also gaining a little bit efficiency by skipping some heap allocations. Dynamically sized payload buffers (where the upper bound isn't known), are still allocated on heap. Signed-off-by:
Enrico Weigelt, metux IT consult <info@metux.net>
-
Enrico Weigelt, metux IT consult . authored
The dispatcher functions are much more complex than they're usually are (just switch/case statement). Bring them in line with the standard scheme used in the Xserver, so further steps become easier. It's also much cleaner to use the defines from proto headers instead of raw numbers. Signed-off-by:
Enrico Weigelt, metux IT consult <info@metux.net>
-
Enrico Weigelt, metux IT consult . authored
The current way of switching between Xinerama and single-screen handlers is quite complicated and needs call vector tables that are changed on the fly, which in turn makes dispatching more complicated. Reworking this into a simple and straight code flow, where individual request procs just look at a flag to decide whether to call the Xinerama or single screen version. This isn't just much easier to understand (and debug), but also removes the need or the call vectors, thus allowing further simplification of the dispatcher. Signed-off-by:
Enrico Weigelt, metux IT consult <info@metux.net>
-