diff options
author | 2023-05-17 17:31:33 +0200 | |
---|---|---|
committer | 2023-05-17 17:31:33 +0200 | |
commit | 6a992be61bdce9f4bca95822543257321f6815e3 (patch) | |
tree | 95dfe73898d5a8ed565da2530e7bad52e656af03 /src/application.c | |
parent | 34220e6e6aaf6cb819f9d9c9e5e5cd84ba515a37 (diff) | |
download | cherry-6a992be61bdce9f4bca95822543257321f6815e3.tar.gz cherry-6a992be61bdce9f4bca95822543257321f6815e3.zip |
Add events to exit from application and to close
the window
Diffstat (limited to 'src/application.c')
-rw-r--r-- | src/application.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/application.c b/src/application.c index 91b1719..24ac7ba 100644 --- a/src/application.c +++ b/src/application.c @@ -61,7 +61,10 @@ cherry_application_main_loop(CherryApplication *app) case ClientMessage: atom_name = XGetAtomName(app->display, (Atom) event.xclient.data.l[0]); - if (strcmp("WM_DELETE_WINDOW", atom_name) == 0) { + if (strcmp("CHERRY_DISPOSE_ON_EXIT", atom_name) == 0) { + /* Exit from loop */ + finish = 1; + } else if (strcmp("WM_DELETE_WINDOW", atom_name) == 0) { dispatch_event(app, event.xclient.window, DELETE_WINDOW); } |