Commit graph

32 commits

Author SHA1 Message Date
Consolatis
3bd5964e34 CI: verify early exit on missing fonts 2025-05-09 20:20:54 +01:00
Johan Malm
2e10fe6f41 Add scripts/rip.c
...to extract pull-request and issue reference from NEWS.md and output
them as GH URLs.
2025-02-04 06:37:00 +00:00
tinyboxvk
1a6dd845a2 Fix typos
Signed-off-by: tinyboxvk <13696594+tinyboxvk@users.noreply.github.com>
2025-01-09 06:59:57 +00:00
Consolatis
ea58ab0259 scripts: add wl_compcheck.py
Simple utility to allow protocol and version comparison between different
running compositors. This can be used to detect missing protocols or
versions in labwc. See for example this result when running against the
current labwc master and sway 1.10 (nested, results on DRM may differ):

  Protocols missing from labwc @ wayland-0
  ext_transient_seat_manager_v1                   1
  wl_compositor                                   6  (has version 5)
  wp_alpha_modifier_v1                            1
  wp_content_type_manager_v1                      1
  xdg_wm_base                                     5  (has version 3)
  zwp_keyboard_shortcuts_inhibit_manager_v1       1

  Protocols missing from sway @ wayland-1
  wl_drm                                          2
  zcosmic_workspace_manager_v1                    1
2024-12-10 21:05:31 +00:00
Johan Malm
d2a864dfe7 Add lsan.supp
...so suppress errors from ASAN with EGL renderer.

Also add a script to simplify running with sanitizer and this suppression
file.

Related-to: #2331
2024-11-26 21:29:09 +00:00
Consolatis
665b39259a CI: make the smoke test start foot 2024-11-26 06:12:46 +01:00
Consolatis
af3054394e CI: add address sanitizer to Debian runtime tests 2024-11-26 06:12:46 +01:00
John Lindgren
c9e0a6e125 icon-loader: add a new loader for XPM icons, used by many legacy X11 apps
Adapted from gdk-pixbuf, see the original at:

  https://gitlab.gnome.org/GNOME/gdk-pixbuf/-/blob/master/gdk-pixbuf/io-xpm.c

rgb.txt is from X.org, see:

  https://gitlab.freedesktop.org/xorg/app/rgb/-/blob/master/rgb.txt

Differences from the gdk-pixbuf version:

- GdkPixbuf replaced with struct lab_data_buffer
- Progressive and in-memory loading code removed
- Two functions that had separate BSD copyright rewritten
- Stores colors as ARGB32 earlier in the decoding process for efficiency
- Limited to 1024x1024 px and 1024 colors to prevent abuse
- Uses struct buf to build strings, in place of manual g_new/g_realloc
- Uses xzalloc/xznew_n for other memory allocations
- Uses g_strlcpy in place of banned strcpy/strncpy/strncat
- Uses standard C types (int, bool, etc.) in place of the GLib ones
- Follows labwc coding style (whitespace, braces, letter case, etc.)
- Et cetera ...

v2: add Perl fixes from @domo141
2024-09-30 21:17:19 -04:00
Consolatis
4bda13d870 CI: increase speed of codestyle check
by running up to nproc ones in parallel
2024-08-04 21:01:50 +02:00
Consolatis
6fe3df34ca CI: add atof() to banned list 2024-05-13 11:06:04 +02:00
John Lindgren
45c60de263 common/font: avoid rendering semi-transparent background twice
Fill with the background color first only if the background color is
opaque. This is necessary for subpixel rendering to work properly (it
does not work on top of transparency).

However, if the background color is not opaque, leave the buffer
unfilled (completely transparent) since the background is already
rendered by the scene element underneath. In this case we have to
disable subpixel rendering.

v2: use 0.999 alpha cutoff and fix CodeStyleCheck

