fix(randr): Check if there is a primary monitor (#1621)
* fix(randr): Check if there is a primary monitor primary_info.name() throws an error if get_output_info is called with XCB_NONE Fixes #1620
This commit is contained in:
parent
1145681cf5
commit
a7ad68da31
@ -102,9 +102,13 @@ namespace randr_util {
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
auto primary_output = conn.get_output_primary(root).output();
|
auto primary_output = conn.get_output_primary(root).output();
|
||||||
auto primary_info = conn.get_output_info(primary_output);
|
string primary_name{};
|
||||||
auto name_iter = primary_info.name();
|
|
||||||
string primary_name = {name_iter.begin(), name_iter.end()};
|
if (primary_output != XCB_NONE) {
|
||||||
|
auto primary_info = conn.get_output_info(primary_output);
|
||||||
|
auto name_iter = primary_info.name();
|
||||||
|
primary_name = {name_iter.begin(), name_iter.end()};
|
||||||
|
}
|
||||||
|
|
||||||
for (auto&& output : conn.get_screen_resources(root).outputs()) {
|
for (auto&& output : conn.get_screen_resources(root).outputs()) {
|
||||||
try {
|
try {
|
||||||
|
Loading…
Reference in New Issue
Block a user