Skip to content
This repository has been archived by the owner on Sep 27, 2024. It is now read-only.

Commit

Permalink
feat: adding missing libs and adding some protocols
Browse files Browse the repository at this point in the history
  • Loading branch information
RossComputerGuy committed May 3, 2024
1 parent e9d8400 commit dbde557
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 2 deletions.
3 changes: 2 additions & 1 deletion flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@
src = lib.cleanSource self;

buildInputs = with s; lib.optionalAttrs (stdenv.isLinux) [
pam accountsservice polkit seatd wlroots_0_17 libdrm libGL
pam accountsservice polkit seatd wlroots_0_17 libdrm libGL libxkbcommon
mesa vulkan-loader
];

pubspecLock = lib.importJSON ./pubspec.lock.json;
Expand Down
2 changes: 1 addition & 1 deletion linux/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ pkg_check_modules(ACCOUNTSSERVICE REQUIRED IMPORTED_TARGET accountsservice)
pkg_check_modules(GTK REQUIRED IMPORTED_TARGET gtk+-3.0)
pkg_check_modules(LIBSEAT REQUIRED IMPORTED_TARGET libseat)
pkg_check_modules(PAM REQUIRED IMPORTED_TARGET pam)
pkg_check_modules(WLROOTS REQUIRED IMPORTED_TARGET wlroots wayland-server)
pkg_check_modules(WLROOTS REQUIRED IMPORTED_TARGET wlroots wayland-server xkbcommon)

add_definitions(-DAPPLICATION_ID="${APPLICATION_ID}" -DWLR_USE_UNSTABLE)

Expand Down
12 changes: 12 additions & 0 deletions linux/channels/display.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,23 @@ static void method_call_handler(FlMethodChannel* channel, FlMethodCall* method_c
const char* socket = wl_display_add_socket_auto(disp->display);
if (socket == NULL) {
fl_method_call_respond_error(method_call, "wayland", "failed to create socket", NULL, NULL);
wlr_backend_destroy(disp->backend);
wl_display_destroy(disp->display);
free(disp);
return;
}

if (!wlr_backend_start(disp->backend)) {
fl_method_call_respond_error(method_call, "wlroots", "failed to start backend", NULL, NULL);
wlr_backend_destroy(disp->backend);
wl_display_destroy(disp->display);
free(disp);
return;
}

wlr_subcompositor_create(disp->display);
wlr_data_device_manager_create(disp->display);

pthread_create(&disp->thread, NULL, (void *(*)(void*))wl_display_run, disp->display);
g_hash_table_insert(self->displays, (gpointer)g_strdup(socket), (gpointer)disp);

Expand Down
2 changes: 2 additions & 0 deletions linux/channels/display.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ extern "C" {
#endif

#include <wlr/backend/headless.h>
#include <wlr/types/wlr_data_device.h>
#include <wlr/types/wlr_subcompositor.h>
#include <wayland-server.h>

#ifdef __cplusplus
Expand Down

0 comments on commit dbde557

Please sign in to comment.