nikp123 / xava

X11 Audio Visualizer for ALSA
http://nikp123.github.io/xava
Other
134 stars 15 forks source link

[fix] output/x11: fix incorrect screen change query condition #21

Closed iamsubhranil closed 4 years ago

iamsubhranil commented 4 years ago

This fixes #20 , but I don't have multiple monitors, so let me know if it works for the original usecase.

make-42 commented 4 years ago

Can't really test the original use-case since my events act weird. But it does inhibit the issue even when reload_on_display_configure is true.

make-42 commented 4 years ago

Changing line 494 to

if((xavaRREventBase + RRScreenChangeNotify) && p.reloadOnDC) {
    printf("Display change detected - Restarting...\n");
    return 1;
}

fixes that.

make-42 commented 4 years ago

I think this is the correct solution while @nikp123 looks at why the events still get through while the config value is false.

nikp123 commented 4 years ago

Thanks for contributing, however, it's supposed to be a plus. I've used xev source code as a base. The mistake was that I was supposed to write: if(xavaRREventBase + RRScreenChangeNotify == xavaXEvent.type)

My bad. And it somehow worked, despite being completely wrong.

Changing line 494 to

if((xavaRREventBase + RRScreenChangeNotify) && p.reloadOnDC) {
  printf("Display change detected - Restarting...\n");
  return 1;
}

fixes that.

It doesn't matter if you check the flag, since the flag disables the code that enables the RRScreenChangeNotify event.