マウスオーバー効果の完了

This commit is contained in:
2026-01-22 00:06:09 +09:00
parent dd3be3a555
commit e273c38ade
4 changed files with 21 additions and 2 deletions

12
main.c
View File

@@ -113,7 +113,10 @@ int main() {
case MotionNotify:
Time now = window.event.xmotion.time;
if (now - lasthovertime < 40) break;
lasthovertime = now;
if (now - lasthovertime > 80) {
reset_mouse_hover(&window, &lbl);
lasthovertime = now;
}
Window root, child;
int root_x, root_y,
win_x, win_y;
@@ -121,9 +124,14 @@ int main() {
XQueryPointer(window.display, window.xwindow, &root, &child,
&root_x, &root_y, &win_x, &win_y, &mask);
if (window.event.xmotion.state == 0) break;
if (window.event.xmotion.state == 0) {
break;
}
handle_mouse_hover(&window, &lbl, win_x, win_y);
break;
case LeaveNotify:
reset_mouse_hover(&window, &lbl);
break;
case ClientMessage:
// WM_DELETE_WINDOW
break;