Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

X11: Fix unused variables warning when touch is disabled #83265

Merged
merged 1 commit into from
Oct 13, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions platform/linuxbsd/x11/display_server_x11.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4085,9 +4085,6 @@ void DisplayServerX11::process_events() {
if (XGetEventData(x11_display, &event.xcookie)) {
if (event.xcookie.type == GenericEvent && event.xcookie.extension == xi.opcode) {
XIDeviceEvent *event_data = (XIDeviceEvent *)event.xcookie.data;
int index = event_data->detail;
Vector2 pos = Vector2(event_data->event_x, event_data->event_y);

switch (event_data->evtype) {
case XI_HierarchyChanged:
case XI_DeviceChanged: {
Expand Down Expand Up @@ -4204,6 +4201,9 @@ void DisplayServerX11::process_events() {
}
bool is_begin = event_data->evtype == XI_TouchBegin;

int index = event_data->detail;
Vector2 pos = Vector2(event_data->event_x, event_data->event_y);

Ref<InputEventScreenTouch> st;
st.instantiate();
st->set_window_id(window_id);
Expand Down Expand Up @@ -4235,6 +4235,10 @@ void DisplayServerX11::process_events() {
if (ime_window_event || ignore_events) {
break;
}

int index = event_data->detail;
Vector2 pos = Vector2(event_data->event_x, event_data->event_y);

HashMap<int, Vector2>::Iterator curr_pos_elem = xi.state.find(index);
if (!curr_pos_elem) { // Defensive
break;
Expand Down
Loading