if (r < 0)
return r;
if (r == 0) {
- log_notice("No conversion found for virtual console keymap \"%s\".", vc->keymap);
*ret = (X11Context) {};
return 0;
}
if (!streq(vc->keymap, a[0]))
continue;
- r = x11_context_copy(ret,
+ return x11_context_copy(ret,
&(X11Context) {
.layout = empty_or_dash_to_null(a[1]),
.model = empty_or_dash_to_null(a[2]),
.variant = empty_or_dash_to_null(a[3]),
.options = empty_or_dash_to_null(a[4]),
});
- if (r < 0)
- return r;
-
- log_info("The virtual console keymap '%s' is converted to X11 keyboard layout '%s' model '%s' variant '%s' options '%s'",
- vc->keymap, strempty(ret->layout), strempty(ret->model), strempty(ret->variant), strempty(ret->options));
- return 0;
}
}
r = find_legacy_keymap(xc, &keymap);
if (r < 0)
return r;
- if (r == 0)
- /* We search for layout-variant match first, but then we also look
- * for anything which matches just the layout. So it's accurate to say
- * that we couldn't find anything which matches the layout. */
- log_notice("No conversion to virtual console map found for \"%s\".", xc->layout);
- else
- log_info("The X11 keyboard layout '%s' is converted to virtual console keymap '%s'",
- xc->layout, strempty(keymap));
*ret = (VCContext) {
.keymap = TAKE_PTR(keymap),
return sd_bus_error_set_errnof(error, r, "Failed to convert keymap data: %m");
}
+ if (x11_context_isempty(&converted))
+ log_notice("No conversion found for virtual console keymap \"%s\".", strempty(in.keymap));
+ else
+ log_info("The virtual console keymap '%s' is converted to X11 keyboard layout '%s' model '%s' variant '%s' options '%s'",
+ in.keymap, strempty(converted.layout), strempty(converted.model), strempty(converted.variant), strempty(converted.options));
+
/* save the result of conversion to emit changed properties later. */
x_needs_update = !x11_context_equal(&c->x11_from_vc, &converted) || !x11_context_equal(&c->x11_from_xorg, &converted);
} else
return sd_bus_error_set_errnof(error, r, "Failed to convert keymap data: %m");
}
+ if (vc_context_isempty(&converted))
+ /* We search for layout-variant match first, but then we also look
+ * for anything which matches just the layout. So it's accurate to say
+ * that we couldn't find anything which matches the layout. */
+ log_notice("No conversion to virtual console map found for \"%s\".", strempty(in.layout));
+ else
+ log_info("The X11 keyboard layout '%s' is converted to virtual console keymap '%s'",
+ in.layout, converted.keymap);
+
/* save the result of conversion to emit changed properties later. */
convert = !vc_context_equal(&c->vc, &converted);
}