aboutsummaryrefslogtreecommitdiff
path: root/rootston
diff options
context:
space:
mode:
authorDrew DeVault <sir@cmpwn.com>2018-11-12 16:14:18 -0500
committerGitHub <noreply@github.com>2018-11-12 16:14:18 -0500
commit77dfac4fa4082ce95fc9769861e0b971754b6a66 (patch)
treecfffb364f9e79dc7acb2dc67075b33f15a1f57c9 /rootston
parentd2d8372cdc20c908342497fcdbfa91b6fc99df82 (diff)
parent51bfdd620e70c41e1a9fb4ce7831eddfb1bf893b (diff)
Merge pull request #1372 from emersion/config10
Use #if instead of #ifdef for wlroots config data
Diffstat (limited to 'rootston')
-rw-r--r--rootston/desktop.c8
-rw-r--r--rootston/input.c2
-rw-r--r--rootston/main.c4
-rw-r--r--rootston/meson.build2
-rw-r--r--rootston/output.c12
-rw-r--r--rootston/seat.c4
6 files changed, 16 insertions, 16 deletions
diff --git a/rootston/desktop.c b/rootston/desktop.c
index 7da64ef8..e49d61a1 100644
--- a/rootston/desktop.c
+++ b/rootston/desktop.c
@@ -619,7 +619,7 @@ static bool view_at(struct roots_view *view, double lx, double ly,
_surface = wlr_wl_shell_surface_surface_at(view->wl_shell_surface,
view_sx, view_sy, &_sx, &_sy);
break;
-#ifdef WLR_HAS_XWAYLAND
+#if WLR_HAS_XWAYLAND
case ROOTS_XWAYLAND_VIEW:
_surface = wlr_surface_surface_at(view->wlr_surface,
view_sx, view_sy, &_sx, &_sy);
@@ -890,14 +890,14 @@ struct roots_desktop *desktop_create(struct roots_server *server,
desktop->tablet_v2 = wlr_tablet_v2_create(server->wl_display);
const char *cursor_theme = NULL;
-#ifdef WLR_HAS_XWAYLAND
+#if WLR_HAS_XWAYLAND
const char *cursor_default = ROOTS_XCURSOR_DEFAULT;
#endif
struct roots_cursor_config *cc =
roots_config_get_cursor(config, ROOTS_CONFIG_DEFAULT_SEAT_NAME);
if (cc != NULL) {
cursor_theme = cc->theme;
-#ifdef WLR_HAS_XWAYLAND
+#if WLR_HAS_XWAYLAND
if (cc->default_image != NULL) {
cursor_default = cc->default_image;
}
@@ -912,7 +912,7 @@ struct roots_desktop *desktop_create(struct roots_server *server,
setenv("XCURSOR_THEME", cursor_theme, 1);
}
-#ifdef WLR_HAS_XWAYLAND
+#if WLR_HAS_XWAYLAND
desktop->xcursor_manager = wlr_xcursor_manager_create(cursor_theme,
ROOTS_XCURSOR_SIZE);
if (desktop->xcursor_manager == NULL) {
diff --git a/rootston/input.c b/rootston/input.c
index b7a5f1ba..7b4001b3 100644
--- a/rootston/input.c
+++ b/rootston/input.c
@@ -8,7 +8,7 @@
#include <wlr/types/wlr_cursor.h>
#include <wlr/util/log.h>
#include <wlr/xcursor.h>
-#ifdef WLR_HAS_XWAYLAND
+#if WLR_HAS_XWAYLAND
#include <wlr/xwayland.h>
#endif
#include "rootston/config.h"
diff --git a/rootston/main.c b/rootston/main.c
index cc3ffd3e..7e25dab1 100644
--- a/rootston/main.c
+++ b/rootston/main.c
@@ -53,7 +53,7 @@ int main(int argc, char **argv) {
}
setenv("WAYLAND_DISPLAY", socket, true);
-#ifdef WLR_HAS_XWAYLAND
+#if WLR_HAS_XWAYLAND
if (server.desktop->xwayland != NULL) {
struct roots_seat *xwayland_seat =
input_get_seat(server.input, ROOTS_CONFIG_DEFAULT_SEAT_NAME);
@@ -72,7 +72,7 @@ int main(int argc, char **argv) {
}
wl_display_run(server.wl_display);
-#ifdef WLR_HAS_XWAYLAND
+#if WLR_HAS_XWAYLAND
wlr_xwayland_destroy(server.desktop->xwayland);
#endif
wl_display_destroy_clients(server.wl_display);
diff --git a/rootston/meson.build b/rootston/meson.build
index d650dc51..d41e00b0 100644
--- a/rootston/meson.build
+++ b/rootston/meson.build
@@ -16,7 +16,7 @@ sources = [
'xdg_shell_v6.c',
]
-if conf_data.get('WLR_HAS_XWAYLAND', false)
+if conf_data.get('WLR_HAS_XWAYLAND', 0) == 1
sources += 'xwayland.c'
endif
diff --git a/rootston/output.c b/rootston/output.c
index 9aa7de65..01fcae98 100644
--- a/rootston/output.c
+++ b/rootston/output.c
@@ -86,7 +86,7 @@ static void view_for_each_surface(struct roots_view *view,
wlr_wl_shell_surface_for_each_surface(view->wl_shell_surface, iterator,
user_data);
break;
-#ifdef WLR_HAS_XWAYLAND
+#if WLR_HAS_XWAYLAND
case ROOTS_XWAYLAND_VIEW:
wlr_surface_for_each_surface(view->wlr_surface, iterator, user_data);
break;
@@ -94,7 +94,7 @@ static void view_for_each_surface(struct roots_view *view,
}
}
-#ifdef WLR_HAS_XWAYLAND
+#if WLR_HAS_XWAYLAND
static void xwayland_children_for_each_surface(
struct wlr_xwayland_surface *surface,
wlr_surface_iterator_func_t iterator, struct layout_data *layout_data,
@@ -164,7 +164,7 @@ static void output_for_each_surface(struct roots_output *output,
view_for_each_surface(view, layout_data, iterator, user_data);
-#ifdef WLR_HAS_XWAYLAND
+#if WLR_HAS_XWAYLAND
if (view->type == ROOTS_XWAYLAND_VIEW) {
xwayland_children_for_each_surface(view->xwayland_surface,
iterator, layout_data, user_data);
@@ -400,7 +400,7 @@ static bool has_standalone_surface(struct roots_view *view) {
return wl_list_empty(&view->xdg_surface->popups);
case ROOTS_WL_SHELL_VIEW:
return wl_list_empty(&view->wl_shell_surface->popups);
-#ifdef WLR_HAS_XWAYLAND
+#if WLR_HAS_XWAYLAND
case ROOTS_XWAYLAND_VIEW:
return wl_list_empty(&view->xwayland_surface->children);
#endif
@@ -530,7 +530,7 @@ static void render_output(struct roots_output *output) {
// During normal rendering the xwayland window tree isn't traversed
// because all windows are rendered. Here we only want to render
// the fullscreen window's children so we have to traverse the tree.
-#ifdef WLR_HAS_XWAYLAND
+#if WLR_HAS_XWAYLAND
if (view->type == ROOTS_XWAYLAND_VIEW) {
xwayland_children_for_each_surface(view->xwayland_surface,
render_surface, &data.layout, &data);
@@ -593,7 +593,7 @@ static bool view_accept_damage(struct roots_output *output,
if (output->fullscreen_view == view) {
return true;
}
-#ifdef WLR_HAS_XWAYLAND
+#if WLR_HAS_XWAYLAND
if (output->fullscreen_view->type == ROOTS_XWAYLAND_VIEW &&
view->type == ROOTS_XWAYLAND_VIEW) {
// Special case: accept damage from children
diff --git a/rootston/seat.c b/rootston/seat.c
index 82444dcb..95e7d6c9 100644
--- a/rootston/seat.c
+++ b/rootston/seat.c
@@ -1131,7 +1131,7 @@ void roots_seat_set_focus(struct roots_seat *seat, struct roots_view *view) {
bool unfullscreen = true;
-#ifdef WLR_HAS_XWAYLAND
+#if WLR_HAS_XWAYLAND
if (view && view->type == ROOTS_XWAYLAND_VIEW &&
view->xwayland_surface->override_redirect) {
unfullscreen = false;
@@ -1160,7 +1160,7 @@ void roots_seat_set_focus(struct roots_seat *seat, struct roots_view *view) {
return;
}
-#ifdef WLR_HAS_XWAYLAND
+#if WLR_HAS_XWAYLAND
if (view && view->type == ROOTS_XWAYLAND_VIEW &&
!wlr_xwayland_or_surface_wants_focus(
view->xwayland_surface)) {