SurfaceFlinger Input: Shrink frame by surfaceInsets.
Probably best explained by the comment in InputWindow.h. We can't
use touchable region because we need to shift the coordinate space.
As a follow-up I'm going to look in to shifting the coordinate space
on the client but it was very non obvious where to do so.
Test: Manual
Bug: 80101428
Bug: 113136004
Bug: 111440400
Change-Id: Ibbaffa89a80f3a047c716265251f547631bdf802
diff --git a/include/input/InputWindow.h b/include/input/InputWindow.h
index 1a46825..df401f0 100644
--- a/include/input/InputWindow.h
+++ b/include/input/InputWindow.h
@@ -116,17 +116,36 @@
INPUT_FEATURE_NO_INPUT_CHANNEL = 0x00000002,
INPUT_FEATURE_DISABLE_USER_ACTIVITY = 0x00000004,
};
-
+
+ /* These values are filled in by the WM and passed through SurfaceFlinger
+ * unless specified otherwise.
+ */
sp<IBinder> token;
std::string name;
int32_t layoutParamsFlags;
int32_t layoutParamsType;
nsecs_t dispatchingTimeout;
+
+ /* These values are filled in by SurfaceFlinger. */
int32_t frameLeft;
int32_t frameTop;
int32_t frameRight;
int32_t frameBottom;
+
+ /*
+ * SurfaceFlinger consumes this value to shrink the computed frame. This is
+ * different from shrinking the touchable region in that it DOES shift the coordinate
+ * space where-as the touchable region does not and is more like "cropping". This
+ * is used for window shadows.
+ */
+ int32_t surfaceInset = 0;
+
float scaleFactor;
+
+ /*
+ * This is filled in by the WM relative to the frame and then translated
+ * to absolute coordinates by SurfaceFlinger once the frame is computed.
+ */
Region touchableRegion;
bool visible;
bool canReceiveKeys;