From eb87d690beae3d4e128e86ffc00f65de1c02fe45 Mon Sep 17 00:00:00 2001 From: Adrien Destugues Date: Sat, 1 May 2021 14:37:14 +0200 Subject: [PATCH] Input preferences: use correct API for watch_input_devices() We now use the same API as BeOS for input devices notification. Change-Id: I873c7556c039d0628af306bb7d157cc06a5cd652 Reviewed-on: https://review.haiku-os.org/c/haiku/+/3873 Reviewed-by: Adrien Destugues --- src/preferences/input/InputWindow.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/preferences/input/InputWindow.cpp b/src/preferences/input/InputWindow.cpp index ace3406723..8689288ac1 100644 --- a/src/preferences/input/InputWindow.cpp +++ b/src/preferences/input/InputWindow.cpp @@ -104,16 +104,16 @@ InputWindow::MessageReceived(BMessage* message) break; } - case IS_NOTIFY_DEVICE: + case B_INPUT_DEVICES_CHANGED: { - bool added = message->FindBool("added"); - BString name = message->FindString("name"); + int32 operation = message->FindInt32("be:opcode"); + BString name = message->FindString("be:device_name"); - if (added) { + if (operation == B_INPUT_DEVICE_ADDED) { BInputDevice* device = find_input_device(name); if (device) AddDevice(device); - } else { + } else if (operation == B_INPUT_DEVICE_REMOVED) { for (int i = 0; i < fDeviceListView->CountItems(); i++) { DeviceListItemView* item = dynamic_cast(