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

Commit e2eff118 authored by Siarhei Vishniakou's avatar Siarhei Vishniakou
Browse files

Add inputConfig to winscope protos

This is needed to further understand the dispatching decisions.

In one of the bugs, the dispatcher sent an event to two windows and
ended up with two foreground windows at the same time. That shouldn't
occur.

This logging in needed to figure out how the dispatcher got there.

Bug: 287860440
Test: none
Change-Id: I1021ab19ee450361974a61d39c45fd5f134b100b
parent 9437fe1a
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -178,6 +178,7 @@ void LayerProtoHelper::writeToProto(

    InputWindowInfoProto* proto = getInputWindowInfoProto();
    proto->set_layout_params_flags(inputInfo.layoutParamsFlags.get());
    proto->set_input_config(inputInfo.inputConfig.get());
    using U = std::underlying_type_t<WindowInfo::Type>;
    // TODO(b/129481165): This static assert can be safely removed once conversion warnings
    // are re-enabled.
+3 −4
Original line number Diff line number Diff line
@@ -195,6 +195,7 @@ proto::LayerState TransactionProtoParser::toProto(
            windowInfoProto->set_layout_params_flags(inputInfo->layoutParamsFlags.get());
            windowInfoProto->set_layout_params_type(
                    static_cast<int32_t>(inputInfo->layoutParamsType));
            windowInfoProto->set_input_config(inputInfo->inputConfig.get());
            LayerProtoHelper::writeToProto(inputInfo->touchableRegion,
                                           windowInfoProto->mutable_touchable_region());
            windowInfoProto->set_surface_inset(inputInfo->surfaceInset);
@@ -467,11 +468,9 @@ void TransactionProtoParser::fromProto(const proto::LayerState& proto,
                static_cast<gui::WindowInfo::Type>(windowInfoProto.layout_params_type());
        LayerProtoHelper::readFromProto(windowInfoProto.touchable_region(),
                                        inputInfo.touchableRegion);
        inputInfo.inputConfig =
                ftl::Flags<gui::WindowInfo::InputConfig>(windowInfoProto.input_config());
        inputInfo.surfaceInset = windowInfoProto.surface_inset();
        inputInfo.setInputConfig(gui::WindowInfo::InputConfig::NOT_FOCUSABLE,
                                 !windowInfoProto.focusable());
        inputInfo.setInputConfig(gui::WindowInfo::InputConfig::DUPLICATE_TOUCH_TO_WALLPAPER,
                                 windowInfoProto.has_wallpaper());
        inputInfo.globalScaleFactor = windowInfoProto.global_scale_factor();
        const proto::Transform& transformProto = windowInfoProto.transform();
        inputInfo.transform.set(transformProto.dsdx(), transformProto.dtdx(), transformProto.dtdy(),
+1 −0
Original line number Diff line number Diff line
@@ -70,6 +70,7 @@ message InputWindowInfoProto {
    bool replace_touchable_region_with_crop = 14;
    RectProto touchable_region_crop = 15;
    TransformProto transform = 16;
    uint32 input_config = 17;
}

message BlurRegion {
+3 −2
Original line number Diff line number Diff line
@@ -256,13 +256,14 @@ message LayerState {
        int32 layout_params_type = 2;
        RegionProto touchable_region = 3;
        int32 surface_inset = 4;
        bool focusable = 5;
        bool has_wallpaper = 6;
        bool focusable = 5; // unused
        bool has_wallpaper = 6; // unused
        float global_scale_factor = 7;
        uint32 crop_layer_id = 8;
        bool replace_touchable_region_with_crop = 9;
        RectProto touchable_region_crop = 10;
        Transform transform = 11;
        uint32 input_config = 12;
    }
    WindowInfo window_info_handle = 27;
    float bg_color_alpha = 28;