Skip to content

Commit

Permalink
meson: use correct generated files for wayland protocols
Browse files Browse the repository at this point in the history
Previously, the set of files generated by protocols/meson.build was
ignored and the existing files from src/protocols/*.h were used.

- Move prebuilt protocols private code to a separate translation unit,
  not included by meson.build
- Control the set of protocol headers to use with include paths
  • Loading branch information
alebastr committed Jan 14, 2024
1 parent 17e456b commit b9cd549
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 11 deletions.
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ ifeq (0,${WAYLAND})
SRC := $(sort $(shell ${FIND} src/ -not \( -path src/wayland -prune \) -name '*.c'))
else
# with Wayland support
CFLAGS += -Isrc/wayland/protocols
SRC := $(sort $(shell ${FIND} src/ -name '*.c'))
endif
OBJ := ${SRC:.c=.o}
Expand Down
3 changes: 1 addition & 2 deletions src/wayland/foreign_toplevel.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@
#include <stdio.h>
#include <stdbool.h>
#include <stdlib.h>
#include "protocols/wlr-foreign-toplevel-management-unstable-v1-client-header.h"
/* #include "protocols/wlr-foreign-toplevel-management-unstable-v1.h" */
#include "wlr-foreign-toplevel-management-unstable-v1-client-header.h"

#include "foreign_toplevel.h"
#include "../dunst.h"
Expand Down
4 changes: 4 additions & 0 deletions src/wayland/protocols.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#include "protocols/xdg-shell.h"
#include "protocols/wlr-layer-shell-unstable-v1.h"
#include "protocols/wlr-foreign-toplevel-management-unstable-v1.h"
#include "protocols/idle.h"
2 changes: 1 addition & 1 deletion src/wayland/protocols/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ wayland_scanner_prog = find_program(wayland_scanner_path, native: true)

wayland_scanner_code = generator(
wayland_scanner_prog,
output: '@BASENAME@.h',
output: '@BASENAME@.c',
arguments: ['private-code', '@INPUT@', '@OUTPUT@'],
)

Expand Down
12 changes: 4 additions & 8 deletions src/wayland/wl.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,10 @@
#include <string.h>
#include <glib.h>

#include "protocols/xdg-shell-client-header.h"
#include "protocols/xdg-shell.h"
#include "protocols/wlr-layer-shell-unstable-v1-client-header.h"
#include "protocols/wlr-layer-shell-unstable-v1.h"
#include "protocols/wlr-foreign-toplevel-management-unstable-v1-client-header.h"
#include "protocols/wlr-foreign-toplevel-management-unstable-v1.h"
#include "protocols/idle-client-header.h"
#include "protocols/idle.h"
#include "xdg-shell-client-header.h"
#include "wlr-layer-shell-unstable-v1-client-header.h"
#include "wlr-foreign-toplevel-management-unstable-v1-client-header.h"
#include "idle-client-header.h"
#include "pool-buffer.h"


Expand Down

0 comments on commit b9cd549

Please sign in to comment.