From 5798c22da8ab204de46054871541e4363b6319e3 Mon Sep 17 00:00:00 2001 From: Phil Jones Date: Sun, 26 Jun 2022 22:45:55 +0100 Subject: Fix multiple output handling. The --output option can be passed to select a specific output to appear on. Which output is chosen otherwise is currently random, as I don't know yet how to determine which one the user's currently on. --- src/tofi.h | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) (limited to 'src/tofi.h') diff --git a/src/tofi.h b/src/tofi.h index 788a73f..ec3582b 100644 --- a/src/tofi.h +++ b/src/tofi.h @@ -1,5 +1,5 @@ -#ifndef CLIENT_H -#define CLIENT_H +#ifndef TOFI_H +#define TOFI_H #include #include @@ -9,15 +9,26 @@ #include "surface.h" #include "wlr-layer-shell-unstable-v1.h" +#define MAX_OUTPUT_NAME_LEN 256 + +struct output_list_element { + struct wl_list link; + struct wl_output *wl_output; + char *name; + uint32_t width; + uint32_t height; + int32_t scale; +}; + struct tofi { /* Wayland globals */ struct wl_display *wl_display; struct wl_registry *wl_registry; struct wl_compositor *wl_compositor; struct wl_seat *wl_seat; - struct wl_output *wl_output; struct wl_shm *wl_shm; struct zwlr_layer_shell_v1 *zwlr_layer_shell; + struct wl_list output_list; /* Wayland objects */ struct wl_keyboard *wl_keyboard; @@ -52,6 +63,7 @@ struct tofi { bool hide_cursor; bool use_history; bool late_keyboard_init; + char target_output_name[MAX_OUTPUT_NAME_LEN]; }; -#endif /* CLIENT_H */ +#endif /* TOFI_H */ -- cgit v1.2.3