Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fallback color does not fill the screen background when the background file does not exist. #8556

Open
jonatasrs opened this issue Jan 30, 2025 · 0 comments · May be fixed by #8558
Open

Fallback color does not fill the screen background when the background file does not exist. #8556

jonatasrs opened this issue Jan 30, 2025 · 0 comments · May be fixed by #8558
Labels
bug Not working as intended

Comments

@jonatasrs
Copy link

  • Sway Version:

    • sway version 1.10.1
    • Debian GNU/Linux trixie/sid
  • Configuration File:

output HDMI-A-1 {
  background ~/Imagens/background.jpg fill #000000
  pos 0 0
}
  • Description:
    • If the specified file cannot be accessed, a fallback color do not is provided to the output. Sway show config file error on top of screen, about the file unable to access:

The man page describes that this is possible, if I understand correctly it would not be necessary to generate an error if the file cannot be accessed and if there is a fallback color in the configuration to fill the background.

output <name> background|bg <file> <mode> [<fallback_color>]
Sets the wallpaper for the given output to the specified file, using the given scaling mode (one of "stretch", "fill", "fit", "center", "tile"). If the specified file cannot be accessed or if the image does not fill the entire output, a fallback color may be provided to cover the rest of the output. fallback_color should be specified as #RRGGBB. Alpha is not supported.

@jonatasrs jonatasrs added the bug Not working as intended label Jan 30, 2025
sahinf added a commit to sahinf/sway that referenced this issue Feb 3, 2025
currently, the output background command handler prematurely
returns with an error if the background file cannot be accessed.
It should only error if user did not provide fallback color.

closes swaywm#8556
@sahinf sahinf linked a pull request Feb 3, 2025 that will close this issue
sahinf added a commit to sahinf/sway that referenced this issue Feb 5, 2025
currently, the output background command handler prematurely
returns with an error if the background file cannot be accessed.
It should only error if user did not provide fallback color.

closes swaywm#8556

Changes

- Introduce variables to avoid uneccessary writing on output members
- Log a debug message when fallback is being used over inaccessible
   file
- Always parse the background color and swaynag warn if it is incorrect

- when updating output member variables, free previous values
- add cleanup label and goto it if `strdup` fails
- Move output->member initializations to before parsing fallback, Also
free and init output->background as well
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Not working as intended
Development

Successfully merging a pull request may close this issue.

1 participant