added ability to close window by right clicking

This commit is contained in:
Rachel Lambda Samuelsson 2021-02-04 21:14:22 +01:00
parent 33d532d670
commit 6ed073347e
2 changed files with 16 additions and 11 deletions

View File

@ -38,7 +38,7 @@ These options can also be configured in the enviorment variables `MPDART_DIR`, `
To make these changes persistent, export them in your `~/.profile`. To make these changes persistent, export them in your `~/.profile`.
Once mpdart is running you can press the window to toggle mpd's pause/play. Once mpdart is running you can left click the window to toggle mpd's pause/play or right click it to close it.
Contributing Contributing
------------ ------------

View File

@ -450,8 +450,8 @@ int main(int argc, char** argv) {
/* toggle pause on press */ /* toggle pause on press */
case ButtonPress: case ButtonPress:
if (ev.xbutton.button == Button1) { switch (ev.xbutton.button) {
case Button1:
DEBUG("Toggling pause\n"); DEBUG("Toggling pause\n");
mpd_run_noidle(connection); mpd_run_noidle(connection);
@ -463,6 +463,11 @@ int main(int argc, char** argv) {
mpd_send_idle_mask(connection, MPD_IDLE_PLAYER); mpd_send_idle_mask(connection, MPD_IDLE_PLAYER);
mpd_check_error(); mpd_check_error();
break;
case Button3:
DEBUG("Exiting due to MB2 pree");
exit(0);
break;
} }
break; break;