Fixes: (the rest of) #1684
2024-04-08 09:55:37 -04:00
Consolatis
51cdefa93e CI: rewrite smoke test and support LABWC_RUNS env var 2024-03-16 18:42:47 +01:00
Consolatis
53fc8d5e39 CI: add simple runtime test 2024-03-14 00:42:13 +01:00
Johan Malm
f0b72e3af7 ci: include scripts/find-banned.sh
...to search for functions which have been banned from our code base,
because they're too easy to misuse, and even if used correctly,
complicate audits, cause inconsistencies and/or make static analysis
harder.
2023-12-29 11:47:55 +01:00
Consolatis
042215f856 common/array.h: add wl_array_for_each_reverse macro 2023-11-21 22:31:05 +01:00
John Lindgren
5cb1d0e83f common: add and use CONNECT_SIGNAL macro
This makes the code a bit more readable IMHO (and forces us to be
consistent with event handler function names).

Adjust scripts/checkpatch.pl to not complain.
2023-10-21 12:37:42 +01:00
Johan Malm
8d3b15576b Add ARRAY_SIZE() macro 2023-09-19 22:03:59 +01:00
Johan Malm
c62df26c2a Support svg buttons
In the theme directory add close-{active,inactive}.svg instead of
close.xbm - and similarly for iconify, menu and max.
2023-09-17 19:26:41 +01:00
Johan Malm
7fde7ed2cc view: add for_each_view()
Helped-by: @Consolatis and @heroin-moose (by a significant amount)
2023-08-20 09:56:49 +01:00
Johan Malm
be1ef03412 find-idents.c: fix typo
...which so far has caused any bugs!
2023-08-12 21:31:46 +02:00
Johan Malm
c4b9173afd checkpatch.pl: check single statement brace 2023-08-11 21:54:52 +01:00
Johan Malm
e06a8cfc7a find-banned: support reading multiple files from stdin 2023-07-06 18:04:55 +01:00
Johan Malm
684731200f find-banned: print filename with each unwanted token 2023-07-06 18:04:55 +01:00
Consolatis
309843c9c6 scripts/helper/find-idents.c: handle single line comment tokens 2023-07-06 18:04:55 +01:00
Johan Malm
29031a4c85 Add scripts/find-banned.sh 2023-07-06 18:04:55 +01:00
Johan Malm
2bbeea0fc2 checkpatch.pl: allow xmlFree in CamelCase format
...to avoid 'Avoid CamelCase' warning.
2023-07-04 06:01:47 +01:00
Johan Malm
0958e88c75 checkpatch.pl: remove 'spaces preferred around that...' warning
...because it gives a false positive for "xmlChar *foo" saying it should
be "xmlChar * foo".
2023-07-04 06:01:47 +01:00
Consolatis
1995a33df9 CodeStyle: prevent space in code indents 2023-01-31 21:22:40 +00:00
Johan Malm
6a242d5739 checkpatch: ignore += UNNECESSARY_ELSE 2022-11-03 23:01:52 +01:00
Johan Malm
4305f54e37 checkpatch: add scripts/check for batch processing
Co-Authored-By: @Consolatis
2022-11-03 19:20:23 +00:00
Johan Malm
a361bae699 checkpatch: patch to suit labwc coding style
Coding style specific changes include:

- Accept pango, glib and libxml2 CamelCase variables
- Remove "need consistent spacing around '*'" warning
- Do not warn about "structs that should be const"
- Do not warn on braces {} around single statements
- Do not warn about braces {} for single statement blocks
- Do not warn about wanting { on previous line for functions
- Remove check for missing blank line after declaration
- Ignore SPLIT_STRING COMPLEX_MACRO PREFER_KERNEL_TYPES
  LOGICAL_CONTINUATIONS PARENTHESIS_ALIGNMENT OPEN_ENDED_LINE
  MACRO_ARG_REUSE PREFER_FALLTHROUGH ARRAY_SIZE INITIALISED_STATIC

Other changes include:

- Do not complain about missing spelling.txt
- Print filename for each file, but no summary line
2022-11-03 19:20:23 +00:00
Johan Malm
b4b3e1b28d checkpatch: import checkpatch.pl from Linux kernel
https://raw.githubusercontent.com/torvalds/linux/4ce9f970457899defdf68e26e0502c7245002eb3/scripts/checkpatch.pl
2022-11-03 19:20:23 +00:00