aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--meson.build33
-rw-r--r--sway/desktop/render.c9
2 files changed, 26 insertions, 16 deletions
diff --git a/meson.build b/meson.build
index 7e26ae2a..5468064f 100644
--- a/meson.build
+++ b/meson.build
@@ -43,6 +43,24 @@ subproject(
43 required: false, 43 required: false,
44 version: wlroots_version, 44 version: wlroots_version,
45) 45)
46wlroots = dependency('wlroots', version: wlroots_version)
47wlroots_features = {
48 'xwayland': false,
49 'libinput_backend': false,
50 'gles2_renderer': false,
51 'session': false,
52}
53foreach name, _ : wlroots_features
54 var_name = 'have_' + name.underscorify()
55 have = wlroots.get_variable(pkgconfig: var_name, internal: var_name) == 'true'
56 wlroots_features += { name: have }
57endforeach
58
59if get_option('xwayland').enabled() and not wlroots_features['xwayland']
60 error('Cannot enable Xwayland in sway: wlroots has been built without Xwayland support')
61endif
62
63null_dep = dependency('', required: false)
46 64
47jsonc = dependency('json-c', version: '>=0.13') 65jsonc = dependency('json-c', version: '>=0.13')
48pcre2 = dependency('libpcre2-8') 66pcre2 = dependency('libpcre2-8')
@@ -50,14 +68,13 @@ wayland_server = dependency('wayland-server', version: '>=1.21.0')
50wayland_client = dependency('wayland-client') 68wayland_client = dependency('wayland-client')
51wayland_cursor = dependency('wayland-cursor') 69wayland_cursor = dependency('wayland-cursor')
52wayland_protos = dependency('wayland-protocols', version: '>=1.24') 70wayland_protos = dependency('wayland-protocols', version: '>=1.24')
53wlroots = dependency('wlroots', version: wlroots_version)
54xkbcommon = dependency('xkbcommon') 71xkbcommon = dependency('xkbcommon')
55cairo = dependency('cairo') 72cairo = dependency('cairo')
56pango = dependency('pango') 73pango = dependency('pango')
57pangocairo = dependency('pangocairo') 74pangocairo = dependency('pangocairo')
58gdk_pixbuf = dependency('gdk-pixbuf-2.0', required: get_option('gdk-pixbuf')) 75gdk_pixbuf = dependency('gdk-pixbuf-2.0', required: get_option('gdk-pixbuf'))
59pixman = dependency('pixman-1') 76pixman = dependency('pixman-1')
60glesv2 = dependency('glesv2') 77glesv2 = wlroots_features['gles2_renderer'] ? dependency('glesv2') : null_dep
61libevdev = dependency('libevdev') 78libevdev = dependency('libevdev')
62libinput = dependency('libinput', version: '>=1.21.0') 79libinput = dependency('libinput', version: '>=1.21.0')
63xcb = dependency('xcb', required: get_option('xwayland')) 80xcb = dependency('xcb', required: get_option('xwayland'))
@@ -71,18 +88,6 @@ rt = cc.find_library('rt')
71xcb_icccm = dependency('xcb-icccm', required: get_option('xwayland')) 88xcb_icccm = dependency('xcb-icccm', required: get_option('xwayland'))
72threads = dependency('threads') # for pthread_setschedparam 89threads = dependency('threads') # for pthread_setschedparam
73 90
74wlroots_features = {
75 'xwayland': false,
76}
77foreach name, _ : wlroots_features
78 var_name = 'have_' + name.underscorify()
79 have = wlroots.get_variable(pkgconfig: var_name, internal: var_name) == 'true'
80 wlroots_features += { name: have }
81endforeach
82
83if get_option('xwayland').enabled() and not wlroots_features['xwayland']
84 error('Cannot enable Xwayland in sway: wlroots has been built without Xwayland support')
85endif
86have_xwayland = xcb.found() and wlroots_features['xwayland'] 91have_xwayland = xcb.found() and wlroots_features['xwayland']
87 92
88if get_option('sd-bus-provider') == 'auto' 93if get_option('sd-bus-provider') == 'auto'
diff --git a/sway/desktop/render.c b/sway/desktop/render.c
index efa3a0d9..ea9c37d9 100644
--- a/sway/desktop/render.c
+++ b/sway/desktop/render.c
@@ -1,11 +1,10 @@
1#define _POSIX_C_SOURCE 200809L 1#define _POSIX_C_SOURCE 200809L
2#include <assert.h> 2#include <assert.h>
3#include <GLES2/gl2.h>
4#include <stdlib.h> 3#include <stdlib.h>
5#include <strings.h> 4#include <strings.h>
6#include <time.h> 5#include <time.h>
7#include <wayland-server-core.h> 6#include <wayland-server-core.h>
8#include <wlr/render/gles2.h> 7#include <wlr/config.h>
9#include <wlr/render/wlr_renderer.h> 8#include <wlr/render/wlr_renderer.h>
10#include <wlr/types/wlr_buffer.h> 9#include <wlr/types/wlr_buffer.h>
11#include <wlr/types/wlr_damage_ring.h> 10#include <wlr/types/wlr_damage_ring.h>
@@ -28,6 +27,10 @@
28#include "sway/tree/view.h" 27#include "sway/tree/view.h"
29#include "sway/tree/workspace.h" 28#include "sway/tree/workspace.h"
30 29
30#if WLR_HAS_GLES2_RENDERER
31#include <wlr/render/gles2.h>
32#endif
33
31struct render_data { 34struct render_data {
32 pixman_region32_t *damage; 35 pixman_region32_t *damage;
33 float alpha; 36 float alpha;
@@ -74,6 +77,7 @@ static void scissor_output(struct wlr_output *wlr_output,
74 77
75static void set_scale_filter(struct wlr_output *wlr_output, 78static void set_scale_filter(struct wlr_output *wlr_output,
76 struct wlr_texture *texture, enum scale_filter_mode scale_filter) { 79 struct wlr_texture *texture, enum scale_filter_mode scale_filter) {
80#if WLR_HAS_GLES2_RENDERER
77 if (!wlr_texture_is_gles2(texture)) { 81 if (!wlr_texture_is_gles2(texture)) {
78 return; 82 return;
79 } 83 }
@@ -94,6 +98,7 @@ static void set_scale_filter(struct wlr_output *wlr_output,
94 case SCALE_FILTER_SMART: 98 case SCALE_FILTER_SMART:
95 assert(false); // unreachable 99 assert(false); // unreachable
96 } 100 }
101#endif
97} 102}
98 103
99static void render_texture(struct wlr_output *wlr_output, 104static void render_texture(struct wlr_output *wlr_output,