From cb9816c78f25ecc8736cd97c11c839a4c18bcf76 Mon Sep 17 00:00:00 2001 From: Marvin Borner Date: Sun, 29 Nov 2020 18:43:31 +0100 Subject: Fixed some things I'm currently working on a huge commit, but it doesn't work.. WAIT AND SEE! --- apps/wm.c | 8 +++++++- kernel/features/net.c | 4 ---- libtxt/html.c | 2 ++ 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/apps/wm.c b/apps/wm.c index a6d2567..04947a4 100644 --- a/apps/wm.c +++ b/apps/wm.c @@ -54,6 +54,13 @@ static struct context *new_context(struct context *ctx, u32 pid, int x, int y, u static void remove_context(struct context *ctx) { assert(list_remove(contexts, list_first_data(contexts, ctx))); + + if (!(ctx->flags & WF_RELATIVE)) { + if (context_count % 2 == 1) + MOUSE_SKIP--; + context_count--; + } + free(ctx->fb); ctx->fb = NULL; free(ctx); @@ -198,7 +205,6 @@ static void handle_mouse(struct event_mouse *event) if (mouse_y - focused->y > 0) { focused->height = mouse_y - focused->y; } - /* redraw_all(); // TODO: Function to redraw one context */ } mouse_pressed[1] = 1; } else if (mod_pressed && mouse_pressed[1]) { diff --git a/kernel/features/net.c b/kernel/features/net.c index 80c1164..26bdc0f 100644 --- a/kernel/features/net.c +++ b/kernel/features/net.c @@ -536,8 +536,6 @@ static void tcp_handle_packet(struct tcp_packet *packet, u32 dst, int len) tcp_send_packet(socket, TCP_FLAG_ACK, NULL, 0); - proc_from_pid(socket->pid)->state = PROC_RUNNING; - socket->state = S_CLOSED; tcp->state = 0; return; @@ -571,8 +569,6 @@ static void udp_handle_packet(struct udp_packet *packet) sdata->data = NULL; } list_add(socket->packets, sdata); - proc_from_pid(socket->pid)->state = PROC_RUNNING; - /* printf("Waking up %d\n", socket->pid); */ } static void ip_handle_packet(struct ip_packet *packet, int len) diff --git a/libtxt/html.c b/libtxt/html.c index 794ef95..4e12555 100644 --- a/libtxt/html.c +++ b/libtxt/html.c @@ -199,6 +199,8 @@ static struct html_element *render_object(struct html_element *container, struct container->x_offset = 0; container->y_offset += 2; return container; + } else if (CMP(tag, "head") || CMP(tag, "meta") || CMP(tag, "title")) { + return container; } else { printf("UNKNOWN %s\n", tag); if (dom->content && strlen(dom->content) > 0) { -- cgit v1.2.3