summaryrefslogtreecommitdiffstats
path: root/sway/desktop/output.c
diff options
context:
space:
mode:
authorLibravatar Drew DeVault <sir@cmpwn.com>2018-03-30 00:02:29 -0400
committerLibravatar Drew DeVault <sir@cmpwn.com>2018-03-30 00:04:04 -0400
commitf26ecd9f58bb672fe107660ce9b37f4bf0777a8c (patch)
tree997658454de40db3f8b76b68d658efaf2b686188 /sway/desktop/output.c
parentEarly return from render functions if necessary (diff)
parentMerge pull request #1654 from acrisci/refactor-2-electric-boogaloo (diff)
downloadsway-f26ecd9f58bb672fe107660ce9b37f4bf0777a8c.tar.gz
sway-f26ecd9f58bb672fe107660ce9b37f4bf0777a8c.tar.zst
sway-f26ecd9f58bb672fe107660ce9b37f4bf0777a8c.zip
Merge remote-tracking branch 'origin/wlroots' into swaybar-layers
Diffstat (limited to 'sway/desktop/output.c')
-rw-r--r--sway/desktop/output.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/sway/desktop/output.c b/sway/desktop/output.c
index 30b23a18..a9c59684 100644
--- a/sway/desktop/output.c
+++ b/sway/desktop/output.c
@@ -11,14 +11,14 @@
11#include <wlr/types/wlr_surface.h> 11#include <wlr/types/wlr_surface.h>
12#include <wlr/types/wlr_wl_shell.h> 12#include <wlr/types/wlr_wl_shell.h>
13#include "log.h" 13#include "log.h"
14#include "sway/container.h" 14#include "sway/tree/container.h"
15#include "sway/input/input-manager.h" 15#include "sway/input/input-manager.h"
16#include "sway/input/seat.h" 16#include "sway/input/seat.h"
17#include "sway/layers.h" 17#include "sway/layers.h"
18#include "sway/layout.h" 18#include "sway/tree/layout.h"
19#include "sway/output.h" 19#include "sway/output.h"
20#include "sway/server.h" 20#include "sway/server.h"
21#include "sway/view.h" 21#include "sway/tree/view.h"
22 22
23/** 23/**
24 * Rotate a child's position relative to a parent. The parent size is (pw, ph), 24 * Rotate a child's position relative to a parent. The parent size is (pw, ph),
@@ -145,7 +145,7 @@ struct render_data {
145 struct timespec *now; 145 struct timespec *now;
146}; 146};
147 147
148static void output_frame_view(swayc_t *view, void *data) { 148static void output_frame_view(struct sway_container *view, void *data) {
149 struct render_data *rdata = data; 149 struct render_data *rdata = data;
150 struct sway_output *output = rdata->output; 150 struct sway_output *output = rdata->output;
151 struct timespec *now = rdata->now; 151 struct timespec *now = rdata->now;
@@ -219,16 +219,16 @@ static void output_frame_notify(struct wl_listener *listener, void *data) {
219 &soutput->layers[ZWLR_LAYER_SHELL_V1_LAYER_BOTTOM]); 219 &soutput->layers[ZWLR_LAYER_SHELL_V1_LAYER_BOTTOM]);
220 220
221 struct sway_seat *seat = input_manager_current_seat(input_manager); 221 struct sway_seat *seat = input_manager_current_seat(input_manager);
222 swayc_t *focus = sway_seat_get_focus_inactive(seat, soutput->swayc); 222 struct sway_container *focus = sway_seat_get_focus_inactive(seat, soutput->swayc);
223 swayc_t *workspace = (focus->type == C_WORKSPACE ? 223 struct sway_container *workspace = (focus->type == C_WORKSPACE ?
224 focus : 224 focus :
225 swayc_parent_by_type(focus, C_WORKSPACE)); 225 container_parent(focus, C_WORKSPACE));
226 226
227 struct render_data rdata = { 227 struct render_data rdata = {
228 .output = soutput, 228 .output = soutput,
229 .now = &now, 229 .now = &now,
230 }; 230 };
231 swayc_descendants_of_type(workspace, C_VIEW, output_frame_view, &rdata); 231 container_descendants(workspace, C_VIEW, output_frame_view, &rdata);
232 232
233 // render unmanaged views on top 233 // render unmanaged views on top
234 struct sway_view *view; 234 struct sway_view *view;
@@ -259,7 +259,7 @@ static void handle_output_destroy(struct wl_listener *listener, void *data) {
259 struct wlr_output *wlr_output = data; 259 struct wlr_output *wlr_output = data;
260 wlr_log(L_DEBUG, "Output %p %s removed", wlr_output, wlr_output->name); 260 wlr_log(L_DEBUG, "Output %p %s removed", wlr_output, wlr_output->name);
261 261
262 destroy_output(output->swayc); 262 container_output_destroy(output->swayc);
263} 263}
264 264
265static void handle_output_mode(struct wl_listener *listener, void *data) { 265static void handle_output_mode(struct wl_listener *listener, void *data) {
@@ -293,7 +293,7 @@ void handle_new_output(struct wl_listener *listener, void *data) {
293 wlr_output_set_mode(wlr_output, mode); 293 wlr_output_set_mode(wlr_output, mode);
294 } 294 }
295 295
296 output->swayc = new_output(output); 296 output->swayc = container_output_create(output);
297 if (!output->swayc) { 297 if (!output->swayc) {
298 free(output); 298 free(output);
299 return; 299 return;