Add FocusOutput action

Fixes #806

Suggested-by: @EysseW
Tested-by: @EysseW
This commit is contained in:
Consolatis 2023-03-05 17:16:23 +01:00 committed by Johan Malm
parent 037dace5bc
commit a0b5a80ce1
5 changed files with 76 additions and 0 deletions

View file

@ -8,6 +8,7 @@
#define _POSIX_C_SOURCE 200809L
#include <assert.h>
#include <strings.h>
#include <wlr/types/wlr_buffer.h>
#include <wlr/types/wlr_drm_lease_v1.h>
#include <wlr/types/wlr_output.h>
@ -458,6 +459,21 @@ output_from_wlr_output(struct server *server, struct wlr_output *wlr_output)
return NULL;
}
struct output *
output_from_name(struct server *server, const char *name)
{
struct output *output;
wl_list_for_each(output, &server->outputs, link) {
if (!output_is_usable(output) || !output->wlr_output->name) {
continue;
}
if (!strcasecmp(name, output->wlr_output->name)) {
return output;
}
}
return NULL;
}
struct output *
output_nearest_to(struct server *server, int lx, int ly)
{