Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 240f8313 authored by Siarhei Vishniakou's avatar Siarhei Vishniakou
Browse files

Add default values for InputTarget struct

The struct InputTarget has some default values for its fields, but not
for all fields. Now that we are adding a FocusEntry, we don't want to
deal with scale and such. To prevent undefined values in this struct,
add default initializers.

Bug: none
Test: none
Change-Id: I47660f81a642f55182dd90e91dc19e17f4e2f1dd
parent 2af911b8
Loading
Loading
Loading
Loading
+5 −4
Original line number Diff line number Diff line
@@ -93,21 +93,22 @@ struct InputTarget {
    sp<InputChannel> inputChannel;

    // Flags for the input target.
    int32_t flags;
    int32_t flags = 0;

    // The x and y offset to add to a MotionEvent as it is delivered.
    // (ignored for KeyEvents)
    float xOffset, yOffset;
    float xOffset = 0.0f;
    float yOffset = 0.0f;

    // Scaling factor to apply to MotionEvent as it is delivered.
    // (ignored for KeyEvents)
    float globalScaleFactor;
    float globalScaleFactor = 1.0f;
    float windowXScale = 1.0f;
    float windowYScale = 1.0f;

    // The subset of pointer ids to include in motion events dispatched to this input target
    // if FLAG_SPLIT is set.
    BitSet32 pointerIds;
    BitSet32 pointerIds{};
};

std::string dispatchModeToString(int32_t dispatchMode);