mirror of
https://github.com/swaywm/sway.git
synced 2025-11-29 06:59:46 -05:00
Fix output config retrieval for new outputs
This removes `output_find_config`, which would take the first matching output config it found. This is fine if only a name output config, identifier output config, or even just wildcard exist, but if there is a name output config and identifier output config, they are not merged. Instead, this introduces find_output_config, which is just a wrapper for `get_output_config`. This ensures that both the name and identifier output configs are respected. This fixes the following case: - For simplicity in this example, remove all output configs from config - Run `swaymsg output <name> bg #ff0000 solid_color` - Run `swaymsg output <identifier> scale 2` - Disconnect and reconnect output Without this, the output will have the background, but not the scale. With this, the output will have both the background and scale
This commit is contained in:
parent
2578669de7
commit
3106ef23a7
5 changed files with 10 additions and 34 deletions
|
|
@ -533,7 +533,7 @@ static void handle_destroy(struct wl_listener *listener, void *data) {
|
|||
static void handle_mode(struct wl_listener *listener, void *data) {
|
||||
struct sway_output *output = wl_container_of(listener, output, mode);
|
||||
if (!output->configured && !output->enabled) {
|
||||
struct output_config *oc = output_find_config(output);
|
||||
struct output_config *oc = find_output_config(output);
|
||||
if (output->wlr_output->current_mode != NULL &&
|
||||
(!oc || oc->enabled)) {
|
||||
// We want to enable this output, but it didn't work last time,
|
||||
|
|
@ -634,7 +634,7 @@ void handle_new_output(struct wl_listener *listener, void *data) {
|
|||
output->damage_destroy.notify = damage_handle_destroy;
|
||||
wl_list_init(&output->swaybg_client_destroy.link);
|
||||
|
||||
struct output_config *oc = output_find_config(output);
|
||||
struct output_config *oc = find_output_config(output);
|
||||
if (!oc || oc->enabled) {
|
||||
output_enable(output, oc);
|
||||
} else {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue