Preparing Waybox 0.0.1

This commit is contained in:
Keith Bowes 2020-02-25 20:13:01 -05:00
parent cb67c24718
commit 1655316202
4 changed files with 22 additions and 1 deletions

View file

@ -10,6 +10,7 @@
#include <stdlib.h>
#include <time.h>
#include <wlr/version.h>
#include <wlr/backend.h>
#include <wlr/render/wlr_renderer.h>
#include <wlr/render/wlr_texture.h>
@ -18,7 +19,12 @@
#include <wlr/types/wlr_screencopy_v1.h>
#include <wlr/types/wlr_matrix.h>
#include <wlr/types/wlr_gamma_control_v1.h>
#if WLR_VERSION_NUM > 1
//wlroots 0.2+
#include <wlr/types/wlr_gtk_primary_selection.h>
#else
#include <wlr/types/wlr_primary_selection.h>
#endif
#include <wlr/types/wlr_output_layout.h>
#include <wlr/types/wlr_xdg_shell.h>

View file

@ -30,7 +30,7 @@ add_project_arguments('-DWL_HIDE_DEPRECATED', language: 'c')
inc_dir = include_directories('include')
pixman = dependency('pixman-1')
wlroots = dependency('wlroots', version: '>=0.6.0')
wlroots = dependency('wlroots', version: ['>=0.1.0', '<=0.8.1'])
wayland_server = dependency('wayland-server')
wayland_client = dependency('wayland-client')
wayland_protos = dependency('wayland-protocols', version: '>=1.12')

View file

@ -10,7 +10,12 @@ void output_frame_notify(struct wl_listener *listener, void *data) {
struct timespec now;
clock_gettime(CLOCK_MONOTONIC, &now);
#if WLR_VERSION_NUM > 1280
// wlroots 0.6.0+
wlr_output_attach_render(wlr_output, NULL);
#else
wlr_output_make_current(wlr_output, NULL);
#endif
wlr_renderer_begin(renderer, wlr_output->width, wlr_output->height);
float color[4] = {0.4f, 0.4f, 0.4f, 1.0f};
@ -35,7 +40,12 @@ void output_frame_notify(struct wl_listener *listener, void *data) {
wlr_surface_send_frame_done(surface, &now);
}
#if WLR_VERSION_NUM > 1280
// wlroots 0.6.0+
wlr_output_commit(wlr_output);
#else
wlr_output_swap_buffers(wlr_output, NULL, NULL);
#endif
wlr_renderer_end(renderer);
output->last_frame = now;
}

View file

@ -63,7 +63,12 @@ bool start_wb(struct wb_server* server) {
wlr_gamma_control_manager_v1_create(server->wl_display);
wlr_screencopy_manager_v1_create(server->wl_display);
#if WLR_VERSION_NUM > 1
// wlroots 0.2+
wlr_gtk_primary_selection_device_manager_create(server->wl_display);
#else
wlr_primary_selection_device_manager_create(server->wl_display);
#endif
wlr_idle_create(server->wl_display);
server->compositor = wlr_compositor_create(server->wl_display,