diff options
author | Drew DeVault <sir@cmpwn.com> | 2017-11-11 11:58:43 -0500 |
---|---|---|
committer | Drew DeVault <sir@cmpwn.com> | 2017-11-11 11:58:43 -0500 |
commit | 7eafcc75f6f8abd2346e0d72b063bc10ce24378f (patch) | |
tree | ce8a4cebdf5bc484643ec78f3cf59e0943ce50e8 /sway/tree | |
parent | 0ba6554c4f6c923274062862d895240eea4de350 (diff) | |
download | sway-7eafcc75f6f8abd2346e0d72b063bc10ce24378f.tar.xz |
Initialize outputs from backend and add to tree
Diffstat (limited to 'sway/tree')
-rw-r--r-- | sway/tree/container.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/sway/tree/container.c b/sway/tree/container.c index 829fde69..61c9c5e3 100644 --- a/sway/tree/container.c +++ b/sway/tree/container.c @@ -4,6 +4,8 @@ #include <stdbool.h> #include <strings.h> #include <string.h> +#include <wlr/types/wlr_box.h> +#include <wlr/types/wlr_output.h> #include "sway/config.h" #include "sway/container.h" #include "sway/workspace.h" @@ -118,10 +120,10 @@ static void update_root_geometry() { // New containers -swayc_t *new_output(wlc_handle handle) { - struct wlc_size size; - output_get_scaled_size(handle, &size); - const char *name = wlc_output_get_name(handle); +swayc_t *new_output(struct wlr_output *wlr_output) { + struct wlr_box size; + wlr_output_effective_resolution(wlr_output, &size.width, &size.height); + const char *name = wlr_output->name; // Find current outputs to see if this already exists { int i, len = root_container.children->length; @@ -129,14 +131,12 @@ swayc_t *new_output(wlc_handle handle) { swayc_t *op = root_container.children->items[i]; const char *op_name = op->name; if (op_name && name && strcmp(op_name, name) == 0) { - sway_log(L_DEBUG, "restoring output %" PRIuPTR ":%s", handle, op_name); + sway_log(L_DEBUG, "restoring output %p: %s", wlr_output, op_name); return op; } } } - sway_log(L_DEBUG, "New output %" PRIuPTR ":%s", handle, name); - struct output_config *oc = NULL, *all = NULL; int i; for (i = 0; i < config->output_configs->length; ++i) { @@ -164,10 +164,10 @@ swayc_t *new_output(wlc_handle handle) { } swayc_t *output = new_swayc(C_OUTPUT); - output->handle = handle; + output->_handle.output = wlr_output; output->name = name ? strdup(name) : NULL; - output->width = size.w; - output->height = size.h; + output->width = size.width; + output->height = size.width; output->unmanaged = create_list(); output->bg_pid = 0; |