Testcase: set title of foot to an invisible string (here LTR)
First one works and correctly sets the title, 2nd one crashes
- printf "\x1b]0;\xe2\x80\x8e%s\x07" "some title"
- printf "\x1b]0;\xe2\x80\x8e%s\x07" ""
Reported-by: Domo via IRC
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.
We used to store both `pressed` keys and `bound` keys and derive
`pressed_sent` keys from them, which are notified to the client when
switching focus. But I think this was overengineered and we can remove
`pressed` keys and `bound` keys. Instead we now directly modify
`pressed_sent` keys just before calling `wlr_seat_keyboard_notify_key()`.
Technically we could even remove `pressed_sent` keys as they are
duplicated in wlr_seat->keyboard_state.keyboard->keycodes, but we keep
`pressed_sent` keys as it is easier to access.
The only place which required `bound` keys was `handle_modifiers()`.
This function checked `bound` keys to keep widnow switcher alive when
Alt-Tab is pressed and only the Alt modifier is released. The window
switcher is then finished when Tab key is released. I replaced the check
with `(seat->keyboard_group->keyboard.num_keycodes > 0)`. This slightly
changes the behavior; when Alt-Tab and any other key e.g. X are pressed
and Tab key and Alt modifier are released, the window switcher is now
kept alive. But I don't think this breaks any workflows for users.
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++) {
| ^~~~
dbus-update-activation-environment and systemctl --user import-environment
were fired asynchronously via spawn_async_no_shell, racing with the autostart
script. Any systemd user service started from autostart (e.g. via
labwc-session.target) could start before the import completed, leaving
WAYLAND_DISPLAY and related variables absent from its environment and those
of any apps it launches.
Run both commands synchronously via a new spawn_sync_no_shell helper so
the import is guaranteed to complete before the autostart script executes.
Each scroll button draws its own full border, so placing the up and down
buttons flush produced a divider twice the intended thickness. Shift
button_down up by one border width and extend its height accordingly so
its top border overlaps button_up's bottom border.
Also drop a stray \`+ border\` offset from the scroll button text Y-position
that was pushing the label below the button's center.