Fixes for undefined behaviour on signed shift
Change literal 1 to unsigned to allow safe bitshift of 31.
Caught by cppcheck.
Make 0xFF unsigned to prevent a left shift into signed bit.
Spotted by @orestisf1993
copy has been used before this point - so it is too late to be concerned
about a NULL pointer now.
This is OK as sstrdup() calls err() on NULL return from the underlying
strdup() call.
Raised by cppcheck.
strlen already assumes that the string is NULL-terminated.
Like in https://github.com/i3/i3status/pull/312 but for whatever reason
gcc didn't warn about this here.
If i3-msg is invoked with -t subscribe, it will wait for the first event
matching the given payload, before exiting.
For instance, get the number of the next focused workspace with:
i3-msg -t subscribe '[ "workspace" ]' | jshon -e current -e num
Like inotifywait, the -m flag allows to wait indefinitely for events,
instead of exiting right after receiving the first one.
For example, continuously monitor the names of focused windows with:
i3-msg -t subscribe -m '[ "window" ]' | jq .container.name
i3-msg currently exits right after sending the IPC message if the quiet
flag is set. This means that if an error occurred when issuing a
command, e.g. "i3-msg -q foobar", it gets silently ignored.
What we really want is to just skip printing but still check the reply.
At the same time, explicitly print the reply when we need to, instead of
using an exit label.
For compatiblity reasons, Wine will request iconic state and cannot
ensure that the WM has agreed on it; immediately revert to normal to
avoid being stuck in a paused state.
Now clicks begin at the start of the "actual" block, offsets and
separators don't trigger click events. The width property is now just
the width of the block, including border.
Fixes#3380.
- Add routine that will refocus the expected window on test failure.
Thus, failure on one test will not make others fail.
- Remove some redundant commands, prefer fresh_workspace for screen
changing.
- Kill previous windows between sections if the next section does not
depend on the previous layout.
- Improve / add various error messages.
- Replace all `LOG(…); ysuccess(false);` with `yerror(…);`.
- switch_mode: Remove redundant "ERROR:" ELOG string.
- cmd_move_con_to_workspace*: Make sure that we don't try to move an
empty workspace to another workspace. This can be problematic when we
match a workspace using command criteria (eg marks) and the target is a
non-existing workspace. We create the new workspace but since nothing is
moved there, we are left with an empty workspace. See added testcase.