diff options
author | Sebastian Keller <skeller@src.gnome.org> | 2019-12-23 17:53:53 +0100 |
---|---|---|
committer | Sebastian Keller <skeller@src.gnome.org> | 2019-12-23 17:53:53 +0100 |
commit | 674f52ba747b59a7e72a4a18fea763ee9e617b7c (patch) | |
tree | c444ccc6365df02197963d0634364d86650ab647 | |
parent | 498264959a0ce0f036ce70b6cdc0db7d255ae32d (diff) | |
download | mutter-674f52ba747b59a7e72a4a18fea763ee9e617b7c.tar.gz |
clutter/stage: Fix picking of rectangles with negative positions
FLT_MIN is the smallest *positive* number above 0 that can be
represented as floating point number. If this is used to initialize the
maximum x/y coordinates of a rectangle, this will always be used if all
x/y coordinates of the rectangle are negative. This means that picking
at 0,0 will always be a hit for such rectangles.
Since mutter creates such a window for server side decorations on X11,
this window will always be picked at 0,0 preventing clicking/hovering
the activities button in gnome-shell at that coordinate.
Fixes https://gitlab.gnome.org/GNOME/mutter/issues/893
-rw-r--r-- | clutter/clutter/clutter-stage.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/clutter/clutter/clutter-stage.c b/clutter/clutter/clutter-stage.c index dbd64645a..bead95c4a 100644 --- a/clutter/clutter/clutter-stage.c +++ b/clutter/clutter/clutter-stage.c @@ -443,9 +443,9 @@ is_inside_axis_aligned_rectangle (const graphene_point_t *point, const graphene_point_t *vertices) { float min_x = FLT_MAX; - float max_x = FLT_MIN; + float max_x = -FLT_MAX; float min_y = FLT_MAX; - float max_y = FLT_MIN; + float max_y = -FLT_MAX; int i; for (i = 0; i < 3; i++) |