summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--README.md1
-rw-r--r--README.txt3
-rwxr-xr-xscripts/line_count.sh2
-rw-r--r--src/common.h3
-rw-r--r--src/gl_common.h2
-rw-r--r--src/window.c7
-rw-r--r--src/window.h2
-rw-r--r--src/window_glfm.c5
-rw-r--r--src/window_glfw.c9
-rw-r--r--src/window_wayland.c75
-rw-r--r--src/window_wayland.h5
-rw-r--r--src/window_win32.c57
-rw-r--r--src/window_win32.h3
-rw-r--r--src/window_x11.c3
-rw-r--r--subprojects/libalabaster.wrap2
-rw-r--r--subprojects/libnaunet.wrap2
-rw-r--r--tests/window.c6
17 files changed, 126 insertions, 61 deletions
diff --git a/README.md b/README.md
deleted file mode 100644
index 6f8a209..0000000
--- a/README.md
+++ /dev/null
@@ -1 +0,0 @@
-## stela
diff --git a/README.txt b/README.txt
new file mode 100644
index 0000000..011b386
--- /dev/null
+++ b/README.txt
@@ -0,0 +1,3 @@
+== stela
+
+// vim: set syntax=asciidoc:
diff --git a/scripts/line_count.sh b/scripts/line_count.sh
index a6ac787..6af0fe0 100755
--- a/scripts/line_count.sh
+++ b/scripts/line_count.sh
@@ -1,3 +1,3 @@
#! /usr/bin/env sh
export LC_ALL="C"
-find ./src ./include -type f -exec sloccount {} +
+find ./src ./include -type f -exec loccount {} +
diff --git a/src/common.h b/src/common.h
index c3f35d1..37033ad 100644
--- a/src/common.h
+++ b/src/common.h
@@ -12,3 +12,6 @@ static inline bool stl_should_refresh_common(struct stl_window *window)
return false;
}
#endif
+
+void stl_window_init(struct stl_window *window);
+void stl_window_created(struct stl_window *window, u32 width, u32 height, u32 flags);
diff --git a/src/gl_common.h b/src/gl_common.h
index cd34d4c..ae49215 100644
--- a/src/gl_common.h
+++ b/src/gl_common.h
@@ -17,9 +17,9 @@
#ifdef STELA_USE_GLES
#include <GLES2/gl2.h>
#else
+#define GL_GLEXT_PROTOTYPES
#include <GL/gl.h>
#ifndef NAUNET_ON_WINDOWS
-#define GL_GLEXT_PROTOTYPES
#include <GL/glext.h>
#include <GL/glcorearb.h>
#endif
diff --git a/src/window.c b/src/window.c
index 6b8f4ec..6f57c80 100644
--- a/src/window.c
+++ b/src/window.c
@@ -14,6 +14,13 @@ void stl_window_init(struct stl_window *window)
#endif
}
+void stl_window_created(struct stl_window *window, u32 width, u32 height, u32 flags)
+{
+ window->width = width;
+ window->height = height;
+ window->flags = flags;
+}
+
#ifdef STELA_EVENT_BUFFER
#define GET_EVENT_CHUNK(op) \
size_t size; \
diff --git a/src/window.h b/src/window.h
index b3faf17..d22b13d 100644
--- a/src/window.h
+++ b/src/window.h
@@ -75,6 +75,7 @@ struct stl_window {
void (*resize_internal)(struct stl_window *, u32, u32);
void (*resize)(struct stl_window *, u32, u32);
void (*toggle_fullscreen)(struct stl_window *);
+ void (*set_decorations)(struct stl_window *, bool);
#ifdef STELA_POLL_INLINE
bool (*poll)(struct stl_window *, bool);
#ifdef STELA_PAUSE
@@ -156,7 +157,6 @@ s32 stl_swallow_main(u32 argc, str *argv, s32 (*main)(u32, str *, void *), void
void stl_global_close(void);
struct stl_window *stl_window_create(void);
-void stl_window_init(struct stl_window *window);
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);
diff --git a/src/window_glfm.c b/src/window_glfm.c
index ad9203e..b230f48 100644
--- a/src/window_glfm.c
+++ b/src/window_glfm.c
@@ -3,6 +3,7 @@
#include <nnwt/common.h>
#include "window_glfm.h"
+#include "common.h"
static struct stl_glfm_global global = { 0 };
@@ -85,13 +86,11 @@ static bool window_glfm_create_window(struct stl_window *window, u32 width, u32
(void)height;
(void)monitor;
(void)name;
- (void)flags;
glfmSetUserData(global.display, glfm);
s32 display_width, display_height;
glfmGetDisplaySize(global.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;
+ stl_window_created(&glfm->w, (u32)display_width, (u32)display_height, flags);
#ifdef STELA_USE_EGL
glfm->w.egl_display = (EGLDisplay)glfmGetEglDisplay(global.display);
glfm->w.egl_context = (EGLContext)glfmGetEglContext(global.display);
diff --git a/src/window_glfw.c b/src/window_glfw.c
index ad685bf..5892bfb 100644
--- a/src/window_glfw.c
+++ b/src/window_glfw.c
@@ -180,6 +180,8 @@ static bool window_glfw_create_window(struct stl_window *window, u32 width, u32
struct stl_window_glfw *glfw = (struct stl_window_glfw *)window;
(void)monitor;
+ al_assert(width >= STELA_MIN_WIDTH && height >= STELA_MIN_HEIGHT);
+
#if GLFW_VERSION_MAJOR > 3 || (GLFW_VERSION_MAJOR == 3 && GLFW_VERSION_MINOR >= 4)
glfwWindowHintString(GLFW_WAYLAND_APP_ID, name);
#endif
@@ -194,7 +196,11 @@ static bool window_glfw_create_window(struct stl_window *window, u32 width, u32
#elif defined STELA_API_DX11
glfwWindowHint(GLFW_CLIENT_API, GLFW_NO_API);
#elif defined STELA_API_OPENGL
+#ifdef STELA_USE_EGL
+ glfwWindowHint(GLFW_CONTEXT_CREATION_API, GLFW_EGL_CONTEXT_API);
+#else
glfwWindowHint(GLFW_CONTEXT_CREATION_API, GLFW_NATIVE_CONTEXT_API);
+#endif
for (u32 i = 0; i < ARRAY_SIZE(stl_gl_vers); i++) {
glfwWindowHint(GLFW_CLIENT_API, stl_gl_vers[i].api);
glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, stl_gl_vers[i].major);
@@ -246,8 +252,7 @@ static bool window_glfw_create_window(struct stl_window *window, u32 width, u32
//glfwGetFramebufferSize(glfw->window, &buffer_width, &buffer_height);
glfwGetWindowSize(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;
+ stl_window_created(&glfw->w, (u32)buffer_width, (u32)buffer_height, flags);
glfwSetWindowSizeLimits(glfw->window, STELA_MIN_WIDTH, STELA_MIN_HEIGHT, GLFW_DONT_CARE, GLFW_DONT_CARE);
glfw->scale_x = 1.f;
diff --git a/src/window_wayland.c b/src/window_wayland.c
index 59efb10..1ed597d 100644
--- a/src/window_wayland.c
+++ b/src/window_wayland.c
@@ -734,7 +734,7 @@ static bool check_and_set_dimensions(struct stl_window_wayland *wl, s32 event_wi
return true;
}
-static void send_resize(struct stl_window_wayland *wl)
+static void send_resize_event(struct stl_window_wayland *wl)
{
stl_window_send_resize_event(&wl->w, wl->w.width, wl->w.height);
}
@@ -743,7 +743,7 @@ static void handle_xdg_surface_configure(void *data, struct xdg_surface *surface
{
struct stl_window_wayland *wl = (struct stl_window_wayland *)data;
if (wl->pending) {
- send_resize(wl);
+ send_resize_event(wl);
wl->pending = false;
}
xdg_surface_ack_configure(surface, serial);
@@ -759,6 +759,9 @@ static void handle_xdg_toplevel_configure(void *data, struct xdg_toplevel *tople
struct stl_window_wayland *wl = (struct stl_window_wayland *)data;
(void)toplevel;
(void)states;
+ // It is expected that the first toplevel_configure() will give 0x0 dimensions.
+ // We set the window dimensions with wl_egl_window_create() and the subsequent
+ // toplevel_configure() event will come after the first swap_buffers().
if (check_and_set_dimensions(wl, width, height)) {
wl->pending = true;
}
@@ -799,7 +802,7 @@ static void handle_layer_surface_configure(void *data, struct zwlr_layer_surface
{
struct stl_window_wayland *wl = (struct stl_window_wayland *)data;
if (check_and_set_dimensions(wl, width, height)) {
- send_resize(wl);
+ send_resize_event(wl);
}
zwlr_layer_surface_v1_ack_configure(surface, serial);
}
@@ -874,7 +877,7 @@ static bool create_toplevel(struct stl_window_wayland *wl, s32 scale, const char
{
wl->w.scale = scale;
wl_surface_set_buffer_scale(wl->surface, scale);
- u32 geom_width = wl->w.width, geom_height = wl->w.height;
+ //s32 geom_width = wl->w.width, geom_height = wl->w.height;
wl->w.width *= scale;
wl->w.height *= scale;
wl->pending = true;
@@ -894,13 +897,17 @@ 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, geom_width, geom_height);
+ // If xdg_surface_set_window_geometry() is never set, it will be equal to the
+ // entire surface and update on every commit. If we do set it, we need to manually
+ // update it on any resize. Also, it's meant to be set to the unscaled width and height.
+ //xdg_surface_set_window_geometry(wl->xdg_surface, 0, 0, geom_width, geom_height);
if (wl->zxdg_decoration_manager) {
- u32 decor = ZXDG_TOPLEVEL_DECORATION_V1_MODE_SERVER_SIDE;
wl->zxdg_toplevel_decoration = zxdg_decoration_manager_v1_get_toplevel_decoration(
wl->zxdg_decoration_manager, wl->xdg_toplevel);
- zxdg_toplevel_decoration_v1_set_mode(wl->zxdg_toplevel_decoration, decor);
+ u32 mode = ZXDG_TOPLEVEL_DECORATION_V1_MODE_SERVER_SIDE;
+ zxdg_toplevel_decoration_v1_set_mode(wl->zxdg_toplevel_decoration, mode);
+ wl->decorated = true;
}
return true;
@@ -908,8 +915,9 @@ static bool create_toplevel(struct stl_window_wayland *wl, s32 scale, const char
static bool create_layer_shell(struct stl_window_wayland *wl, struct stl_monitor_wayland *monitor, const char *name)
{
- wl->w.scale = monitor->m.scale;
- wl_surface_set_buffer_scale(wl->surface, monitor->m.scale);
+ u32 scale = monitor->m.scale;
+ wl->w.scale = scale;
+ wl_surface_set_buffer_scale(wl->surface, scale);
u32 surface = ZWLR_LAYER_SHELL_V1_LAYER_BOTTOM;
u32 anchor = ZWLR_LAYER_SURFACE_V1_ANCHOR_TOP
| ZWLR_LAYER_SURFACE_V1_ANCHOR_BOTTOM
@@ -924,6 +932,7 @@ static bool create_layer_shell(struct stl_window_wayland *wl, struct stl_monitor
zwlr_layer_surface_v1_set_size(wl->layer_surface, wl->w.width, wl->w.height);
zwlr_layer_surface_v1_set_anchor(wl->layer_surface, anchor);
zwlr_layer_surface_v1_add_listener(wl->layer_surface, &layer_surface_listener, wl);
+ wl->decorated = false;
return true;
}
@@ -932,27 +941,32 @@ static bool window_wayland_create_window(struct stl_window *window, u32 width, u
{
struct stl_window_wayland *wl = (struct stl_window_wayland *)window;
+ al_assert(width >= STELA_MIN_WIDTH && height >= STELA_MIN_HEIGHT);
+
if (!create_context_internal(wl)) {
goto err;
}
- al_assert(width >= STELA_MIN_WIDTH && height >= STELA_MIN_HEIGHT);
-
- struct stl_monitor_wayland *selected = NULL;
- wl->w.width = width;
- wl->w.height = height;
-
wl->surface = wl_compositor_create_surface(wl->compositor);
if (!wl->surface) goto err;
wl_surface_add_listener(wl->surface, &surface_listener, wl);
+ stl_window_created(&wl->w, width, height, flags);
+
+ // @TODO: Test multi-monitor with 1 scaled.
+ struct stl_monitor_wayland *selected = NULL;
if (!(flags & STELA_WINDOW_WALLPAPER)) {
- // @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;
+ if (!create_toplevel(wl, selected ? selected->m.scale : 1, name)) {
+ log_error("Failed to create toplevel surface.");
+ goto err;
+ }
} else {
selected = monitor_from_name(monitor);
- if (!selected || !create_layer_shell(wl, selected, name)) goto err;
+ if (!selected || !create_layer_shell(wl, selected, name)) {
+ log_error("Failed to create layer shell surface.");
+ goto err;
+ }
}
#ifdef STELA_API_OPENGL
@@ -992,10 +1006,11 @@ static void window_wayland_resize_internal(struct stl_window *window, u32 width,
{
struct stl_window_wayland *wl = (struct stl_window_wayland *)window;
#ifdef STELA_API_OPENGL
- u32 scale = wl->w.scale;
- if (wl->xdg_surface) {
- xdg_surface_set_window_geometry(wl->xdg_surface, 0, 0, width / scale, height / scale);
- }
+ //if (wl->xdg_surface) {
+ // u32 scale = wl->w.scale;
+ // s32 geom_width = wl->w.width / scale, geom_height = wl->w.height / scale;
+ // xdg_surface_set_window_geometry(wl->xdg_surface, 0, 0, geom_width, geom_height);
+ //}
if (stl_egl_is_ready(&wl->egl)) {
wl_egl_window_resize(wl->egl_window, width, height, 0, 0);
}
@@ -1017,6 +1032,21 @@ static void window_wayland_toggle_fullscreen(struct stl_window *window)
wl->w.fullscreen = !wl->w.fullscreen;
}
+static void window_wayland_set_decorations(struct stl_window *window, bool enabled)
+{
+ struct stl_window_wayland *wl = (struct stl_window_wayland *)window;
+ if (!wl->zxdg_toplevel_decoration) return;
+ if (!enabled && wl->decorated) {
+ u32 mode = ZXDG_TOPLEVEL_DECORATION_V1_MODE_CLIENT_SIDE;
+ zxdg_toplevel_decoration_v1_set_mode(wl->zxdg_toplevel_decoration, mode);
+ wl->decorated = false;
+ } else if (!wl->decorated) {
+ u32 mode = ZXDG_TOPLEVEL_DECORATION_V1_MODE_SERVER_SIDE;
+ zxdg_toplevel_decoration_v1_set_mode(wl->zxdg_toplevel_decoration, mode);
+ wl->decorated = true;
+ }
+}
+
#ifdef STELA_POLL_INLINE
static bool window_wayland_poll(struct stl_window *window, bool block)
{
@@ -1133,6 +1163,7 @@ struct stl_window *stl_window_create(void)
wl->w.resize = window_wayland_resize;
wl->w.resize_internal = window_wayland_resize_internal;
wl->w.toggle_fullscreen = window_wayland_toggle_fullscreen;
+ wl->w.set_decorations = window_wayland_set_decorations;
#ifdef STELA_POLL_INLINE
wl->w.poll = window_wayland_poll;
#ifdef STELA_PAUSE
diff --git a/src/window_wayland.h b/src/window_wayland.h
index 1700082..e3b2c32 100644
--- a/src/window_wayland.h
+++ b/src/window_wayland.h
@@ -48,7 +48,6 @@ struct stl_window_wayland {
struct wl_compositor *compositor;
struct wl_surface *surface;
struct xdg_wm_base *xdg_wm_base;
- bool pending;
struct xdg_surface *xdg_surface;
struct xdg_toplevel *xdg_toplevel;
struct zxdg_decoration_manager_v1 *zxdg_decoration_manager;
@@ -58,13 +57,15 @@ struct stl_window_wayland {
struct zwlr_layer_shell_v1 *layer_shell;
struct stl_monitor_wayland *monitor;
struct zwlr_layer_surface_v1 *layer_surface;
- struct stl_egl egl;
struct wl_egl_window *egl_window;
+ struct stl_egl egl;
#if defined STELA_POLL_INLINE && defined STELA_PAUSE
struct nn_pollfd fds[2];
#else
struct nn_pollfd fds[1];
#endif
+ bool decorated;
+ bool pending;
f64 pointer_x;
f64 pointer_y;
f64 last_pointer_x;
diff --git a/src/window_win32.c b/src/window_win32.c
index 1182a27..7edee49 100644
--- a/src/window_win32.c
+++ b/src/window_win32.c
@@ -674,8 +674,8 @@ static LRESULT CALLBACK DisplayWndProc(HWND Window, UINT Message, WPARAM WParam,
if (Message == WM_RBUTTONDOWN) {
ClientToScreen(w32->Window, &Pos);
}
- w32->LastPos.x = Pos.x;
- w32->LastPos.y = Pos.y;
+ w32->LastMousePos.x = Pos.x;
+ w32->LastMousePos.y = Pos.y;
w32->WindowMoving = TRUE;
SetCapture(w32->Window);
return Result;
@@ -713,11 +713,11 @@ static LRESULT CALLBACK DisplayWndProc(HWND Window, UINT Message, WPARAM WParam,
RECT Window;
GetWindowRect(w32->Window, &Window);
SetWindowPos(w32->Window, NULL,
- Window.left + (Current.x - w32->LastPos.x),
- Window.top + (Current.y - w32->LastPos.y),
+ Window.left + (Current.x - w32->LastMousePos.x),
+ Window.top + (Current.y - w32->LastMousePos.y),
0, 0, SWP_NOACTIVATE | SWP_NOSIZE | SWP_NOZORDER);
- w32->LastPos.x = Current.x;
- w32->LastPos.y = Current.y;
+ w32->LastMousePos.x = Current.x;
+ w32->LastMousePos.y = Current.y;
return Result;
}
goto intercept;
@@ -853,11 +853,6 @@ static bool window_win32_create_window(struct stl_window *window, u32 width, u32
struct stl_window_win32 *w32 = (struct stl_window_win32 *)window;
(void)monitor;
- // @TODO: Make a function for this redundant stuff (include fullscreen).
- w32->w.width = width;
- w32->w.height = height;
- w32->w.flags = flags;
-
WNDCLASSEXW WindowClass = { 0 };
WindowClass.cbSize = sizeof(WindowClass);
WindowClass.lpfnWndProc = &DisplayWndProc;
@@ -892,6 +887,13 @@ static bool window_win32_create_window(struct stl_window *window, u32 width, u32
return false;
}
+ stl_window_created(&w32->w, width, height, flags);
+
+ w32->Decorated = TRUE;
+ w32->Prev.Style = GetWindowLong(w32->Window, GWL_STYLE);
+ w32->WindowMoving = FALSE;
+ w32->MouseButtonMask = 0;
+
#if defined STELA_API_OPENGL
return CreateWGLContext(w32);
#elif defined STELA_API_VULKAN
@@ -927,6 +929,22 @@ static struct stl_monitor_win32 *get_monitor_from_handle(HMONITOR Handle)
return NULL;
}
+static void set_window_decorations(struct stl_window_win32 *w32, bool enabled)
+{
+ if (!enabled && w32->Decorated) {
+ // https://stackoverflow.com/a/2400467
+ LONG Style = GetWindowLong(w32->Window, GWL_STYLE);
+ w32->Prev.Style = Style;
+ Style &= ~(WS_CAPTION | WS_THICKFRAME | WS_MINIMIZEBOX | WS_MAXIMIZEBOX | WS_SYSMENU);
+ SetWindowLong(w32->Window, GWL_STYLE, Style);
+ w32->Decorated = FALSE;
+ } else if (!w32->Decorated) {
+ al_assert(w32->Prev.Style != 0);
+ SetWindowLong(w32->Window, GWL_STYLE, w32->Prev.Style);
+ w32->Decorated = TRUE;
+ }
+}
+
static void window_win32_toggle_fullscreen(struct stl_window *window)
{
struct stl_window_win32 *w32 = (struct stl_window_win32 *)window;
@@ -941,24 +959,28 @@ static void window_win32_toggle_fullscreen(struct stl_window *window)
w32->Prev.Y = Prev.top;
w32->Prev.Width = Prev.right - Prev.left;
w32->Prev.Height = Prev.bottom - Prev.top;
- LONG Style = GetWindowLong(w32->Window, GWL_STYLE);
- w32->Prev.Style = Style;
- // https://stackoverflow.com/a/2400467
- Style &= ~(WS_CAPTION | WS_THICKFRAME | WS_MINIMIZEBOX | WS_MAXIMIZEBOX | WS_SYSMENU);
- SetWindowLong(w32->Window, GWL_STYLE, Style);
+ set_window_decorations(w32, false);
while (ShowCursor(FALSE) >= 0) {}
SetWindowPos(w32->Window, HWND_TOPMOST, Monitor->X, Monitor->Y, (s32)Monitor->M.width, (s32)Monitor->M.height, SWP_FRAMECHANGED);
} else {
- SetWindowLong(w32->Window, GWL_STYLE, w32->Prev.Style);
struct stl_monitor_win32 *Monitor = w32->Prev.Monitor;
s32 X = w32->Prev.X - Monitor->X;
s32 Y = w32->Prev.Y - Monitor->Y;
+ set_window_decorations(w32, true);
ShowCursor(TRUE);
SetWindowPos(w32->Window, HWND_NOTOPMOST, X, Y, w32->Prev.Width, w32->Prev.Height, SWP_FRAMECHANGED);
}
w32->w.fullscreen = !w32->w.fullscreen;
}
+static void window_win32_set_decorations(struct stl_window *window, bool enabled)
+{
+ struct stl_window_win32 *w32 = (struct stl_window_win32 *)window;
+ set_window_decorations(w32, enabled);
+ UINT Flags = SWP_FRAMECHANGED | SWP_NOMOVE | SWP_NOSIZE | SWP_NOZORDER | SWP_NOSENDCHANGING | SWP_NOACTIVATE;
+ SetWindowPos(w32->Window, 0, 0, 0, 0, 0, Flags);
+}
+
static void win32_handle_message(struct stl_window_win32 *w32, MSG *Message)
{
switch (Message->message) {
@@ -1188,6 +1210,7 @@ struct stl_window *stl_window_create(void)
w32->w.resize_internal = window_win32_resize_internal;
w32->w.resize = window_win32_resize;
w32->w.toggle_fullscreen = window_win32_toggle_fullscreen;
+ w32->w.set_decorations = window_win32_set_decorations;
#ifdef STELA_POLL_INLINE
w32->w.poll = window_win32_poll;
#ifdef STELA_PAUSE
diff --git a/src/window_win32.h b/src/window_win32.h
index d29a468..35b0dc5 100644
--- a/src/window_win32.h
+++ b/src/window_win32.h
@@ -45,8 +45,9 @@ struct stl_window_win32 {
s32 Height;
LONG Style;
} Prev;
+ BOOL Decorated;
BOOL WindowMoving;
- POINTS LastPos;
+ POINTS LastMousePos;
u32 MouseButtonMask;
#ifdef STELA_API_OPENGL
HDC DeviceContext;
diff --git a/src/window_x11.c b/src/window_x11.c
index 25c6cf2..0d8d870 100644
--- a/src/window_x11.c
+++ b/src/window_x11.c
@@ -152,8 +152,7 @@ static bool window_x11_create_window(struct stl_window *window, u32 width, u32 h
XWindowAttributes gwa;
XGetWindowAttributes(global.x11_d, xw->window, &gwa);
al_assert(gwa.width > 0 && gwa.height > 0);
- xw->w.width = (u32)gwa.width;
- xw->w.height = (u32)gwa.height;
+ stl_window_created(&xw->w, (u32)gwa.width, (u32)gwa.height, flags);
if (flags & STELA_WINDOW_WALLPAPER) {
Atom net_wm_type = XInternAtom(global.x11_d, "_NET_WM_WINDOW_TYPE", False);
diff --git a/subprojects/libalabaster.wrap b/subprojects/libalabaster.wrap
index 2a0e3f4..243dff8 100644
--- a/subprojects/libalabaster.wrap
+++ b/subprojects/libalabaster.wrap
@@ -1,4 +1,4 @@
[wrap-git]
url = https://git.akon.city/libalabaster
-revision = 92d5840e1440fe45a150079fab5a39877589c20f
+revision = ec99011aca3a9b92964c653d74d693e693ac052f
depth = 1
diff --git a/subprojects/libnaunet.wrap b/subprojects/libnaunet.wrap
index f068c57..3f43502 100644
--- a/subprojects/libnaunet.wrap
+++ b/subprojects/libnaunet.wrap
@@ -1,4 +1,4 @@
[wrap-git]
url = https://git.akon.city/libnaunet
-revision = 9fb3646511998310fc8c967c239803f38b2bdc5b
+revision = 6993b9814769668fb03b4d282734f20f63b16f9c
depth = 1
diff --git a/tests/window.c b/tests/window.c
index b185e6b..d334d36 100644
--- a/tests/window.c
+++ b/tests/window.c
@@ -1,9 +1,3 @@
-#ifdef STELA_API_NULL
-#undef STELA_API_NULL
-#endif
-#ifndef STELA_API_OPENGL
-#define STELA_API_OPENGL
-#endif
#define AL_LOG_SECTION "test_window"
#include <al/log.h>
#include <al/types.h>