diff options
author | 2017-11-11 11:58:43 -0500 | |
---|---|---|
committer | 2017-11-11 11:58:43 -0500 | |
commit | 7eafcc75f6f8abd2346e0d72b063bc10ce24378f (patch) | |
tree | ce8a4cebdf5bc484643ec78f3cf59e0943ce50e8 /sway/config.c | |
parent | Move sway's internal tree code to sway/tree/ (diff) | |
download | sway-7eafcc75f6f8abd2346e0d72b063bc10ce24378f.tar.gz sway-7eafcc75f6f8abd2346e0d72b063bc10ce24378f.tar.zst sway-7eafcc75f6f8abd2346e0d72b063bc10ce24378f.zip |
Initialize outputs from backend and add to tree
Diffstat (limited to 'sway/config.c')
-rw-r--r-- | sway/config.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/sway/config.c b/sway/config.c index a33b8edc..78ab8f3b 100644 --- a/sway/config.c +++ b/sway/config.c | |||
@@ -15,6 +15,7 @@ | |||
15 | #include <float.h> | 15 | #include <float.h> |
16 | #include <dirent.h> | 16 | #include <dirent.h> |
17 | #include <strings.h> | 17 | #include <strings.h> |
18 | #include <wlr/types/wlr_output.h> | ||
18 | #include "wayland-desktop-shell-server-protocol.h" | 19 | #include "wayland-desktop-shell-server-protocol.h" |
19 | #include "sway/commands.h" | 20 | #include "sway/commands.h" |
20 | #include "sway/config.h" | 21 | #include "sway/config.h" |
@@ -930,6 +931,7 @@ void merge_output_config(struct output_config *dst, struct output_config *src) { | |||
930 | } | 931 | } |
931 | 932 | ||
932 | static void invoke_swaybar(struct bar_config *bar) { | 933 | static void invoke_swaybar(struct bar_config *bar) { |
934 | return; // TODO WLR | ||
933 | // Pipe to communicate errors | 935 | // Pipe to communicate errors |
934 | int filedes[2]; | 936 | int filedes[2]; |
935 | if (pipe(filedes) == -1) { | 937 | if (pipe(filedes) == -1) { |
@@ -1128,13 +1130,15 @@ void apply_output_config(struct output_config *oc, swayc_t *output) { | |||
1128 | output->height = oc->height; | 1130 | output->height = oc->height; |
1129 | 1131 | ||
1130 | sway_log(L_DEBUG, "Set %s size to %ix%i (%d)", oc->name, oc->width, oc->height, oc->scale); | 1132 | sway_log(L_DEBUG, "Set %s size to %ix%i (%d)", oc->name, oc->width, oc->height, oc->scale); |
1131 | struct wlc_size new_size = { .w = oc->width, .h = oc->height }; | 1133 | // TODO WLR: modes |
1132 | wlc_output_set_resolution(output->handle, &new_size, (uint32_t)oc->scale); | 1134 | //struct wlc_size new_size = { .w = oc->width, .h = oc->height }; |
1135 | //wlc_output_set_resolution(output->handle, &new_size, (uint32_t)oc->scale); | ||
1133 | } else if (oc) { | 1136 | } else if (oc) { |
1134 | const struct wlc_size *new_size = wlc_output_get_resolution(output->handle); | 1137 | //const struct wlc_size *new_size = wlc_output_get_resolution(output->handle); |
1135 | wlc_output_set_resolution(output->handle, new_size, (uint32_t)oc->scale); | 1138 | //wlc_output_set_resolution(output->handle, new_size, (uint32_t)oc->scale); |
1136 | } | 1139 | } |
1137 | 1140 | ||
1141 | // TODO WLR: wlr_output_layout | ||
1138 | // Find position for it | 1142 | // Find position for it |
1139 | if (oc && oc->x != -1 && oc->y != -1) { | 1143 | if (oc && oc->x != -1 && oc->y != -1) { |
1140 | sway_log(L_DEBUG, "Set %s position to %d, %d", oc->name, oc->x, oc->y); | 1144 | sway_log(L_DEBUG, "Set %s position to %d, %d", oc->name, oc->x, oc->y); |
@@ -1170,6 +1174,7 @@ void apply_output_config(struct output_config *oc, swayc_t *output) { | |||
1170 | } | 1174 | } |
1171 | } | 1175 | } |
1172 | 1176 | ||
1177 | /* TODO WLR | ||
1173 | if (oc && oc->background) { | 1178 | if (oc && oc->background) { |
1174 | if (output->bg_pid != 0) { | 1179 | if (output->bg_pid != 0) { |
1175 | terminate_swaybg(output->bg_pid); | 1180 | terminate_swaybg(output->bg_pid); |
@@ -1195,6 +1200,7 @@ void apply_output_config(struct output_config *oc, swayc_t *output) { | |||
1195 | execvp(cmd[0], cmd); | 1200 | execvp(cmd[0], cmd); |
1196 | } | 1201 | } |
1197 | } | 1202 | } |
1203 | */ | ||
1198 | } | 1204 | } |
1199 | 1205 | ||
1200 | char *do_var_replacement(char *str) { | 1206 | char *do_var_replacement(char *str) { |