Commit 88973397 authored by Uri Lublin's avatar Uri Lublin Committed by Frediano Ziglio

unittests: add a simple program to list xrandr outputs

Signed-off-by: Uri Lublin's avatarUri Lublin <uril@redhat.com>
Acked-by: Snir Sheriber's avatarSnir Sheriber <ssheribe@redhat.com>
parent fa383523
Pipeline #127579 passed with stage
in 2 minutes and 8 seconds
......@@ -27,6 +27,17 @@ tests = [
'spice-catch.hpp',
],
'dependencies' : spice_common_deps,
},
{
'name' : 'xrandrlist',
'is_test' : false,
'sources' : [
'xrandrlist.cpp',
'../display-info.cpp',
'../utils.cpp',
'../x11-display-info.cpp',
],
'dependencies' : agent_deps,
}
]
......
#include <stdio.h>
#include <spice-streaming-agent/x11-display-info.hpp>
int main()
{
Display *display = XOpenDisplay(nullptr);
if (!display) {
printf("Could not open display\n");
return 1;
}
Window window = RootWindow(display, XDefaultScreen(display));
std::vector<std::string> outputs =
spice::streaming_agent::get_xrandr_outputs(display, window);
for (auto o : outputs) {
printf("%s\n", o.c_str());
}
XCloseDisplay(display);
return 0;
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment