Hello,

Attached patch adds WM_DELETE_WINDOW support to the 'FvwmForm' module.
Note, that if 'GrabServer' command is set,  for obvious reasons it is
impossible to close window by clicking close button on window's title.

Bye

-- 
Serge Koksharov, Free Software user & supporter
GPG public key ID: 0x3D330896 (pgp.mit.edu)
Key fingerprint: 5BC4 0475 CB03 6A31 0076  82C2 C240 72F0 3D33 0896
diff -Naur fvwmCVS-orig/modules/ChangeLog fvwmCVS-fixed/modules/ChangeLog
--- fvwmCVS-orig/modules/ChangeLog      2006-08-01 12:38:42.000000000 +0400
+++ fvwmCVS-fixed/modules/ChangeLog     2006-08-03 13:42:57.000000000 +0400
@@ -1,3 +1,10 @@
+2006-08-03  Serge Koksharov  <gentoosiast dog yandex dot ru>
+
+       * FvwmForm/FvwmForm.c (OpenWindows):
+       * FvwmForm/FvwmForm.h:
+       * FvwmForm/ReadXServer.c (ReadXServer):
+       added WM_DELETE_WINDOW support.
+
 2006-07-16  Scott Smedley  <[EMAIL PROTECTED]>
 
        * FvwmTabs/FvwmTabs.in:
diff -Naur fvwmCVS-orig/modules/FvwmForm/FvwmForm.c 
fvwmCVS-fixed/modules/FvwmForm/FvwmForm.c
--- fvwmCVS-orig/modules/FvwmForm/FvwmForm.c    2006-08-01 12:38:41.000000000 
+0400
+++ fvwmCVS-fixed/modules/FvwmForm/FvwmForm.c   2006-08-03 13:36:04.000000000 
+0400
@@ -66,6 +66,7 @@
 Item *cur_sel, *cur_button;             /* current during parse */
 Item *timer = NULL;                     /* timeout tracking */
 Display *dpy;
+Atom wm_del_win;
 int fd_x;                  /* fd for X connection */
 Window root, ref;
 int screen;
@@ -2178,6 +2179,8 @@
   CF.frame = XCreateWindow(dpy, root, x, y, CF.max_width, CF.total_height, 0,
                           Pdepth, InputOutput, Pvisual,
                           CWColormap | CWBackPixel | CWBorderPixel, &xswa);
+  wm_del_win = XInternAtom(dpy, "WM_DELETE_WINDOW", False);
+  XSetWMProtocols(dpy, CF.frame, &wm_del_win, 1);
   XSelectInput(dpy, CF.frame,
               KeyPressMask | ExposureMask | StructureNotifyMask |
               VisibilityChangeMask);
diff -Naur fvwmCVS-orig/modules/FvwmForm/FvwmForm.h 
fvwmCVS-fixed/modules/FvwmForm/FvwmForm.h
--- fvwmCVS-orig/modules/FvwmForm/FvwmForm.h    2006-08-01 12:38:41.000000000 
+0400
+++ fvwmCVS-fixed/modules/FvwmForm/FvwmForm.h   2006-08-03 13:36:38.000000000 
+0400
@@ -210,6 +210,7 @@
 extern Item *item;                             /* current during parse */
 extern Item *cur_sel, *cur_button;             /* current during parse */
 extern Display *dpy;
+extern Atom wm_del_win;
 extern int fd_x;                  /* fd for X connection */
 extern Window root, ref;
 extern int screen;
diff -Naur fvwmCVS-orig/modules/FvwmForm/ReadXServer.c 
fvwmCVS-fixed/modules/FvwmForm/ReadXServer.c
--- fvwmCVS-orig/modules/FvwmForm/ReadXServer.c 2006-08-01 12:38:41.000000000 
+0400
+++ fvwmCVS-fixed/modules/FvwmForm/ReadXServer.c        2006-08-03 
13:36:14.000000000 +0400
@@ -79,6 +79,15 @@
     FNextEvent(dpy, &event);
     if (event.xany.window == CF.frame) {
       switch (event.type) {
+      case ClientMessage:
+      {
+             if(event.xclient.format == 32 &&
+                event.xclient.data.l[0] == wm_del_win)
+             {
+                     exit(0);
+             }
+      }
+      break;
       case ConfigureNotify:             /* has window be reconfigured */
       {
              XEvent tmpe;

Attachment: pgpyuNHbKeda4.pgp
Description: PGP signature

Reply via email to