summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--meson.build48
-rw-r--r--meson_options.txt4
-rw-r--r--src/egl_common.c2
-rw-r--r--src/poll_common.c5
-rw-r--r--src/window.c6
-rw-r--r--src/window.h23
-rw-r--r--src/window_glfm.c17
-rw-r--r--src/window_glfw.c32
-rw-r--r--src/window_kms.c11
-rw-r--r--src/window_wayland.c56
-rw-r--r--src/window_x11.c26
-rw-r--r--subprojects/libalabaster.wrap2
-rw-r--r--subprojects/libnaunet.wrap2
13 files changed, 122 insertions, 112 deletions
diff --git a/meson.build b/meson.build
index 8d8ff85..90d7b93 100644
--- a/meson.build
+++ b/meson.build
@@ -50,33 +50,31 @@ endif
if get_option('api') == 'null'
stela_args += ['-DSTELA_API_NULL']
-elif get_option('api') == 'opengl'
+elif get_option('api') in ['gl', 'gles']
use_glad = false
- use_gles = false
- if get_option('window') not in ['glfm']
- if get_option('window') in ['x11', 'wayland']
- if get_option('egl-brcm')
- # Raspberry Pi (legacy proprietary driver)
- #brcmEGL = dependency('brcmegl')
- #brcmGLESv2 = dependency('brcmglesv2')
- #stela_deps += [brcmEGL, brcmGLESv2]
- use_gles = true
- # Try to use Mesa VC4 instead.
- else
- endif
- egl = dependency('egl')
- stela_deps += [egl]
- stela_src += ['src/egl_common.c']
- stela_args += ['-DSTELA_USE_EGL']
- endif
- if use_glad
- stela_deps += [subproject('glad', default_options: [
- use_gles ? 'use_gles=true' : 'use_gles=false'
- ]).get_variable('glad')]
- stela_args += ['-DSTELA_USE_GLAD']
- else
- stela_deps += [dependency('gl')]
+ use_gles = get_option('api') == 'gles'
+ if is_linux or is_android
+ stela_args += ['-DSTELA_USE_EGL']
+ endif
+ if get_option('window') in ['wayland', 'x11', 'kms']
+ if get_option('egl-brcm')
+ # Raspberry Pi (legacy proprietary driver)
+ #brcmEGL = dependency('brcmegl')
+ #brcmGLESv2 = dependency('brcmglesv2')
+ #stela_deps += [brcmEGL, brcmGLESv2]
+ #use_gles = true
+ # Try to use Mesa VC4 instead.
endif
+ egl = dependency('egl')
+ stela_deps += [egl]
+ stela_src += ['src/egl_common.c']
+ endif
+ if use_glad
+ glad_opts = use_gles ? 'use_gles=true' : 'use_gles=false'
+ stela_deps += [subproject('glad', default_options: glad_opts).get_variable('glad')]
+ stela_args += ['-DSTELA_USE_GLAD']
+ else
+ stela_deps += [dependency('gl')]
endif
if use_gles
stela_args += ['-DSTELA_USE_GLES']
diff --git a/meson_options.txt b/meson_options.txt
index 9612976..2a89669 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -1,5 +1,5 @@
-option('api', type: 'combo', choices: ['null', 'opengl', 'vulkan', 'dx11'], value: 'null')
-option('window', type: 'combo', choices: ['wayland', 'x11', 'glfw', 'glfm'], value: 'wayland')
+option('api', type: 'combo', choices: ['null', 'gl', 'gles', 'vulkan', 'dx11'], value: 'null')
+option('window', type: 'combo', choices: ['wayland', 'x11', 'kms', 'glfw', 'glfm'], value: 'wayland')
option('egl-brcm', type: 'boolean', value: false)
option('poll', type: 'combo', choices: ['inline', 'fd'], value: 'inline')
option('event-buffer', type: 'boolean', value: false)
diff --git a/src/egl_common.c b/src/egl_common.c
index 818873f..7bbcba9 100644
--- a/src/egl_common.c
+++ b/src/egl_common.c
@@ -137,7 +137,7 @@ bool stl_init_egl_context(struct stl_egl *egl, struct stl_egl_global *global, EG
if (!egl_choose_config(egl->display, window_attr, visual_id, config)) {
al_log_error("egl", "Failed to get config.");
- return false;
+ continue;
}
al_log_info("egl", "Trying to create a %s context of version %i.%i (GLSL %i).",
diff --git a/src/poll_common.c b/src/poll_common.c
index 5e7f38a..a592b55 100644
--- a/src/poll_common.c
+++ b/src/poll_common.c
@@ -20,8 +20,9 @@ bool stl_poll_common(struct nn_pollfd *fds, bool block)
return false;
}
- // This happens consistantly if a program is lagging too much.
- // TODO: Recovery.
+ // This will happen consistantly if a program is lagging too hard.
+ // https://github.com/swaywm/sway/commit/e3f0ba4cd9ca709cac115ade54958885614d889c
+ // @TODO: Recovery.
if (fds[0].revents & (POLLERR | POLLHUP | POLLNVAL)) { // Fatal error.
al_log_error("poll_common", "poll() returned error in revents (%d).", fds[0].revents);
al_assert(false);
diff --git a/src/window.c b/src/window.c
index 762adce..9afe285 100644
--- a/src/window.c
+++ b/src/window.c
@@ -100,7 +100,7 @@ void stl_window_send_key_event(struct stl_window *window, u8 state, u8 button)
#endif
}
-void stl_window_send_resize_event(struct stl_window *window, s32 width, s32 height)
+void stl_window_send_resize_event(struct stl_window *window, u32 width, u32 height)
{
#ifdef STELA_EVENT_BUFFER
(void)width;
@@ -147,8 +147,8 @@ bool stl_window_read_events(struct stl_window *window)
u8 op = STELA_EVENT_NONE;
if (window->pending_resize) {
- s32 width = window->width;
- s32 height = window->height;
+ u32 width = window->width;
+ u32 height = window->height;
window->resize_internal(window, width, height);
if (window->resize_callback) {
window->resize_callback(window->userdata, width, height);
diff --git a/src/window.h b/src/window.h
index afe797e..11ba00f 100644
--- a/src/window.h
+++ b/src/window.h
@@ -40,17 +40,17 @@ enum {
#define STELA_MAX_MONITOR_NAME 255u
struct stl_monitor {
- s32 width;
- s32 height;
- s32 scale;
+ u32 width;
+ u32 height;
+ u32 scale;
bool vertical;
char name[STELA_MAX_MONITOR_NAME];
};
struct stl_window {
- s32 width;
- s32 height;
- s32 scale;
+ u32 width;
+ u32 height;
+ u32 scale;
bool fullscreen;
#ifdef STELA_EVENT_BUFFER
u8 *data;
@@ -62,10 +62,9 @@ struct stl_window {
bool pending_refresh;
#endif
// Methods.
- bool (*create_context)(struct stl_window *, s32);
- bool (*create_window)(struct stl_window *, s32, s32, const char *, const char *, s32);
- void (*resize_internal)(struct stl_window *, s32, s32);
- void (*resize)(struct stl_window *, s32, s32);
+ bool (*create_window)(struct stl_window *, u32, u32, const char *, const char *, u32);
+ void (*resize_internal)(struct stl_window *, u32, u32);
+ void (*resize)(struct stl_window *, u32, u32);
void (*toggle_fullscreen)(struct stl_window *);
#ifdef STELA_POLL_INLINE
bool (*poll)(struct stl_window *, bool);
@@ -103,7 +102,7 @@ struct stl_window {
bool (*key_callback)(void *, u8, u8);
// Always runs on the thread that's processing events.
void (*key_immediate_callback)(void *, u8, u8);
- void (*resize_callback)(void *, s32, s32);
+ void (*resize_callback)(void *, u32, u32);
void (*refresh_callback)(void *);
void (*should_close_callback)(void *);
void *userdata;
@@ -147,7 +146,7 @@ void stl_window_send_pointer_pos_event(struct stl_window *window, f64 x, f64 y);
void stl_window_send_scroll_event(struct stl_window *window, f64 y);
void stl_window_send_mouse_button_event(struct stl_window *window, u8 state, u8 button);
void stl_window_send_key_event(struct stl_window *window, u8 state, u8 button);
-void stl_window_send_resize_event(struct stl_window *window, s32 width, s32 height);
+void stl_window_send_resize_event(struct stl_window *window, u32 width, u32 height);
#ifdef STELA_POLL_INLINE
void stl_window_send_refresh_event(struct stl_window *window);
#endif
diff --git a/src/window_glfm.c b/src/window_glfm.c
index 4e4f034..29ab44b 100644
--- a/src/window_glfm.c
+++ b/src/window_glfm.c
@@ -27,16 +27,18 @@ void stl_global_close(void)
{
}
-static bool window_glfm_create_window(struct stl_window *window, s32 width, s32 height,
- const char *monitor, const char *name, s32 flags)
+static bool window_glfm_create_window(struct stl_window *window, u32 width, u32 height,
+ const char *monitor, const char *name, u32 flags)
{
struct stl_window_glfm *glfm = (struct stl_window_glfm *)window;
(void)monitor;
(void)name;
(void)flags;
- glfmGetDisplaySize(glfm->display, &width, &height);
- glfm->w.width = width;
- glfm->w.height = height;
+ s32 display_width, display_height;
+ glfmGetDisplaySize(glfm->display, &display_width, &display_height);
+ al_assert(display_width > 0 && display_height > 0);
+ glfm->w.width = (u32)display_width;
+ glfm->w.height = (u32)display_height;
#ifdef STELA_USE_EGL
glfm->w.egl_display = (EGLDisplay)glfmGetEglDisplay(glfm->display);
glfm->w.egl_context = (EGLContext)glfmGetEglContext(glfm->display);
@@ -44,14 +46,14 @@ static bool window_glfm_create_window(struct stl_window *window, s32 width, s32
return true;
}
-static void window_glfm_resize_internal(struct stl_window *window, s32 width, s32 height)
+static void window_glfm_resize_internal(struct stl_window *window, u32 width, u32 height)
{
(void)window;
(void)width;
(void)height;
}
-static void window_glfm_resize(struct stl_window *window, s32 width, s32 height)
+static void window_glfm_resize(struct stl_window *window, u32 width, u32 height)
{
(void)window;
(void)width;
@@ -130,7 +132,6 @@ struct stl_window *stl_window_create(void *context)
glfm->display = (GLFMDisplay *)context;
stl_window_common_init(&glfm->w);
glfm->w.fullscreen = false;
- glfm->w.create_context = NULL;
glfm->w.create_window = window_glfm_create_window;
glfm->w.resize_internal = window_glfm_resize_internal;
glfm->w.resize = window_glfm_resize;
diff --git a/src/window_glfw.c b/src/window_glfw.c
index dbf6a70..fc7b020 100644
--- a/src/window_glfw.c
+++ b/src/window_glfw.c
@@ -101,12 +101,21 @@ static void scroll_callback(GLFWwindow *window, f64 xoffset, f64 yoffset)
stl_window_send_scroll_event(&glfw->w, -yoffset);
}
-static void resize_callback(GLFWwindow *window, s32 width, s32 height)
+static void resize_callback(GLFWwindow *window, s32 event_width, s32 event_height)
{
struct stl_window_glfw *glfw = glfwGetWindowUserPointer(window);
- glfw->w.width = width;
- glfw->w.height = height;
- stl_window_send_resize_event(&glfw->w, width, height);
+ al_assert(event_width > 0 && event_height > 0);
+
+ u32 width = (u32)event_width;
+ u32 height = (u32)event_height;
+ if (width == glfw->w.width && height == glfw->w.height) {
+ return;
+ }
+
+ glfw->w.width = (u32)width;
+ glfw->w.height = (u32)height;
+
+ stl_window_send_resize_event(&glfw->w, glfw->w.width, glfw->w.height);
}
#ifdef STELA_POLL_INLINE
@@ -123,8 +132,8 @@ static void close_callback(GLFWwindow *window)
stl_window_send_should_close_event(&glfw->w);
}
-static bool window_glfw_create_window(struct stl_window *window, s32 width, s32 height,
- const char *monitor, const char *name, s32 flags)
+static bool window_glfw_create_window(struct stl_window *window, u32 width, u32 height,
+ const char *monitor, const char *name, u32 flags)
{
struct stl_window_glfw *glfw = (struct stl_window_glfw *)window;
(void)monitor;
@@ -183,7 +192,11 @@ static bool window_glfw_create_window(struct stl_window *window, s32 width, s32
(void)flags;
#endif
- glfwGetFramebufferSize(glfw->window, &glfw->w.width, &glfw->w.height);
+ s32 buffer_width, buffer_height;
+ glfwGetFramebufferSize(glfw->window, &buffer_width, &buffer_height);
+ al_assert(buffer_width > 0 && buffer_height > 0);
+ glfw->w.width = (u32)buffer_width;
+ glfw->w.height = (u32)buffer_height;
glfwSetWindowSizeLimits(glfw->window, STELA_MIN_WIDTH, STELA_MIN_HEIGHT, GLFW_DONT_CARE, GLFW_DONT_CARE);
glfw->prev.x = 0;
@@ -207,14 +220,14 @@ static bool window_glfw_create_window(struct stl_window *window, s32 width, s32
return true;
}
-static void window_glfw_resize_internal(struct stl_window *window, s32 width, s32 height)
+static void window_glfw_resize_internal(struct stl_window *window, u32 width, u32 height)
{
(void)window;
(void)width;
(void)height;
}
-static void window_glfw_resize(struct stl_window *window, s32 width, s32 height)
+static void window_glfw_resize(struct stl_window *window, u32 width, u32 height)
{
struct stl_window_glfw *glfw = (struct stl_window_glfw *)window;
glfwSetWindowAspectRatio(glfw->window, width, height);
@@ -388,7 +401,6 @@ struct stl_window *stl_window_create(void *context)
struct stl_window_glfw *glfw = al_alloc_object(struct stl_window_glfw);
stl_window_common_init(&glfw->w);
glfw->w.fullscreen = false;
- glfw->w.create_context = NULL;
glfw->w.create_window = window_glfw_create_window;
glfw->w.resize_internal = window_glfw_resize_internal;
glfw->w.resize = window_glfw_resize;
diff --git a/src/window_kms.c b/src/window_kms.c
index cc35213..58d68eb 100644
--- a/src/window_kms.c
+++ b/src/window_kms.c
@@ -27,8 +27,8 @@ void stl_global_close(void)
{
}
-static bool window_kms_create_window(struct stl_window *window, s32 width, s32 height,
- const char *monitor, const char *name, s32 flags)
+static bool window_kms_create_window(struct stl_window *window, u32 width, u32 height,
+ const char *monitor, const char *name, u32 flags)
{
struct stl_window_kms *kms = (struct stl_window_kms *)window;
(void)kms;
@@ -40,14 +40,14 @@ static bool window_kms_create_window(struct stl_window *window, s32 width, s32 h
return true;
}
-static void window_kms_resize_internal(struct stl_window *window, s32 width, s32 height)
+static void window_kms_resize_internal(struct stl_window *window, u32 width, u32 height)
{
(void)window;
(void)width;
(void)height;
}
-static void window_kms_resize(struct stl_window *window, s32 width, s32 height)
+static void window_kms_resize(struct stl_window *window, u32 width, u32 height)
{
(void)window;
(void)width;
@@ -125,7 +125,6 @@ struct stl_window *stl_window_create(void *context)
struct stl_window_kms *kms = al_alloc_object(struct stl_window_kms);
stl_window_common_init(&kms->w);
kms->w.fullscreen = true;
- kms->w.create_context = NULL;
kms->w.create_window = window_kms_create_window;
kms->w.resize_internal = window_kms_resize_internal;
kms->w.resize = window_kms_resize;
@@ -143,7 +142,7 @@ struct stl_window *stl_window_create(void *context)
kms->w.free = window_kms_free;
#if defined STELA_API_VULKAN
#elif defined STELA_API_OPENGL
- kms->w.get_gl_proc_address = kmsGetProcAddress;
+ kms->w.get_gl_proc_address = NULL;
kms->w.gl_loader_load = window_kms_gl_loader_load;
kms->w.gl_make_current = window_kms_gl_make_current;
kms->w.gl_release_current = window_kms_gl_release_current;
diff --git a/src/window_wayland.c b/src/window_wayland.c
index 40886c2..31d1e13 100644
--- a/src/window_wayland.c
+++ b/src/window_wayland.c
@@ -40,12 +40,13 @@ static void handle_output_mode(void *data, struct wl_output *output,
(void)output;
(void)flags;
(void)refresh;
+ al_assert(width > 0 && height > 0);
if (monitor->m.vertical) {
- monitor->m.width = height;
- monitor->m.height = width;
+ monitor->m.width = (u32)height;
+ monitor->m.height = (u32)width;
} else {
- monitor->m.width = width;
- monitor->m.height = height;
+ monitor->m.width = (u32)width;
+ monitor->m.height = (u32)height;
}
}
@@ -53,7 +54,7 @@ static void handle_output_done(void *data, struct wl_output *output)
{
struct stl_monitor_wayland *monitor = (struct stl_monitor_wayland *)data;
(void)output;
- al_log_info("window_wayland", "Output discovered: %s (%dx%d) (vertical: %s).",
+ al_log_info("window_wayland", "Output discovered: %s (%ux%u) (vertical: %s).",
monitor->m.name, monitor->m.width, monitor->m.height, BOOLSTR(monitor->m.vertical));
if (global.output_discovered) {
global.output_discovered(global.userdata, (struct stl_monitor *)monitor);
@@ -64,7 +65,8 @@ static void handle_output_scale(void *data, struct wl_output *output, s32 factor
{
struct stl_monitor_wayland *monitor = (struct stl_monitor_wayland *)data;
(void)output;
- monitor->m.scale = factor;
+ al_assert(factor > 0);
+ monitor->m.scale = (u32)factor;
}
static void handle_output_description(void *data, struct wl_output *output, const char *description)
@@ -577,15 +579,22 @@ static const struct wl_surface_listener surface_listener = {
.preferred_buffer_transform = preferred_buffer_transform
};
-static bool check_and_set_dimensions(struct stl_window_wayland *wl, s32 width, s32 height)
+static bool check_and_set_dimensions(struct stl_window_wayland *wl, s32 event_width, s32 event_height)
{
- width *= wl->w.scale;
- height *= wl->w.scale;
- if (!width || !height || (width == wl->w.width && height == wl->w.height)) {
+ if (event_width <= 0 || event_height <= 0) {
return false;
}
+
+ u32 scale = wl->w.scale;
+ u32 width = event_width * scale;
+ u32 height = event_height * scale;
+ if (width == wl->w.width && height == wl->w.height) {
+ return false;
+ }
+
wl->w.width = width;
wl->w.height = height;
+
return true;
}
@@ -714,17 +723,6 @@ static bool create_context_internal(struct stl_window_wayland *wl)
return true;
}
-static bool window_wayland_create_context(struct stl_window *window, s32 flags)
-{
- struct stl_window_wayland *wl = (struct stl_window_wayland *)window;
- (void)flags;
- if (!create_context_internal(wl)) {
- wl->w.free((struct stl_window **)&wl);
- return false;
- }
- return true;
-}
-
static struct stl_monitor_wayland *monitor_from_name(const char *name)
{
for (u32 i = 0; i < global.monitors.count; i++) {
@@ -759,6 +757,7 @@ static bool create_toplevel(struct stl_window_wayland *wl, s32 scale, const char
xdg_toplevel_set_title(wl->xdg_toplevel, name);
xdg_toplevel_set_app_id(wl->xdg_toplevel, name);
xdg_toplevel_set_min_size(wl->xdg_toplevel, STELA_MIN_WIDTH, STELA_MIN_HEIGHT);
+ //xdg_surface_set_window_geometry(wl->xdg_surface, 0, 0, wl->w.width, wl->w.height);
u32 decor = ZXDG_TOPLEVEL_DECORATION_V1_MODE_SERVER_SIDE;
wl->zxdg_toplevel_decoration = zxdg_decoration_manager_v1_get_toplevel_decoration(
@@ -789,8 +788,8 @@ static bool create_layer_shell(struct stl_window_wayland *wl, struct stl_monitor
return true;
}
-static bool window_wayland_create_window(struct stl_window *window, s32 width, s32 height,
- const char *monitor, const char *name, s32 flags)
+static bool window_wayland_create_window(struct stl_window *window, u32 width, u32 height,
+ const char *monitor, const char *name, u32 flags)
{
struct stl_window_wayland *wl = (struct stl_window_wayland *)window;
@@ -809,7 +808,7 @@ static bool window_wayland_create_window(struct stl_window *window, s32 width, s
wl_surface_add_listener(wl->surface, &surface_listener, wl);
if (!(flags & STELA_WINDOW_WALLPAPER)) {
- // TODO: Scale selection for toplevels.
+ // @TODO: Scale selection for toplevels.
selected = (struct stl_monitor_wayland *)al_array_at(global.monitors, 0);
if (!create_toplevel(wl, selected ? selected->m.scale : 1, name)) goto err;
} else {
@@ -826,7 +825,7 @@ static bool window_wayland_create_window(struct stl_window *window, s32 width, s
#ifdef STELA_API_OPENGL
stl_egl_make_current(&wl->egl);
- stl_egl_swap_interval(&wl->egl, (flags & STELA_WINDOW_VSYNC) ? 1 : 0);
+ stl_egl_swap_interval(&wl->egl, flags & STELA_WINDOW_VSYNC ? 1 : 0);
stl_egl_release_current(&wl->egl);
#endif
@@ -842,7 +841,7 @@ err:
return false;
}
-static void window_wayland_resize(struct stl_window *window, s32 width, s32 height)
+static void window_wayland_resize(struct stl_window *window, u32 width, u32 height)
{
struct stl_window_wayland *wl = (struct stl_window_wayland *)window;
(void)wl;
@@ -850,11 +849,11 @@ static void window_wayland_resize(struct stl_window *window, s32 width, s32 heig
(void)height;
}
-static void window_wayland_resize_internal(struct stl_window *window, s32 width, s32 height)
+static void window_wayland_resize_internal(struct stl_window *window, u32 width, u32 height)
{
struct stl_window_wayland *wl = (struct stl_window_wayland *)window;
#ifdef STELA_API_OPENGL
- //xdg_surface_set_window_geometry(wl->xdg_surface, 0, 0, wl->w.width, wl->w.height);
+ //xdg_surface_set_window_geometry(wl->xdg_surface, 0, 0, width, height);
if (stl_egl_is_ready(&wl->egl)) {
wl_egl_window_resize(wl->egl_window, width, height, 0, 0);
}
@@ -993,7 +992,6 @@ struct stl_window *stl_window_create(void *context)
struct stl_window_wayland *wl = al_alloc_object(struct stl_window_wayland);
stl_window_common_init(&wl->w);
wl->w.fullscreen = false;
- wl->w.create_context = window_wayland_create_context;
wl->w.create_window = window_wayland_create_window;
wl->w.resize = window_wayland_resize;
wl->w.resize_internal = window_wayland_resize_internal;
diff --git a/src/window_x11.c b/src/window_x11.c
index b02d639..c1425ee 100644
--- a/src/window_x11.c
+++ b/src/window_x11.c
@@ -60,8 +60,9 @@ bool stl_global_init(bool skip_graphics)
al_memcpy(monitor->name, name, length);
free(name);
monitor->scale = 1;
- monitor->width = info[i].width;
- monitor->height = info[i].height;
+ al_assert(info[i].width > 0 && info[i].height > 0);
+ monitor->width = (u32)info[i].width;
+ monitor->height = (u32)info[i].height;
al_array_push(global.monitors, monitor);
if (global.output_discovered) {
global.output_discovered(global.userdata, monitor);
@@ -112,8 +113,8 @@ static bool x11_egl_init(struct stl_window_x11 *xw)
}
#endif
-static bool window_x11_create_window(struct stl_window *window, s32 width, s32 height,
- const char *monitor, const char *name, s32 flags)
+static bool window_x11_create_window(struct stl_window *window, u32 width, u32 height,
+ const char *monitor, const char *name, u32 flags)
{
struct stl_window_x11 *xw = (struct stl_window_x11 *)window;
(void)monitor;
@@ -140,8 +141,9 @@ static bool window_x11_create_window(struct stl_window *window, s32 width, s32 h
XWindowAttributes gwa;
XGetWindowAttributes(global.x11_d, xw->window, &gwa);
- xw->w.width = gwa.width;
- xw->w.height = gwa.height;
+ al_assert(gwa.width > 0 && gwa.height > 0);
+ xw->w.width = (u32)gwa.width;
+ xw->w.height = (u32)gwa.height;
if (flags & STELA_WINDOW_WALLPAPER) {
Atom net_wm_type = XInternAtom(global.x11_d, "_NET_WM_WINDOW_TYPE", False);
@@ -185,14 +187,14 @@ static bool window_x11_create_window(struct stl_window *window, s32 width, s32 h
return true;
}
-static void window_x11_resize_internal(struct stl_window *window, s32 width, s32 height)
+static void window_x11_resize_internal(struct stl_window *window, u32 width, u32 height)
{
(void)window;
(void)width;
(void)height;
}
-static void window_x11_resize(struct stl_window *window, s32 width, s32 height)
+static void window_x11_resize(struct stl_window *window, u32 width, u32 height)
{
struct stl_window_x11 *xw = (struct stl_window_x11 *)window;
XMoveResizeWindow(global.x11_d, xw->window, 0, 0, width, height);
@@ -234,8 +236,9 @@ static void handle_next_xevent(struct stl_window_x11 *xw)
}
break;
case ConfigureNotify:
- xw->w.width = xev.xconfigure.width;
- xw->w.height = xev.xconfigure.height;
+ al_assert(xev.xconfigure.width > 0 && xev.xconfigure.height > 0);
+ xw->w.width = (u32)xev.xconfigure.width;
+ xw->w.height = (u32)xev.xconfigure.height;
stl_window_send_resize_event(&xw->w, xw->w.width, xw->w.height);
break;
case KeyPress:
@@ -291,7 +294,7 @@ static bool window_x11_should_refresh(struct stl_window *window)
static void window_x11_free(struct stl_window **window)
{
struct stl_window_x11 *xw = (struct stl_window_x11 *)*window;
- // TODO: Cleanup x11 stuff.
+ // @TODO: Cleanup x11 stuff.
#ifdef STELA_EVENT_BUFFER
al_free(xw->w.data);
#endif
@@ -352,7 +355,6 @@ struct stl_window *stl_window_create(void *context)
struct stl_window_x11 *xw = al_alloc_object(struct stl_window_x11);
stl_window_common_init(&xw->w);
xw->w.fullscreen = false;
- xw->w.create_context = NULL;
xw->w.create_window = window_x11_create_window;
xw->w.resize_internal = window_x11_resize_internal;
xw->w.resize = window_x11_resize;
diff --git a/subprojects/libalabaster.wrap b/subprojects/libalabaster.wrap
index cceb244..5977202 100644
--- a/subprojects/libalabaster.wrap
+++ b/subprojects/libalabaster.wrap
@@ -1,4 +1,4 @@
[wrap-git]
url = https://git.akon.city/libalabaster
-revision = 562c730ac38749fb43ae5b7b53ae5f3043166bd1
+revision = 5f80381cc8d2875d27d14288b6f11c31a72fb3cf
depth = 1
diff --git a/subprojects/libnaunet.wrap b/subprojects/libnaunet.wrap
index 7cce0e2..b87715d 100644
--- a/subprojects/libnaunet.wrap
+++ b/subprojects/libnaunet.wrap
@@ -1,4 +1,4 @@
[wrap-git]
url = https://git.akon.city/libnaunet
-revision = e48874a91a86ef561aa4b3298d6170ec9777954e
+revision = 0e4440d9235da485a75e52466bbffe9511ba6d97
depth = 1