labwc/include/common
John Lindgren 16c5373be5
Some checks are pending
labwc.github.io / notify (push) Waiting to run
tree-wide: use die_if_null() for wlr_scene alloc failures
wlr_scene_*_create() functions all allocate memory via calloc() and
return NULL if the allocation fails. Previously, the failures were
handled in any of 3 different ways:

 - sending a wayland protocol error
 - exiting labwc with an error
 - segfault (no NULL check at all)

Since labwc does not attempt to survive heap exhaustion in other
allocation paths (such as `znew`), it seems more consistent to use the
same die_if_null() check used in those paths to exit with an error.

For the three most common create() functions (tree, rect, buffer),
add small lab_wlr_ wrappers to common/scene-helpers.
2026-03-15 21:26:37 +00:00
..
array.h array: use die_if_null() from common/mem.c 2025-09-07 19:17:18 +09:00
border.h Move border-struct to common/border.h for sharing 2023-06-26 06:04:07 +01:00
box.h box: factor out box_center() 2025-12-02 14:57:41 +09:00
buf.h Don't remove newlines when parsing config, menu and XBM 2025-10-17 22:08:41 +09:00
dir.h config: support merging multiple config files 2024-01-18 20:20:36 +00:00
edge.h common: flesh out enum lab_edge and prefer over wlr_edges/wlr_direction 2025-08-26 20:36:43 -04:00
fd-util.h Replace _ with - in source file names 2024-05-22 07:10:51 +01:00
file-helpers.h common/file-helpers.c: share file_exists() to reduce duplication 2023-09-17 19:26:41 +01:00
font.h common/font: add scaled_font_buffer_create_for_titlebar() 2025-06-18 15:48:24 -04:00
graphic-helpers.h include: add missing header dependencies 2025-07-29 21:51:56 +01:00
lab-scene-rect.h Replace multi_rect with lab_scene_rect 2025-06-10 06:03:03 +09:00
list.h common/list: add WL_LIST_INIT() macro 2024-11-21 20:31:41 +00:00
macros.h Disable all output leasing due to a wlroots UAF 2025-07-06 19:59:43 +01:00
match.h docs: simplify description of shell wildcard patterns 2024-12-01 20:17:04 +01:00
mem.h array: use die_if_null() from common/mem.c 2025-09-07 19:17:18 +09:00
node-type.h Use "cycle" instead of "osd" across the codebase 2025-11-30 16:20:16 +09:00
nodename.h include: reduce unnecessary #includes 2025-09-07 19:34:30 +09:00
parse-bool.h include: add config/types.h 2025-08-21 16:55:25 +09:00
parse-double.h common: validate and properly parse floats 2024-04-02 10:37:50 -04:00
scene-helpers.h tree-wide: use die_if_null() for wlr_scene alloc failures 2026-03-15 21:26:37 +00:00
set.h key-state.c: generalize set operations 2024-10-13 20:45:16 +01:00
spawn.h Fix typos 2025-01-09 06:59:57 +00:00
string-helpers.h string-helpers: update comments for str_equal() 2026-02-04 19:14:51 +09:00
xml.h include/common/xml.h: fix declaration/definition arg name difference 2025-09-30 02:38:13 +02:00