Skip to content

Commit

Permalink
Do not change compositor options when not defined
Browse files Browse the repository at this point in the history
If Anaconda will set keyboard layouts to compositor but options are
missed then we shouldn't change the compositor options but rather use
what is already set.

This will avoid problematic behavior of changing what user has defined
in the system or similar cases. Also we have this tested in
kickstart-tests, so this commit is fixing these tests.
  • Loading branch information
jkonecny12 committed Sep 13, 2024
1 parent 48c6b56 commit 9679992
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions pyanaconda/modules/localization/localed.py
Original file line number Diff line number Diff line change
Expand Up @@ -228,9 +228,6 @@ def _set_layouts(self, layouts_variants, options=None, convert=False):
variants = []
parsing_failed = False

log.debug("Setting system/compositor keyboard layouts: '%s' options: '%s' convert: '%s",
layouts_variants, options, convert)

for layout_variant in (nonempty for nonempty in layouts_variants if nonempty):
try:
(layout, variant) = parse_layout_variant(layout_variant)
Expand All @@ -244,9 +241,17 @@ def _set_layouts(self, layouts_variants, options=None, convert=False):
if not layouts and parsing_failed:
return

if options is None:
options = self.options
log.debug("Keyboard layouts for system/compositor are missing options. "
"Use compositor options: %s", options)

layouts_str = ",".join(layouts)
variants_str = ",".join(variants)
options_str = ",".join(options) if options else ""
options_str = ",".join(options)

log.debug("Setting system/compositor keyboard layouts: '%s' options: '%s' convert: '%s",
layouts_variants, options, convert)

self._localed_proxy.SetX11Keyboard(
layouts_str,
Expand Down

0 comments on commit 9679992

Please sign in to comment.