diff --git a/src/FSFileView.c b/src/FSFileView.c index 51533d5..175c0ce 100644 --- a/src/FSFileView.c +++ b/src/FSFileView.c @@ -41,6 +41,8 @@ #define DEFAULT_COLUMN_WIDTH 150 #define COLUMN_PADDING 4 // only used for increment calc here, needs to go +Atom delete_atom; + static void notificationObserver(void* self, WMNotification* notif); static void FSAddFileViewShelfItem(FSFileView* fView, FileInfo* fileInfo); static void handleShelfButtonActions(WMWidget* self, void* data); @@ -437,12 +439,14 @@ FSCreateFileView(FSViewer* fsViewer, char* path, Bool primary) if ((fView->primary)) { memset((void*)&attributes, 0, sizeof(MyGNUstepWMAttributes)); - attributes.window_style = (WMTitledWindowMask | WMMiniaturizableWindowMask | WMResizableWindowMask); + attributes.window_style = (WMTitledWindowMask | WMClosableWindowMask | WMMiniaturizableWindowMask | WMResizableWindowMask); attributes.window_level = WMNormalWindowLevel; attributes.extra_flags = GSFullKeyboardEventsFlag; attributes.flags = (GSWindowStyleAttr | GSWindowLevelAttr | GSExtraFlagsAttr); MyWMSetWindowAttributes(fView->dpy, WMWidgetXID(fView->fileView), &attributes); + delete_atom = XInternAtom(fView->dpy, "WM_DELETE_WINDOW", 0); + XSetWMProtocols(fView->dpy, WMWidgetXID(fView->fileView), &delete_atom, 1); } // WMAppAddWindow(FSGetFSViewerWMContext(fsViewer), diff --git a/src/FSViewer.c b/src/FSViewer.c index 9baebfa..d365a83 100644 --- a/src/FSViewer.c +++ b/src/FSViewer.c @@ -23,6 +23,8 @@ #define DEBUG 0 +extern Atom delete_atom; + /* Application defaults */ WMUserDefaults* defaultsDB; WMPropList* filesDB; @@ -502,7 +504,8 @@ int main(int argc, char** argv) focusIn = False; break; case ClientMessage: - // printf("arrgggg!\n"); + if(event.xclient.data.l[0] == delete_atom) + exit(0); break; } }