Логи закрытия
This commit is contained in:
@@ -5,14 +5,15 @@
|
||||
|
||||
/* Data for a single Wayland window (one surface) */
|
||||
struct wayland_window {
|
||||
int id;
|
||||
struct wl_surface *wl_surface;
|
||||
struct wl_buffer *buffer;
|
||||
struct wl_callback *frame_callback;
|
||||
struct xdg_surface *xdg_surface;
|
||||
struct xdg_toplevel *xdg_toplevel;
|
||||
uint8_t *data;
|
||||
int16_t width;
|
||||
int16_t height;
|
||||
int32_t width;
|
||||
int32_t height;
|
||||
int need_close;
|
||||
uint8_t color;
|
||||
};
|
||||
|
||||
@@ -80,7 +80,7 @@ static void *window_thread_main(void *arg)
|
||||
break;
|
||||
}
|
||||
}
|
||||
printf("Window # closed");
|
||||
printf("Window #%d closed\n", slot->window.id);
|
||||
|
||||
input_cleanup();
|
||||
window_destroy(&slot->window);
|
||||
|
||||
@@ -11,7 +11,6 @@
|
||||
#include <string.h>
|
||||
#include <stdatomic.h>
|
||||
|
||||
// Moving all window specific data into `struct wayland_window`.
|
||||
|
||||
static struct wl_callback_listener callback_listener;
|
||||
static struct xdg_surface_listener surface_listener;
|
||||
@@ -76,7 +75,7 @@ static void resize_canvas(struct wayland_window *win)
|
||||
win->data = map;
|
||||
}
|
||||
|
||||
static void resize_new(struct wayland_window *win, int16_t w, int16_t h)
|
||||
static void resize_new(struct wayland_window *win, int32_t w, int32_t h)
|
||||
{
|
||||
if (!w || !h)
|
||||
return;
|
||||
@@ -166,6 +165,7 @@ static void wm_base_ping(void *data, struct xdg_wm_base *wm_base, uint32_t seria
|
||||
|
||||
int window_init(struct wl_display *display, struct wayland_window *win)
|
||||
{
|
||||
static int id = 0;
|
||||
(void)display;
|
||||
struct wl_compositor *compositor = registry_get_compositor();
|
||||
struct wl_shm *shm = registry_get_shm();
|
||||
@@ -198,6 +198,7 @@ int window_init(struct wl_display *display, struct wayland_window *win)
|
||||
xdg_wm_base_add_listener(wm, &wm_base_listener, win);
|
||||
|
||||
/* initialize state */
|
||||
win->id = id++;
|
||||
win->width = 200;
|
||||
win->height = 100;
|
||||
win->data = NULL;
|
||||
|
||||
Reference in New Issue
Block a user