Age | Commit message (Collapse) | Author |
|
See discussion in https://gitlab.freedesktop.org/wlroots/wlroots/-/merge_requests/4555
|
|
|
|
References: https://gitlab.freedesktop.org/wlroots/wlroots/-/merge_requests/4097
Closes: https://github.com/swaywm/sway/issues/7830
|
|
|
|
While at it, use an int for the config field, just like we do for
all other fields.
|
|
The "dpms" command refers to VESA Display Power Management
Signaling, a deprecated standard. It's superseded by VESA DPM.
Instead of tying out command name to a particular standard, use the
neutral term "power".
|
|
This also fixes an invalid strlen invocation on uninitialized memory.
|
|
|
|
This makes it possible to hint to the renderer and backends how many
bits per channel the buffers that the compositor draws windows onto
should have. Renderers and backends may deviate from this if they
do not support the formats with higher bit depth.
|
|
Only works with DRM backend.
|
|
Logic that obtains current DPMS state is put inside the handler.
sway_output from which the current DPMS state will be obtained is selected by the following logic:
* For '-' and '--' the focused output is used;
* For '*' error "Cannot apply toggle to all outputs" is reported;
* For everything else all_output_by_name_or_id() is used.
Fixes #5929.
|
|
Prevent them from being used in the config file.
This is a breaking config file change.
References: https://github.com/swaywm/sway/issues/5236
|
|
This enables/disables adaptive synchronization on the output.
For now, the default is disabled because it might cause flickering on
some hardware if clients don't submit frames at regular enough
intervals. In the future an "auto" option will only enable adaptive sync
if a fullscreen client opts-in via a Wayland protocol.
|
|
This patch makes it so users that have configured their screen with a
transform don't have to update their config after the wlroots breaking
change.
References: https://github.com/swaywm/wlroots/pull/2023
|
|
This wouldn't have any effect if the transform was flipped.
|
|
|
|
This allows for shell path expansion for input_cmd_xkb_file. The logic
has been extracted from output_cmd_background
|
|
|
|
This forces to set the mode as a custom mode.
|
|
discussed in #4136, this can't handle wildcard but won't crash.
|
|
Many laptop screens report unknown subpixel order. Allow users to manually set subpixel hinting to work around this.
Addresses https://github.com/swaywm/sway/issues/3163
|
|
This validates the color and fallback color in `output_cmd_background`
to ensure that only colors of the form `#RRGGBB` are accepted.
|
|
|
|
If output_cmd_background is given a valid mode as the first argument,
then there is no file given and an error should be returned.
join_args should not be called with an argc of zero since it sets the
last character to the null terminator. With an argc of zero, the length
is zero causing a heap buffer overflow when setting the byte before the
start of argv to '\0'. This probably will not ever generate a segfault,
but may cause data corruption to whatever is directly before it in
memory. To make other such cases easier to detect, this also adds a
sway_assert in join_args when argc is zero.
|
|
|
|
|
|
|
|
This commit mostly duplicates the wlr_log functions, although
with a sway_* prefix. (This is very similar to PR #2009.)
However, the logging function no longer needs to be replaceable,
so sway_log_init's second argument is used to set the exit
callback for sway_abort.
wlr_log_init is still invoked in sway/main.c
This commit makes it easier to remove the wlroots dependency for
the helper programs swaymsg, swaybg, swaybar, and swaynag.
|
|
swaybg used to be invoked with sh, which made escaping necessary. This is no
longer necessary.
Fixes https://github.com/swaywm/sway/issues/3456
|
|
Patch tested by compiling with `__attribute__ ((format (printf, 2, 3)))`
applied to `cmd_results_new`.
String usage constants have been converted from pointers to arrays when
encountered. General handler format strings were sometimes modified to
include the old input string, especially for unknown command errors.
|
|
This combines `output_by_name` and `output_by_identifier` into a single
function called `output_by_name_or_id`. This allows for output
identifiers to be used in all commands, simplifies the logic of the
callers, and is more efficient since worst case is a single pass through
the output list.
|
|
Adds the function `config_add_swaynag_warning(char *fmt, ...)` so that
handlers can add warnings to the swaynag config log in a uniform way.
The formatting is identical to errors and include the line number, line,
and config path.
This also alters the background file access warning to use the function
and introduces a warning for duplicate bindings.
|
|
This commit enhances the output transform
command with options for a relative transform,
i.e. the provided transform will be applied as
an offset to the current transform. Append
`clockwise` to rotate clockwise from the current
rotation, or `anticlockwise` to rotate in the
opposite direction.
For example, if the output LVDS-1 is rotated
90 degrees clockwise, the command
`output LVDS-1 transform 90 clockwise`
will rotate the display to 180 degrees.
All transform options are supported,
including flipped transforms.
Relative transforms can only be applied to
a single output and cannot be used with
a wildcard (*) output specifier.
|
|
This changes it back so the path given to swaybg is enclosed in quotes.
Additionally, the only character that is escaped in the path stored is
double quotes now. This makes it so we don't need to keep an exhaustive
list of characters that need to be escaped.
The end user will still need to escape these characters in their config
or when passed to swaybg.
|
|
wordexp p is now initialized to {0} to prevent a segfault on wordfree
in the failure case.
File paths with single quotes and double quotes are now supported. The
quote can either be wrapped in the other quote or escaped with three
backslashes.
Additionally to make passing file paths with double quotes to swaybg
easier, instead of enclosing the path given to swaybg in quotes, all
spaces, single quotes, and double quotes in the resulting path are now
escaped with a single backslash.
|
|
|
|
|
|
|
|
On FreeBSD, snprintf and vsnprintf are visible only if
_XOPEN_SOURCE >= 600.
|
|
|
|
This allows for a color to be set when the wallpaper does not fill the
entire output. If specified, the fallback color is also used when the
image path is inaccessible.
|
|
|
|
|
|
|
|
Found through static analysis.
|
|
Found through static analysis.
|
|
- fixes a double-free error when access() failed.
- refactor code to make memory managment (alloc/free) more straightforward
- do not bring the temporary wordexp_t struct around
- do not postpone errors handling
|
|
- src must be free after join_args()
- wordfree must bee used after wordexp
|
|
if src is NULL due to a previous error we cannot use it in the command
result string.
Moreover if `src` points to `p.we_wordv[0]` we cannot use it after
`wordfree(&p)` in the command result string.
Bonus feature: If there was an error accessing the file, the string
rapresentation of the error is now included in the command result
string.
|
|
|