Ensure we have got sensible toplevel width/height before trying to set
size on configure.
This protects against an edge case experienced when TTY switching between
labwc and Xfce running on XOrg on another TTY. It is not yet clear what
causes this, but hitting wlroots assert() is not great, so let's protect
against it.
Written-by: @Tamaranch
Fixes: #3608
Codespell(1)-pointed typos in files listed by `git ls-files`
(sans checkpatch.pl and possibly some others). Removed some
extra spaces. Added a few missing trailing periods.
`Default is ...`. Added spaces in ' />' where missing
(sans e.g. wayland protocol and t/* files).
Fit some lines in docs/*.scd to 80 colums.
Used git grep commands (to find similar cases):
$ git grep -n '\S/>'
$ git grep -nF '. '
$ git grep -n '[^\t*'\'',{#]\t'
$ git grep -ni 'default '
No functional change. No change in *.[ch] line numbers.
When -t or --window-title is supplied, its required argument is treated as a
format string where `%o` is replaced by the `wlr-output`'s `name` when we set
the window title.
This uses glib to split and join the format string because our own
`string-helpers` library only has `str_join`. Otherwise using `string-helpers`
would have been preferred.
v2: Switch XRGB to XBGR
v3: Rewrite HDR mode checking and setting
v4: Restructure HDR support detection
v5: Fix code style
v6: Fix old style function declaration
v7: This function should be declared static
v8: This helper function can accept a const struct on input
v9: Rebase now that 0.20 is merged
v10: Rewrite with multiple color format attempts
v11: Add in the parts that accidentally got left in my
original color-management-v1 patch
v12: Add missing function prototype
v13: Apply suggested changes
v14: Changed HDR application setup in new output
v15: Rewrite configure_new_output to use lab_wlr_scene_output_commit
v16: Fixed application of HDR on external mode or output config change
v17: Fixed it for real this time instead of crashing
v18: Moved the effective resolution collection, plus one style change.
Menu accelerators are one-letter mnemonics to quickly select/exec
items from the current menu. For each menu item, the accelerator is
defined as the first character of the item label, converted to
lowercase. A different accelerator can be explicitly defined in
menu.xml with the special '_' character before the target letter.
- Add a field `accelerator` to the `menuitem` struct
- Implement `menu_item_select_by_accelerator()`
Example:
The accelerator for an item with the label "e_macs" is 'm'.
This function behaves identically to `scaled_font_buffer_update()`
but allows setting the text as pango markup, supporting further
customization like underscores.
This fixes a warning in gcc16 below:
../src/img/img-xpm.c: In function ‘xpm_load_to_surface’:
../src/img/img-xpm.c:354:33: warning: variable ‘xcnt’ set but not used [-Wunused-but-set-variable=]
354 | for (int n = 0, xcnt = 0; n < wbytes; n += cpp, xcnt++) {
| ^~~~