improve callback
All checks were successful
pyrite-dev/milsko/pipeline/head This commit looks good

This commit is contained in:
Nishi 2026-09-21 11:47:44 +09:00
commit 39dd112f2b
5 changed files with 33 additions and 22 deletions

View file

@ -22,11 +22,12 @@ static void MWAPI resize_window(MwWidget handle, void* user, void* call) {
}
static void MWAPI layout_document(MwWidget handle, void* user, void* call) {
int height = *(int*)call;
MwRect size = *(MwRect*)call;
MwViewportSetSize(viewport, MwGetInteger(document, MwNwidth), height);
MwViewportSetSize(viewport, size.width, size.height);
MwVaApply(document,
MwNheight, height,
MwNwidth, size.width,
MwNheight, size.height,
NULL);
}

View file

@ -105,15 +105,13 @@
<integer name="waitLayout" />
<integer name="scale" />
<integer name="columns" />
<integer name="commonSpan" common="yes" />
<integer name="rowSpan" common="yes" />
<integer name="acceptsDnD" common="yes" />
<integer name="columnSpan" column="yes" />
<integer name="rowSpan" column="yes" />
<integer name="acceptsDnD" column="yes" />
<integer name="hour" />
<integer name="minute" />
<integer name="second" />
<integer name="type" />
<integer name="strikethrough" common="yes" />
<integer name="underline" common="yes" />
<!-- waitMS is a special property, only applies to toplevel widget -->
<integer name="waitMS" common="yes" />
@ -206,7 +204,7 @@
<string />
</handler>
<handler name="layout">
<integer pointer="yes" />
<struct defname="MwRect" pointer="yes" />
</handler>
</handlers>
<enumerations>
@ -1072,10 +1070,20 @@
<return>
<pointer />
</return>
<arguments>
<integer enumname="MwVulkanField" name="field" />
<integer pointer="yes" name="output" />
</arguments>
</function>
</functions>
</widget>
<widget name="Direct3D9">
<functions>
<function name="GetDirect3D9">
<return>
<pointer />
</return>
</function>
<function name="GetDirect3DDevice9">
<return>
<pointer />
</return>
</function>
</functions>
</widget>

View file

@ -66,7 +66,7 @@ if (grep(/^wayland$/, @backends)) {
scan_wayland_protocol("unstable", "primary-selection", "-unstable-v1");
scan_wayland_protocol("unstable", "pointer-constraints", "-unstable-v1");
scan_wayland_protocol("unstable", "relative-pointer", "-unstable-v1");
scan_wayland_protocol("staging", "fifo", "-v1");
scan_wayland_protocol("staging", "fifo", "-v1");
scan_wayland_protocol_from_file("wlr-layer-shell",
"wlr-layer-shell-unstable-v1.xml");

View file

@ -219,8 +219,8 @@ static void MwLLFreeColorImpl(MwLLColor color) {}
static MwBool lmao = MwFALSE;
static int MwLLPendingImpl(MwLL handle) {
lmao = !lmao;
return lmao;
lmao = !lmao;
return lmao;
}
static void MwLLNextEventImpl(MwLL handle) {
MwLLDispatch(handle, draw, NULL);
@ -264,10 +264,10 @@ static void MwLLRaiseImpl(MwLL handle) {}
static void MwLLClipImpl(MwLL handle, MwRect* rect) {}
static void MwLLSetupDragAndDropImpl(MwLL handle) {}
static int MwLLCairoCallInitImpl(void) {
if(cairo_load_funcs() != 0) {
return 1;
}
return 0;
if(cairo_load_funcs() != 0) {
return 1;
}
return 0;
}
#include "call.c"
CALL(Cairo);

View file

@ -498,6 +498,7 @@ static void layout(MwWidget handle) {
MwFLFont* fontstack = NULL;
MwRect clickable;
char* c_title = NULL;
MwRect size;
arrput(fontstack, NULL);
@ -612,8 +613,9 @@ static void layout(MwWidget handle) {
l->font = TOPFONT;
}
y += MwTextHeight(handle, TOPFONT, "M");
MwDispatchUserHandler(handle, MwNlayoutHandler, &y);
size.width = w;
size.height = y + MwTextHeight(handle, TOPFONT, "M");
MwDispatchUserHandler(handle, MwNlayoutHandler, &size);
arrfree(fontstack);