mirror of
https://github.com/cage-kiosk/cage.git
synced 2026-05-07 12:06:49 -04:00
Compare commits
No commits in common. "master" and "v0.3.0" have entirely different histories.
4 changed files with 37 additions and 50 deletions
16
.github/workflows/main.yml
vendored
16
.github/workflows/main.yml
vendored
|
|
@ -7,8 +7,6 @@ on:
|
||||||
|
|
||||||
env:
|
env:
|
||||||
WLROOTS_VERSION: "0.20"
|
WLROOTS_VERSION: "0.20"
|
||||||
ALPINE_PACKAGES: "build-base xcb-util-wm-dev libseat-dev clang git eudev-dev mesa-dev libdrm-dev libinput-dev libxkbcommon-dev pixman-dev wayland-dev meson wayland-protocols xwayland-dev scdoc-doc hwdata libdisplay-info-dev"
|
|
||||||
ARCHLINUX_PACKAGES: "xcb-util-wm seatd git clang meson libinput libdrm mesa libxkbcommon wayland wayland-protocols xorg-server-xwayland scdoc libdisplay-info"
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
compile:
|
compile:
|
||||||
|
|
@ -28,20 +26,20 @@ jobs:
|
||||||
|
|
||||||
- name: Install dependencies (Alpine)
|
- name: Install dependencies (Alpine)
|
||||||
if: "matrix.OS == 'alpine:edge'"
|
if: "matrix.OS == 'alpine:edge'"
|
||||||
run: apk add $ALPINE_PACKAGES
|
run: apk add build-base xcb-util-wm-dev libseat-dev clang git eudev-dev mesa-dev libdrm-dev libinput-dev libxkbcommon-dev pixman-dev wayland-dev meson wayland-protocols xwayland-dev scdoc-doc hwdata libdisplay-info-dev
|
||||||
|
|
||||||
- name: Install dependencies (Arch)
|
- name: Install dependencies (Arch)
|
||||||
if: "matrix.OS == 'archlinux:base-devel'"
|
if: "matrix.OS == 'archlinux:base-devel'"
|
||||||
run: |
|
run: |
|
||||||
pacman-key --init
|
pacman-key --init
|
||||||
pacman -Syu --noconfirm $ARCHLINUX_PACKAGES
|
pacman -Syu --noconfirm xcb-util-wm seatd git clang meson libinput libdrm mesa libxkbcommon wayland wayland-protocols xorg-server-xwayland scdoc libdisplay-info
|
||||||
|
|
||||||
- name: Fetch wlroots as a subproject
|
- name: Fetch wlroots as a subproject
|
||||||
run: git clone https://gitlab.freedesktop.org/wlroots/wlroots.git subprojects/wlroots -b $WLROOTS_VERSION
|
run: git clone https://gitlab.freedesktop.org/wlroots/wlroots.git subprojects/wlroots -b $WLROOTS_VERSION
|
||||||
|
|
||||||
- name: Compile Cage (XWayland=${{ matrix.xwayland }})
|
- name: Compile Cage (XWayland=${{ matrix.xwayland }})
|
||||||
run: |
|
run: |
|
||||||
meson setup --fatal-meson-warnings --wrap-mode=nodownload \
|
meson --fatal-meson-warnings --wrap-mode=nodownload \
|
||||||
build-${{ matrix.CC }}-${{matrix.xwayland }} \
|
build-${{ matrix.CC }}-${{matrix.xwayland }} \
|
||||||
-Dwlroots:xwayland=${{ matrix.xwayland }}
|
-Dwlroots:xwayland=${{ matrix.xwayland }}
|
||||||
ninja -C build-${{ matrix.CC }}-${{matrix.xwayland }}
|
ninja -C build-${{ matrix.CC }}-${{matrix.xwayland }}
|
||||||
|
|
@ -55,12 +53,12 @@ jobs:
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: |
|
run: |
|
||||||
pacman-key --init
|
pacman-key --init
|
||||||
pacman -Syu --noconfirm $ARCHLINUX_PACKAGES
|
pacman -Syu --noconfirm xcb-util-wm seatd git clang meson libinput libdrm mesa libxkbcommon wayland wayland-protocols xorg-server-xwayland scdoc hwdata libdisplay-info
|
||||||
- name: Fetch wlroots as a subproject
|
- name: Fetch wlroots as a subproject
|
||||||
run: git clone https://gitlab.freedesktop.org/wlroots/wlroots.git subprojects/wlroots -b $WLROOTS_VERSION
|
run: git clone https://gitlab.freedesktop.org/wlroots/wlroots.git subprojects/wlroots -b $WLROOTS_VERSION
|
||||||
- name: Check for formatting changes
|
- name: Check for formatting changes
|
||||||
run: |
|
run: |
|
||||||
meson setup --wrap-mode=nodownload build-clang-format -Dwlroots:xwayland=enabled
|
meson --wrap-mode=nodownload build-clang-format -Dwlroots:xwayland=enabled
|
||||||
ninja -C build-clang-format clang-format-check
|
ninja -C build-clang-format clang-format-check
|
||||||
|
|
||||||
scan-build:
|
scan-build:
|
||||||
|
|
@ -74,10 +72,10 @@ jobs:
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: |
|
run: |
|
||||||
pacman-key --init
|
pacman-key --init
|
||||||
pacman -Syu --noconfirm $ARCHLINUX_PACKAGES
|
pacman -Syu --noconfirm xcb-util-wm seatd git clang meson libinput libdrm mesa libxkbcommon wayland wayland-protocols xorg-server-xwayland scdoc hwdata libdisplay-info
|
||||||
- name: Fetch wlroots as a subproject
|
- name: Fetch wlroots as a subproject
|
||||||
run: git clone https://gitlab.freedesktop.org/wlroots/wlroots.git subprojects/wlroots -b $WLROOTS_VERSION
|
run: git clone https://gitlab.freedesktop.org/wlroots/wlroots.git subprojects/wlroots -b $WLROOTS_VERSION
|
||||||
- name: Run scan-build
|
- name: Run scan-build
|
||||||
run: |
|
run: |
|
||||||
meson setup --wrap-mode=nodownload build-scan-build -Dwlroots:xwayland=enabled
|
meson --wrap-mode=nodownload build-scan-build -Dwlroots:xwayland=enabled
|
||||||
ninja -C build-scan-build scan-build
|
ninja -C build-scan-build scan-build
|
||||||
|
|
|
||||||
16
cage.c
16
cage.c
|
|
@ -248,7 +248,6 @@ usage(FILE *file, const char *cage)
|
||||||
" -m last Use only the last connected output\n"
|
" -m last Use only the last connected output\n"
|
||||||
" -s\t Allow VT switching\n"
|
" -s\t Allow VT switching\n"
|
||||||
" -v\t Show the version number and exit\n"
|
" -v\t Show the version number and exit\n"
|
||||||
" -x\t Disable XWayland\n"
|
|
||||||
"\n"
|
"\n"
|
||||||
" Use -- when you want to pass arguments to APPLICATION\n",
|
" Use -- when you want to pass arguments to APPLICATION\n",
|
||||||
cage);
|
cage);
|
||||||
|
|
@ -257,10 +256,8 @@ usage(FILE *file, const char *cage)
|
||||||
static bool
|
static bool
|
||||||
parse_args(struct cg_server *server, int argc, char *argv[])
|
parse_args(struct cg_server *server, int argc, char *argv[])
|
||||||
{
|
{
|
||||||
server->enable_xwayland = true;
|
|
||||||
|
|
||||||
int c;
|
int c;
|
||||||
while ((c = getopt(argc, argv, "dDhm:svx")) != -1) {
|
while ((c = getopt(argc, argv, "dDhm:sv")) != -1) {
|
||||||
switch (c) {
|
switch (c) {
|
||||||
case 'd':
|
case 'd':
|
||||||
server->xdg_decoration = true;
|
server->xdg_decoration = true;
|
||||||
|
|
@ -284,9 +281,6 @@ parse_args(struct cg_server *server, int argc, char *argv[])
|
||||||
case 'v':
|
case 'v':
|
||||||
fprintf(stdout, "Cage version " CAGE_VERSION "\n");
|
fprintf(stdout, "Cage version " CAGE_VERSION "\n");
|
||||||
exit(0);
|
exit(0);
|
||||||
case 'x':
|
|
||||||
server->enable_xwayland = false;
|
|
||||||
break;
|
|
||||||
default:
|
default:
|
||||||
usage(stderr, argv[0]);
|
usage(stderr, argv[0]);
|
||||||
return false;
|
return false;
|
||||||
|
|
@ -568,9 +562,7 @@ main(int argc, char *argv[])
|
||||||
|
|
||||||
#if CAGE_HAS_XWAYLAND
|
#if CAGE_HAS_XWAYLAND
|
||||||
struct wlr_xcursor_manager *xcursor_manager = NULL;
|
struct wlr_xcursor_manager *xcursor_manager = NULL;
|
||||||
struct wlr_xwayland *xwayland = NULL;
|
struct wlr_xwayland *xwayland = wlr_xwayland_create(server.wl_display, compositor, true);
|
||||||
if (server.enable_xwayland) {
|
|
||||||
xwayland = wlr_xwayland_create(server.wl_display, compositor, true);
|
|
||||||
if (!xwayland) {
|
if (!xwayland) {
|
||||||
wlr_log(WLR_ERROR, "Cannot create XWayland server");
|
wlr_log(WLR_ERROR, "Cannot create XWayland server");
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -594,15 +586,13 @@ main(int argc, char *argv[])
|
||||||
if (!wlr_xcursor_manager_load(xcursor_manager, 1)) {
|
if (!wlr_xcursor_manager_load(xcursor_manager, 1)) {
|
||||||
wlr_log(WLR_ERROR, "Cannot load XWayland XCursor theme");
|
wlr_log(WLR_ERROR, "Cannot load XWayland XCursor theme");
|
||||||
}
|
}
|
||||||
struct wlr_xcursor *xcursor =
|
struct wlr_xcursor *xcursor = wlr_xcursor_manager_get_xcursor(xcursor_manager, DEFAULT_XCURSOR, 1);
|
||||||
wlr_xcursor_manager_get_xcursor(xcursor_manager, DEFAULT_XCURSOR, 1);
|
|
||||||
if (xcursor) {
|
if (xcursor) {
|
||||||
struct wlr_xcursor_image *image = xcursor->images[0];
|
struct wlr_xcursor_image *image = xcursor->images[0];
|
||||||
wlr_xwayland_set_cursor(xwayland, wlr_xcursor_image_get_buffer(image), image->hotspot_x,
|
wlr_xwayland_set_cursor(xwayland, wlr_xcursor_image_get_buffer(image), image->hotspot_x,
|
||||||
image->hotspot_y);
|
image->hotspot_y);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
const char *socket = wl_display_add_socket_auto(server.wl_display);
|
const char *socket = wl_display_add_socket_auto(server.wl_display);
|
||||||
|
|
|
||||||
4
seat.c
4
seat.c
|
|
@ -816,9 +816,9 @@ seat_create(struct cg_server *server, struct wlr_backend *backend)
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
seat->seat = wlr_seat_create(server->wl_display, "default");
|
seat->seat = wlr_seat_create(server->wl_display, "seat0");
|
||||||
if (!seat->seat) {
|
if (!seat->seat) {
|
||||||
wlr_log(WLR_ERROR, "Cannot allocate seat");
|
wlr_log(WLR_ERROR, "Cannot allocate seat0");
|
||||||
free(seat);
|
free(seat);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
1
server.h
1
server.h
|
|
@ -72,7 +72,6 @@ struct cg_server {
|
||||||
|
|
||||||
bool xdg_decoration;
|
bool xdg_decoration;
|
||||||
bool allow_vt_switch;
|
bool allow_vt_switch;
|
||||||
bool enable_xwayland;
|
|
||||||
bool return_app_code;
|
bool return_app_code;
|
||||||
bool terminated;
|
bool terminated;
|
||||||
enum wlr_log_importance log_level;
|
enum wlr_log_importance log_level;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue