summaryrefslogtreecommitdiffstats
path: root/sway
diff options
context:
space:
mode:
authorLibravatar Brian Ashworth <RedSoxFan@users.noreply.github.com>2018-09-21 15:28:53 -0400
committerLibravatar GitHub <noreply@github.com>2018-09-21 15:28:53 -0400
commit04862e2121203965dad834b731a5c32b1d1f4e84 (patch)
tree56f257c17c0d97666c498d2eb35012838c82b451 /sway
parentswaybar: don't wl_display_roundtrip on each frame (diff)
parentMerge pull request #2672 from ianyfan/swaybar (diff)
downloadsway-04862e2121203965dad834b731a5c32b1d1f4e84.tar.gz
sway-04862e2121203965dad834b731a5c32b1d1f4e84.tar.zst
sway-04862e2121203965dad834b731a5c32b1d1f4e84.zip
Merge branch 'master' into swaybar-hotplug
Diffstat (limited to 'sway')
-rw-r--r--sway/commands/create_output.c8
-rw-r--r--sway/desktop/render.c11
2 files changed, 14 insertions, 5 deletions
diff --git a/sway/commands/create_output.c b/sway/commands/create_output.c
index a852c2a0..1c2464ea 100644
--- a/sway/commands/create_output.c
+++ b/sway/commands/create_output.c
@@ -1,6 +1,9 @@
1#include <wlr/config.h>
1#include <wlr/backend/multi.h> 2#include <wlr/backend/multi.h>
2#include <wlr/backend/wayland.h> 3#include <wlr/backend/wayland.h>
4#ifdef WLR_HAS_X11_BACKEND
3#include <wlr/backend/x11.h> 5#include <wlr/backend/x11.h>
6#endif
4#include "sway/commands.h" 7#include "sway/commands.h"
5#include "sway/server.h" 8#include "sway/server.h"
6#include "log.h" 9#include "log.h"
@@ -14,10 +17,13 @@ static void create_output(struct wlr_backend *backend, void *data) {
14 if (wlr_backend_is_wl(backend)) { 17 if (wlr_backend_is_wl(backend)) {
15 wlr_wl_output_create(backend); 18 wlr_wl_output_create(backend);
16 *done = true; 19 *done = true;
17 } else if (wlr_backend_is_x11(backend)) { 20 }
21#ifdef WLR_HAS_X11_BACKEND
22 else if (wlr_backend_is_x11(backend)) {
18 wlr_x11_output_create(backend); 23 wlr_x11_output_create(backend);
19 *done = true; 24 *done = true;
20 } 25 }
26#endif
21} 27}
22 28
23/** 29/**
diff --git a/sway/desktop/render.c b/sway/desktop/render.c
index 1d2f445d..af4e2905 100644
--- a/sway/desktop/render.c
+++ b/sway/desktop/render.c
@@ -914,12 +914,17 @@ void output_render(struct sway_output *output, struct timespec *when,
914 struct wlr_output *wlr_output = output->wlr_output; 914 struct wlr_output *wlr_output = output->wlr_output;
915 915
916 struct wlr_renderer *renderer = 916 struct wlr_renderer *renderer =
917 wlr_backend_get_renderer(wlr_output->backend); 917 wlr_backend_get_renderer(wlr_output->backend);
918 if (!sway_assert(renderer != NULL, 918 if (!sway_assert(renderer != NULL,
919 "expected the output backend to have a renderer")) { 919 "expected the output backend to have a renderer")) {
920 return; 920 return;
921 } 921 }
922 922
923 struct sway_workspace *workspace = output->current.active_workspace;
924 if (workspace == NULL) {
925 return;
926 }
927
923 wlr_renderer_begin(renderer, wlr_output->width, wlr_output->height); 928 wlr_renderer_begin(renderer, wlr_output->width, wlr_output->height);
924 929
925 if (!pixman_region32_not_empty(damage)) { 930 if (!pixman_region32_not_empty(damage)) {
@@ -935,13 +940,11 @@ void output_render(struct sway_output *output, struct timespec *when,
935 pixman_region32_union_rect(damage, damage, 0, 0, width, height); 940 pixman_region32_union_rect(damage, damage, 0, 0, width, height);
936 } 941 }
937 942
938 struct sway_workspace *workspace = output->current.active_workspace;
939 struct sway_container *fullscreen_con = workspace->current.fullscreen;
940
941 if (output_has_opaque_overlay_layer_surface(output)) { 943 if (output_has_opaque_overlay_layer_surface(output)) {
942 goto render_overlay; 944 goto render_overlay;
943 } 945 }
944 946
947 struct sway_container *fullscreen_con = workspace->current.fullscreen;
945 if (fullscreen_con) { 948 if (fullscreen_con) {
946 float clear_color[] = {0.0f, 0.0f, 0.0f, 1.0f}; 949 float clear_color[] = {0.0f, 0.0f, 0.0f, 1.0f};
947 950