Unfinished Wayland PR #1

Merged
IoI_xD merged 55 commits from IoI_xD/milsko:wayland into master 2025-12-10 11:11:02 +09:00
4 changed files with 10 additions and 12 deletions
Showing only changes of commit 71aac9987c - Show all commits

revert some leaks into other code files

IoIxD 2025-12-05 22:48:02 -07:00

View file

@ -34,8 +34,6 @@ struct _MwLLCommon {
void* user; void* user;
int copy_buffer; int copy_buffer;
int type; int type;
int success;
int do_redraw;
MwLLHandler handler; MwLLHandler handler;
}; };

View file

@ -8,6 +8,7 @@
#include <fcntl.h> #include <fcntl.h>
#include <errno.h> #include <errno.h>
#include <poll.h> #include <poll.h>
#include <signal.h>
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
@ -468,7 +469,7 @@ static void setup_toplevel(MwLL r, int x, int y) {
r->wayland.display = wl_display_connect(NULL); r->wayland.display = wl_display_connect(NULL);
if(r->wayland.display == NULL) { if(r->wayland.display == NULL) {
printf("wayland: failed to create display\n"); printf("wayland: failed to create display\n");
r->common.success = MwFALSE; raise(SIGTRAP);
return; return;
} }
@ -477,7 +478,7 @@ static void setup_toplevel(MwLL r, int x, int y) {
wl_registry_add_listener(r->wayland.registry, &r->wayland.registry_listener, r); wl_registry_add_listener(r->wayland.registry, &r->wayland.registry_listener, r);
if(wl_display_roundtrip(r->wayland.display) == -1) { if(wl_display_roundtrip(r->wayland.display) == -1) {
printf("roundtrip failed\n"); printf("roundtrip failed\n");
r->common.success = MwFALSE; raise(SIGTRAP);
return; return;
} }
@ -488,7 +489,7 @@ static void setup_toplevel(MwLL r, int x, int y) {
WAYLAND_GET_INTERFACE(r->wayland, wl_seat)->context == NULL) { WAYLAND_GET_INTERFACE(r->wayland, wl_seat)->context == NULL) {
printf("no wl_shm, wl_compositor, wl_seat, or xdg_wm_base support\n"); printf("no wl_shm, wl_compositor, wl_seat, or xdg_wm_base support\n");
r->common.success = MwFALSE; raise(SIGTRAP);
return; return;
} }
@ -625,7 +626,6 @@ static MwLL MwLLCreateImpl(MwLL parent, int x, int y, int width, int height) {
r->wayland.parent = parent; r->wayland.parent = parent;
r->wayland.force_redraw = MwFALSE; r->wayland.force_redraw = MwFALSE;
r->common.success = MwTRUE;
r->wayland.subwidgets = NULL; r->wayland.subwidgets = NULL;
if(parent == NULL) { if(parent == NULL) {