Chromium Code Reviews| Index: remoting/host/curtain_mode_linux.cc |
| diff --git a/remoting/host/curtain_mode_linux.cc b/remoting/host/curtain_mode_linux.cc |
| index 05031bfec1b255b300d521dfde30b5686b785fa0..272fb4bcaba4274108f10892852040a3bd1e3c24 100644 |
| --- a/remoting/host/curtain_mode_linux.cc |
| +++ b/remoting/host/curtain_mode_linux.cc |
| @@ -61,6 +61,7 @@ bool CurtainModeLinux::IsXvfbSession() { |
| XDeviceInfo* devices; |
| bool found_xvfb_mouse = false; |
| bool found_xvfb_keyboard = false; |
| + bool found_crd_void_input = false; |
| bool found_other_devices = false; |
| devices = XListInputDevices(display, &num_devices); |
| for (int i = 0; i < num_devices; i++) { |
| @@ -68,6 +69,9 @@ bool CurtainModeLinux::IsXvfbSession() { |
| if (device_info->use == IsXExtensionPointer) { |
| if (strcmp(device_info->name, "Xvfb mouse") == 0) { |
| found_xvfb_mouse = true; |
| + } else if (strcmp(device_info->name, |
| + "Chrome Remote Desktop Input") == 0) { |
| + found_crd_void_input = true; |
| } else if (strcmp(device_info->name, "Virtual core XTEST pointer") != 0) { |
| found_other_devices = true; |
| HOST_LOG << "Non Xvfb mouse found: " << device_info->name; |
| @@ -97,7 +101,8 @@ bool CurtainModeLinux::IsXvfbSession() { |
| } |
| XFreeDeviceList(devices); |
| XCloseDisplay(display); |
| - return found_xvfb_mouse && found_xvfb_keyboard && !found_other_devices; |
| + return (found_xvfb_mouse && found_xvfb_keyboard) != found_crd_void_input |
|
Jamie
2016/05/07 00:05:47
Why are you using != here instead of ||? It makes
rkjnsn
2016/05/09 16:58:33
My initial thought was that it should be xor since
Jamie
2016/05/09 17:08:43
Xor is unusual enough that it's not immediately cl
|
| + && !found_other_devices; |
| } |
| // static |