more bugfixes

This commit is contained in:
IoIxD 2026-09-13 14:50:54 -07:00
commit afd10c7c69
3 changed files with 16 additions and 19 deletions

View file

@ -493,8 +493,6 @@ void MwLLWaylandClipboardRead(wl_clipboard_device_context_t* ctx, int clipboard_
/* Flush Wayland events */
void MwLLWaylandFlush(MwLL handle);
void MwLLWaylandCascadeChildren(MwLL handle);
/* Standard procedure before event callbacks in Wayland */
#define WAYLAND_EVENT_OP_START(self)

View file

@ -600,7 +600,6 @@ static void pointer_motion(void* data, struct wl_pointer* wl_pointer, MwU32 time
MwLLDispatch(currentlyHeldWidgets[i], move, &p);
}
MwLLWaylandCascadeChildren(self);
}
if(self->wayland.backbuffer.surface) {
wl_pointer_set_cursor(self->wayland.pointer, self->wayland.pointer_serial, self->wayland.cursor.surface, 0, 0);

View file

@ -923,7 +923,11 @@ static void draw_child(MwLL handle, MwLL child) {
cairo_t* selected_cairo;
MwLL topmost_parent = handle;
while(topmost_parent->wayland.parent) topmost_parent = topmost_parent->wayland.parent;
if(topmost_parent->wayland.type != MwLL_WAYLAND_POPUP) {
while(topmost_parent->wayland.parent) {
topmost_parent = topmost_parent->wayland.parent;
}
}
wl_surface_commit(child->wayland.framebuffer.surface);
@ -937,6 +941,8 @@ static void draw_child(MwLL handle, MwLL child) {
cairo_paint(c);
// printf("%d %d\n", child->wayland.x, child->wayland.y);
cairo_set_source_surface(handle->wayland.cairo.front_cairo_back, cs, child->wayland.x, child->wayland.y);
cairo_paint(handle->wayland.cairo.front_cairo_back);
@ -955,10 +961,6 @@ static void draw_children(MwLL handle) {
handle->wayland.events_pending = MwFALSE;
}
static void cascade_child(MwLL handle, MwLL child) {
child->wayland.do_cascading_draw = 10;
}
static void frontbuffer_draw(MwLL handle) {
cairo_t* c;
cairo_surface_t* cs;
@ -973,17 +975,13 @@ static void frontbuffer_draw(MwLL handle) {
cairo_paint(c);
cairo_set_source_surface(handle->wayland.cairo.front_cairo, cs, handle->wayland.x, handle->wayland.y);
cairo_set_source_surface(handle->wayland.cairo.front_cairo, cs, 0, 0);
cairo_paint(handle->wayland.cairo.front_cairo);
cairo_destroy(c);
cairo_surface_destroy(cs);
}
void MwLLWaylandCascadeChildren(MwLL handle) {
handle->wayland.do_cascading_draw = 1;
}
static MwLL MwLLCreateImpl(MwLL parent, int x, int y, int width, int height) {
MwLL r;
r = malloc(sizeof(*r));
@ -1072,7 +1070,6 @@ static void MwLLGetXYWHImpl(MwLL handle, int* x, int* y, unsigned int* w, unsign
}
static void MwLLSetXYImpl(MwLL handle, int x, int y) {
MwLLWaylandRegionInvalidate(handle);
if(handle->wayland.type != MwLL_WAYLAND_TOPLEVEL) {
@ -1085,8 +1082,13 @@ static void MwLLSetXYImpl(MwLL handle, int x, int y) {
/* toplevels cannot be moved */
break;
case MwLL_WAYLAND_SUBLEVEL:
{
/* sublevels are drawn according to their own x/y */
MwLL topmost_parent = handle;
while(topmost_parent->wayland.parent) topmost_parent = topmost_parent->wayland.parent;
MwLLForceRender(topmost_parent);
break;
}
case MwLL_WAYLAND_POPUP:
xdg_positioner_set_anchor_rect(handle->wayland.popup->xdg_positioner, handle->wayland.parent->wayland.x, handle->wayland.parent->wayland.y, handle->wayland.ww, handle->wayland.wh);
xdg_positioner_set_offset(handle->wayland.popup->xdg_positioner, x, y);
@ -1322,7 +1324,9 @@ static void MwLLEndDrawImpl(MwLL handle) {
}
MwLLWaylandBufferUpdate(handle, &handle->wayland.framebuffer);
MwLLWaylandCascadeChildren(handle);
if(handle->wayland.type != MwLL_WAYLAND_SUBLEVEL) {
handle->wayland.do_cascading_draw = 1;
}
}
}
@ -1556,7 +1560,6 @@ static void MwLLSetIconImpl(MwLL handle, MwLLPixmap pixmap) {
}
static void MwLLForceRenderImpl(MwLL handle) {
if(!handle->wayland.configured) {
return;
}
@ -1564,9 +1567,6 @@ static void MwLLForceRenderImpl(MwLL handle) {
wl_surface_damage(handle->wayland.framebuffer.surface, 0, 0, handle->wayland.ww, handle->wayland.wh);
handle->wayland.force_render = MwTRUE;
if(handle->wayland.parent) {
handle->wayland.parent->wayland.force_render = MwTRUE;
}
}
static void MwLLSetCursorImpl(MwLL handle, MwCursor* image, MwCursor* mask) {