Skip to content

Commit fc54a64

Browse files
committed
fix(gui): mouse events should be ignored when pointer-events is none
1 parent 9991545 commit fc54a64

3 files changed

Lines changed: 205 additions & 98 deletions

File tree

include/LCUI/types.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,7 @@ typedef struct LCUI_Rect2F_ {
131131
typedef enum LCUI_StyleValue {
132132
SV_NONE,
133133
SV_AUTO,
134+
SV_INHERIT,
134135
SV_CONTAIN,
135136
SV_COVER,
136137
SV_LEFT,

src/gui/widget_base.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ static void Widget_Init(LCUI_Widget widget)
116116
widget->computed_style.focusable = FALSE;
117117
widget->computed_style.display = SV_BLOCK;
118118
widget->computed_style.position = SV_STATIC;
119-
widget->computed_style.pointer_events = SV_AUTO;
119+
widget->computed_style.pointer_events = SV_INHERIT;
120120
widget->computed_style.box_sizing = SV_CONTENT_BOX;
121121
widget->computed_style.margin.top.type = LCUI_STYPE_PX;
122122
widget->computed_style.margin.right.type = LCUI_STYPE_PX;
@@ -1136,7 +1136,7 @@ void Widget_UpdateSizeWithSurface(LCUI_Widget w)
11361136
void Widget_UpdateProps(LCUI_Widget w)
11371137
{
11381138
LCUI_Style s;
1139-
int prop = ComputeStyleOption(w, key_pointer_events, SV_AUTO);
1139+
int prop = ComputeStyleOption(w, key_pointer_events, SV_INHERIT);
11401140
w->computed_style.pointer_events = prop;
11411141
s = &w->style->sheet[key_focusable];
11421142
if (s->is_valid && s->type == LCUI_STYPE_BOOL && s->value == 0) {

0 commit comments

Comments
 (0)