mirror of
https://github.com/wizbright/waybox.git
synced 2025-10-29 05:40:20 -04:00
Preparing Waybox 0.0.1
This commit is contained in:
parent
cb67c24718
commit
1655316202
4 changed files with 22 additions and 1 deletions
|
|
@ -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>
|
||||
|
||||
|
|
|
|||
|
|
@ -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')
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue