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

Add window_background_color config setting #144

Merged
merged 2 commits into from
Jun 26, 2024

Conversation

Euwiiwueir
Copy link
Contributor

@Euwiiwueir Euwiiwueir commented Jun 23, 2024

Note: in QubesOS/qubes-issues#9304 I wrote:

My instinct is that an option of black or white is good enough; allowing the color to be an arbitrary hue perhaps grants this issue more attention than it deserves. Also, the implementation is simpler. But I defer to others.

I changed my mind about this in the meantime, I like dark blue, and in this change I allow the setting to be an arbitrary user-selected color. This obligates some error checking around strtoul and XAllocNamedColor. (An input sanitizing step upstream in memory-safe qvm-features -- QubesOS/qubes-issues#7730 -- would be a good complement.) If the user-selected color is invalid, qubes-guid bails with an error logged to /var/log/qubes/guid.<vm>.log.

I think this is ok? But let me know.

Fixes QubesOS/qubes-issues#9304

Also add some minimum effort error checking/correction as this will soon
be processing a user-entered value. The extant code path should not be
affected as input color values are correctly specified.

Color values can be words or hex values.

Accepted:
- 'black'
- 'white'
- 'blue'
- 'dark blue'
- '0x0000ff'

Rejected with logged error + exit:
- 'nonsense color'
- '0xZZZZZZ'

Related to: QubesOS/qubes-issues#9304
This configuration setting allows changing the background pixel for
local windows that display content of VM windows. Generally the color is
only visible rarely and briefly. Previous to this commit the color was
hardcoded to white which is suboptimal for users running dark desktop
styling.

This is the downstream translation of these VM features:

- gui-window-background-color
- gui-default-window-background-color

Testing process:

  [user@dom0 ~]$ qvm-features dom0 gui-default-window-background-color <color>
  [user@dom0 ~]$ qvm-run --dispvm=default-dvm --service qubes.StartApp+debian-xterm
  # (Then play with the terminal's window to expose the color)

Related to: QubesOS/qubes-issues#9304
@andrewdavidwong
Copy link
Member

Suggestion: If you intend for this PR to fix/close issue QubesOS/qubes-issues#9304 and would like it to be linked to that issue automatically, use:

Fixes QubesOS/qubes-issues#9304

instead of

For: QubesOS/qubes-issues#9304

in the PR and/or commit message.

Fixes is a special keyword that GitHub will recognize. For more information, see:

@Euwiiwueir
Copy link
Contributor Author

Suggestion: If you intend for this PR to fix/close issue QubesOS/qubes-issues#9304 and would like it to be linked to that issue automatically, use:

Fixes QubesOS/qubes-issues#9304

Thanks. My hesitation was that there are two pull requests that only jointly resolve the issue. Should one or both have Fixes? Well, I suppose it doesn't matter too much either way.

@marmarek
Copy link
Member

marmarek commented Jun 24, 2024 via email

@marmarek marmarek merged commit 51399c3 into QubesOS:main Jun 26, 2024
2 checks passed
@Euwiiwueir Euwiiwueir deleted the issue-9304 branch June 26, 2024 17:05
@fepitre
Copy link
Member

fepitre commented Aug 29, 2024

I think an update should be done for documentation: https://www.qubes-os.org/doc/config-files/

@andrewdavidwong
Copy link
Member

I think an update should be done for documentation: https://www.qubes-os.org/doc/config-files/

I suggest opening an issue for that.

@Euwiiwueir
Copy link
Contributor Author

Here is the issue: QubesOS/qubes-issues#9306

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow the gui-daemon background color to be configurable
4 participants