for (iter = sys_monitors.begin(); iter != sys_monitors.end(); ++iter) {
MONITORINFOEX info;
DISPLAY_DEVICE dev;
+ std::string name;
info.cbSize = sizeof(info);
GetMonitorInfo(*iter, (LPMONITORINFO)&info);
if ((info.rcMonitor.bottom - info.rcMonitor.top) != h)
continue;
- dev.cb = sizeof(dev);
- EnumDisplayDevices(info.szDevice, 0, &dev, 0);
+ for (int i = 0; ; i++) {
+ dev.cb = sizeof(dev);
+ if (!EnumDisplayDevices(info.szDevice, i, &dev, 0))
+ break;
+
+ if (!(dev.StateFlags & DISPLAY_DEVICE_ATTACHED_TO_DESKTOP))
+ continue;
- return dev.DeviceString;
+ if (!name.empty())
+ name += " / ";
+ name += dev.DeviceString;
+ }
+
+ return name;
}
return "";
#if defined (HAVE_XRANDR)
int x, y, w, h;
int ev, err, xi_major;
+ std::string name;
fl_open_display();
assert(fl_display != NULL);
continue;
}
+ if ((crtc->x != x) || (crtc->y != y) ||
+ ((int)crtc->width != w) || ((int)crtc->height != h))
+ continue;
+
for (int j = 0; j < crtc->noutput; j++) {
- bool monitor_found = (crtc->x == x) &&
- (crtc->y == y) &&
- (crtc->width == ((unsigned int) w)) &&
- (crtc->height == ((unsigned int) h));
-
- if (monitor_found) {
- XRROutputInfo *output = XRRGetOutputInfo(fl_display, res, crtc->outputs[j]);
- if (!output) {
- vlog.error(_("Failed to get information about output %d for CRTC %d"), j, i);
- continue;
- }
+ XRROutputInfo *output;
- return output->name;
+ output = XRRGetOutputInfo(fl_display, res, crtc->outputs[j]);
+ if (!output) {
+ vlog.error(_("Failed to get information about output %d for CRTC %d"), j, i);
+ continue;
}
+
+ if (!name.empty())
+ name += " / ";
+ name += output->name;
}
}
- return "";
+ return name;
#endif // !HAVE_XRANDR
return "";