Skip to content

Commit

Permalink
x11.h: fix querying monitors that are connected but turned off
Browse files Browse the repository at this point in the history
This also fixes the following issues under the same conditions:
- `get-cursor-monitor`: crashes
- `blank-screens`: enters an infinite loop and uses up all memory
  until OOM kicks in
  • Loading branch information
XPhyro committed Sep 16, 2024
1 parent f58f3a8 commit f367978
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/c/include/x11.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ char *get_cursor_monitor(Display *display)

for (i = 0; i < screen_resources->noutput; i++) {
output_info = XRRGetOutputInfo(display, screen_resources, screen_resources->outputs[i]);
if (!output_info || output_info->connection != RR_Connected) {
if (!output_info || output_info->connection != RR_Connected || output_info->crtc == None) {
if (output_info)
XRRFreeOutputInfo(output_info);
continue;
Expand Down

0 comments on commit f367978

Please sign in to comment.