aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorRichard M. Stallman1994-09-17 02:16:33 +0000
committerRichard M. Stallman1994-09-17 02:16:33 +0000
commit59aa6c905ee8dd147cbef608320a0ecc10be104c (patch)
treee65400729251cd50d757bb490dba54a664ebcf64 /src
parent64cfec5c1ce7fc11719d908c5bb67dc50c194799 (diff)
downloademacs-59aa6c905ee8dd147cbef608320a0ecc10be104c.tar.gz
emacs-59aa6c905ee8dd147cbef608320a0ecc10be104c.zip
(hack_wm_protocols): Arrange to handle WM_SAVE_YOURSELF.
Diffstat (limited to 'src')
-rw-r--r--src/xfns.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/src/xfns.c b/src/xfns.c
index 8cb1f9d107c..19ca98b3175 100644
--- a/src/xfns.c
+++ b/src/xfns.c
@@ -1743,9 +1743,9 @@ XSetWMProtocols (dpy, w, protocols, count)
1743 1743
1744#ifdef USE_X_TOOLKIT 1744#ifdef USE_X_TOOLKIT
1745 1745
1746/* If the WM_PROTOCOLS property does not already contain WM_TAKE_FOCUS 1746/* WM_DELETE_WINDOW, and WM_SAVE_YOURSELF, then add them. (They may
1747 and WM_DELETE_WINDOW, then add them. (They may already be present 1747 already be present because of the toolkit (Motif adds some of them,
1748 because of the toolkit (Motif adds them, for example, but Xt doesn't). */ 1748 for example, but Xt doesn't). */
1749 1749
1750static void 1750static void
1751hack_wm_protocols (widget) 1751hack_wm_protocols (widget)
@@ -1755,6 +1755,7 @@ hack_wm_protocols (widget)
1755 Window w = XtWindow (widget); 1755 Window w = XtWindow (widget);
1756 int need_delete = 1; 1756 int need_delete = 1;
1757 int need_focus = 1; 1757 int need_focus = 1;
1758 int need_save = 1;
1758 1759
1759 BLOCK_INPUT; 1760 BLOCK_INPUT;
1760 { 1761 {
@@ -1771,16 +1772,18 @@ hack_wm_protocols (widget)
1771 while (nitems > 0) 1772 while (nitems > 0)
1772 { 1773 {
1773 nitems--; 1774 nitems--;
1774 if (atoms [nitems] == Xatom_wm_delete_window) need_delete = 0; 1775 if (atoms[nitems] == Xatom_wm_delete_window) need_delete = 0;
1775 else if (atoms [nitems] == Xatom_wm_take_focus) need_focus = 0; 1776 else if (atoms[nitems] == Xatom_wm_take_focus) need_focus = 0;
1777 else if (atoms[nitems] == Xatom_wm_save_yourself) need_save = 0;
1776 } 1778 }
1777 if (atoms) XFree ((char *) atoms); 1779 if (atoms) XFree ((char *) atoms);
1778 } 1780 }
1779 { 1781 {
1780 Atom props [10]; 1782 Atom props [10];
1781 int count = 0; 1783 int count = 0;
1782 if (need_delete) props [count++] = Xatom_wm_delete_window; 1784 if (need_delete) props[count++] = Xatom_wm_delete_window;
1783 if (need_focus) props [count++] = Xatom_wm_take_focus; 1785 if (need_focus) props[count++] = Xatom_wm_take_focus;
1786 if (need_save) props[count++] = Xatom_wm_save_yourself;
1784 if (count) 1787 if (count)
1785 XChangeProperty (dpy, w, Xatom_wm_protocols, XA_ATOM, 32, PropModeAppend, 1788 XChangeProperty (dpy, w, Xatom_wm_protocols, XA_ATOM, 32, PropModeAppend,
1786 (unsigned char *) props, count); 1789 (unsigned char *) props, count);