From 21db2418b7dbe48f1bf79ea101d066a4ed7252e1 Mon Sep 17 00:00:00 2001 From: Scott Anderson Date: Mon, 13 May 2019 15:27:29 +1200 Subject: [PATCH] Comment out currently failing build definitions This gets wlroots to build, but the transitive closure of files depending on wlr_surface.c is actually pretty large. As more interfaces are changed to use the new compositor design, their build definitions will be uncommented. This also includes a very basic test client/server, but this will be removed later. --- meson.build | 15 ++++-- test-client.c | 62 +++++++++++++++++++++ test-server.c | 29 ++++++++++ types/meson.build | 111 +++++++++++++++++++------------------- types/wlr_subcompositor.c | 4 +- 5 files changed, 159 insertions(+), 62 deletions(-) create mode 100644 test-client.c create mode 100644 test-server.c diff --git a/meson.build b/meson.build index 18afd9bc8..5cb7ef375 100644 --- a/meson.build +++ b/meson.build @@ -98,17 +98,17 @@ endif subdir('protocol') subdir('render') -subdir('backend') +#subdir('backend') subdir('types') subdir('util') subdir('xcursor') -subdir('xwayland') +#subdir('xwayland') subdir('include') wlr_parts += [ lib_wl_protos, - lib_wlr_backend, + #lib_wlr_backend, lib_wlr_render, lib_wlr_types, lib_wlr_util, @@ -168,8 +168,13 @@ summary = [ ] message('\n'.join(summary)) -subdir('examples') -subdir('rootston') +executable('test-server', 'test-server.c', + dependencies: wlroots) +executable('test-client', 'test-client.c', + dependencies: wayland_client) + +#subdir('examples') +#subdir('rootston') pkgconfig = import('pkgconfig') pkgconfig.generate( diff --git a/test-client.c b/test-client.c new file mode 100644 index 000000000..82035cef0 --- /dev/null +++ b/test-client.c @@ -0,0 +1,62 @@ +#include +#include +#include + +struct wl_compositor *compositor; +struct wl_subcompositor *subcompositor; + +static void global(void *data, struct wl_registry *reg, uint32_t name, + const char *interface, uint32_t version) +{ + if (strcmp(interface, wl_compositor_interface.name) == 0) { + compositor = wl_registry_bind(reg, name, &wl_compositor_interface, 4); + } else if (strcmp(interface, wl_subcompositor_interface.name) == 0) { + subcompositor = wl_registry_bind(reg, name, &wl_subcompositor_interface, 1); + } +} + +static void global_remove(void *data, struct wl_registry *reg, uint32_t name) +{ +} + +static const struct wl_registry_listener registry_listener = { + .global = global, + .global_remove = global_remove, +}; + +int main(void) +{ + struct wl_display *display = wl_display_connect("test"); + + struct wl_registry *registry = wl_display_get_registry(display); + wl_registry_add_listener(registry, ®istry_listener, NULL); + wl_display_roundtrip(display); + + struct wl_surface *parent = wl_compositor_create_surface(compositor); + + struct wl_surface *surface = wl_compositor_create_surface(compositor); + struct wl_subsurface *subsurface = + wl_subcompositor_get_subsurface(subcompositor, surface, parent); + + wl_surface_damage(parent, 0, 0, 100, 100); + wl_surface_commit(parent); + + wl_subsurface_set_position(subsurface, -100, -100); + wl_surface_set_buffer_transform(parent, WL_OUTPUT_TRANSFORM_90); + wl_surface_commit(parent); + + wl_subsurface_set_position(subsurface, 100, 100); + wl_surface_commit(parent); + + while (wl_display_dispatch(display) != -1); + + const struct wl_interface *iface = NULL; + uint32_t error = 0; + wl_display_get_protocol_error(display, &iface, &error); + + if (error) { + printf("%u %s\n", error, iface->name); + } + + wl_display_disconnect(display); +} diff --git a/test-server.c b/test-server.c new file mode 100644 index 000000000..88955e5c8 --- /dev/null +++ b/test-server.c @@ -0,0 +1,29 @@ +#include +#include + +#include +#include + +struct wl_display *display; + +static void sigint(int signo) +{ + wl_display_terminate(display); +} + +int main(void) +{ + display = wl_display_create(); + wl_display_add_socket(display, "test"); + + signal(SIGINT, sigint); + + struct wlr_compositor *comp = wlr_compositor_create(display, NULL); + struct wlr_subcompositor *subcomp = wlr_subcompositor_create(comp); + + (void)subcomp; + wl_display_run(display); + + wl_display_destroy_clients(display); + wl_display_destroy(display); +} diff --git a/types/meson.build b/types/meson.build index a78fdf19d..5e7407c5d 100644 --- a/types/meson.build +++ b/types/meson.build @@ -1,73 +1,74 @@ lib_wlr_types = static_library( 'wlr_types', files( - 'data_device/wlr_data_device.c', - 'data_device/wlr_data_offer.c', - 'data_device/wlr_data_source.c', - 'data_device/wlr_drag.c', - 'seat/wlr_seat_keyboard.c', - 'seat/wlr_seat_pointer.c', - 'seat/wlr_seat_touch.c', - 'seat/wlr_seat.c', - 'tablet_v2/wlr_tablet_v2_pad.c', - 'tablet_v2/wlr_tablet_v2_tablet.c', - 'tablet_v2/wlr_tablet_v2_tool.c', - 'tablet_v2/wlr_tablet_v2.c', - 'xdg_shell_v6/wlr_xdg_popup_v6.c', - 'xdg_shell_v6/wlr_xdg_positioner_v6.c', - 'xdg_shell_v6/wlr_xdg_shell_v6.c', - 'xdg_shell_v6/wlr_xdg_surface_v6.c', - 'xdg_shell_v6/wlr_xdg_toplevel_v6.c', - 'xdg_shell/wlr_xdg_popup.c', - 'xdg_shell/wlr_xdg_positioner.c', - 'xdg_shell/wlr_xdg_shell.c', - 'xdg_shell/wlr_xdg_surface.c', - 'xdg_shell/wlr_xdg_toplevel.c', + #'data_device/wlr_data_device.c', + #'data_device/wlr_data_offer.c', + #'data_device/wlr_data_source.c', + #'data_device/wlr_drag.c', + #'seat/wlr_seat_keyboard.c', + #'seat/wlr_seat_pointer.c', + #'seat/wlr_seat_touch.c', + #'seat/wlr_seat.c', + #'tablet_v2/wlr_tablet_v2_pad.c', + #'tablet_v2/wlr_tablet_v2_tablet.c', + #'tablet_v2/wlr_tablet_v2_tool.c', + #'tablet_v2/wlr_tablet_v2.c', + #'xdg_shell_v6/wlr_xdg_popup_v6.c', + #'xdg_shell_v6/wlr_xdg_positioner_v6.c', + #'xdg_shell_v6/wlr_xdg_shell_v6.c', + #'xdg_shell_v6/wlr_xdg_surface_v6.c', + #'xdg_shell_v6/wlr_xdg_toplevel_v6.c', + #'xdg_shell/wlr_xdg_popup.c', + #'xdg_shell/wlr_xdg_positioner.c', + #'xdg_shell/wlr_xdg_shell.c', + #'xdg_shell/wlr_xdg_surface.c', + #'xdg_shell/wlr_xdg_toplevel.c', 'wlr_box.c', 'wlr_buffer.c', 'wlr_compositor.c', - 'wlr_cursor.c', - 'wlr_data_control_v1.c', - 'wlr_export_dmabuf_v1.c', - 'wlr_foreign_toplevel_management_v1.c', - 'wlr_fullscreen_shell_v1.c', - 'wlr_gamma_control_v1.c', - 'wlr_gamma_control.c', - 'wlr_gtk_primary_selection.c', - 'wlr_idle_inhibit_v1.c', - 'wlr_idle.c', - 'wlr_input_device.c', - 'wlr_input_inhibitor.c', - 'wlr_input_method_v2.c', + 'wlr_subcompositor.c', + #'wlr_cursor.c', + #'wlr_data_control_v1.c', + #'wlr_export_dmabuf_v1.c', + #'wlr_foreign_toplevel_management_v1.c', + #'wlr_fullscreen_shell_v1.c', + #'wlr_gamma_control_v1.c', + #'wlr_gamma_control.c', + #'wlr_gtk_primary_selection.c', + #'wlr_idle_inhibit_v1.c', + #'wlr_idle.c', + #'wlr_input_device.c', + #'wlr_input_inhibitor.c', + #'wlr_input_method_v2.c', 'wlr_keyboard.c', - 'wlr_layer_shell_v1.c', + #'wlr_layer_shell_v1.c', 'wlr_linux_dmabuf_v1.c', 'wlr_list.c', 'wlr_matrix.c', - 'wlr_output_damage.c', - 'wlr_output_layout.c', + #'wlr_output_damage.c', + #'wlr_output_layout.c', 'wlr_output_management_v1.c', - 'wlr_output.c', - 'wlr_pointer_constraints_v1.c', - 'wlr_pointer_gestures_v1.c', + #'wlr_output.c', + #'wlr_pointer_constraints_v1.c', + #'wlr_pointer_gestures_v1.c', 'wlr_pointer.c', - 'wlr_presentation_time.c', - 'wlr_primary_selection_v1.c', - 'wlr_primary_selection.c', - 'wlr_relative_pointer_v1.c', - 'wlr_screencopy_v1.c', - 'wlr_screenshooter.c', - 'wlr_server_decoration.c', - 'wlr_surface.c', + #'wlr_presentation_time.c', + #'wlr_primary_selection_v1.c', + #'wlr_primary_selection.c', + #'wlr_relative_pointer_v1.c', + #'wlr_screencopy_v1.c', + #'wlr_screenshooter.c', + #'wlr_server_decoration.c', + #'wlr_surface.c', 'wlr_switch.c', 'wlr_tablet_pad.c', - 'wlr_tablet_tool.c', - 'wlr_text_input_v3.c', + #'wlr_tablet_tool.c', + #'wlr_text_input_v3.c', 'wlr_touch.c', - 'wlr_virtual_keyboard_v1.c', - 'wlr_xcursor_manager.c', - 'wlr_xdg_decoration_v1.c', - 'wlr_xdg_output_v1.c', + #'wlr_virtual_keyboard_v1.c', + #'wlr_xcursor_manager.c', + #'wlr_xdg_decoration_v1.c', + #'wlr_xdg_output_v1.c', ), include_directories: wlr_inc, dependencies: [ diff --git a/types/wlr_subcompositor.c b/types/wlr_subcompositor.c index 4b4327e78..e57fde29f 100644 --- a/types/wlr_subcompositor.c +++ b/types/wlr_subcompositor.c @@ -62,8 +62,8 @@ static void subsurface_destroy(struct wl_client *client, struct wl_resource *res static void subsurface_set_position(struct wl_client *client, struct wl_resource *res, int32_t x, int32_t y) { - struct wlr_subsurface *ss = subsurface_from_resource(res); - struct wlr_commit *commit = wlr_surface_get_pending(ss->parent); + //struct wlr_subsurface *ss = subsurface_from_resource(res); + //struct wlr_commit *commit = wlr_surface_get_pending(ss->parent); } static void subsurface_place_above(struct wl_client *client,