diff --git a/src/FSFileView.c b/src/FSFileView.c index 351c066..334e078 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 handleShelfButtonActions(WMWidget* self, void* data); static void handleShelfEventActions(XEvent* event, void* data); @@ -427,15 +429,16 @@ FSCreateFileView(FSViewer* fsViewer, char* path, Bool primary) memset((void*)&attributes, 0, sizeof(MyGNUstepWMAttributes)); attributes.window_style = (WMTitledWindowMask | WMMiniaturizableWindowMask | WMResizableWindowMask); - if (!(fView->primary)) { - attributes.window_style |= WMClosableWindowMask; - } + attributes.window_style |= WMClosableWindowMask; 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), // WMWidgetXID(fView->fileView)); diff --git a/src/FSViewer.c b/src/FSViewer.c index 9baebfa..41b871b 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; } }