From 8939afab2674e4a4ccfc7be3000318e7ecf19d75 Mon Sep 17 00:00:00 2001 From: DreamMaoMao <2523610504@qq.com> Date: Mon, 17 Feb 2025 07:43:18 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=90=AF=E5=8A=A8=E5=B4=A9?= =?UTF-8?q?=E6=BA=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- maomao.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/maomao.c b/maomao.c index 3cd7a0d2..9be94157 100644 --- a/maomao.c +++ b/maomao.c @@ -1058,6 +1058,12 @@ handlesig(int signo) { void toggle_hotarea(int x_root, int y_root) { // 左下角热区坐标计算,兼容多显示屏 Arg arg = {0}; + + // 在刚启动的时候,selmon为NULL,但鼠标可能已经处于热区, + // 必须判断避免奔溃 + if (!selmon) + return; + unsigned hx = selmon->m.x + hotarea_size; unsigned hy = selmon->m.y + selmon->m.height - hotarea_size;