diff options
| author | Noah Friedman | 2019-08-07 18:18:32 -0700 |
|---|---|---|
| committer | Noah Friedman | 2019-08-08 21:47:46 -0700 |
| commit | 8f93dce7c0bf0d1bb0b27a6f2416fd2d404cb6a9 (patch) | |
| tree | 5ba1803f83ea1d54da96488125ee0ca522f47c4e | |
| parent | 0428d0e96be41686858b030eeb4ff27f52822566 (diff) | |
| download | emacs-8f93dce7c0bf0d1bb0b27a6f2416fd2d404cb6a9.tar.gz emacs-8f93dce7c0bf0d1bb0b27a6f2416fd2d404cb6a9.zip | |
(Fx_change_window_property): Add optional arg SOURCE.
This provides symmetry with Fx_window_property, so that the window
need not be an actual emacs frame. This is useful for modifying
properties of parent windows (specified with --parent-id to emacs) or
generally assisting the window manager.
| -rw-r--r-- | src/xfns.c | 22 |
1 files changed, 17 insertions, 5 deletions
diff --git a/src/xfns.c b/src/xfns.c index b8a1914186c..5f5194d78f4 100644 --- a/src/xfns.c +++ b/src/xfns.c | |||
| @@ -5720,7 +5720,7 @@ x_sync (struct frame *f) | |||
| 5720 | ***********************************************************************/ | 5720 | ***********************************************************************/ |
| 5721 | 5721 | ||
| 5722 | DEFUN ("x-change-window-property", Fx_change_window_property, | 5722 | DEFUN ("x-change-window-property", Fx_change_window_property, |
| 5723 | Sx_change_window_property, 2, 6, 0, | 5723 | Sx_change_window_property, 2, 7, 0, |
| 5724 | doc: /* Change window property PROP to VALUE on the X window of FRAME. | 5724 | doc: /* Change window property PROP to VALUE on the X window of FRAME. |
| 5725 | PROP must be a string. VALUE may be a string or a list of conses, | 5725 | PROP must be a string. VALUE may be a string or a list of conses, |
| 5726 | numbers and/or strings. If an element in the list is a string, it is | 5726 | numbers and/or strings. If an element in the list is a string, it is |
| @@ -5735,9 +5735,12 @@ FORMAT gives the size in bits of each element if VALUE is a list. | |||
| 5735 | It must be one of 8, 16 or 32. | 5735 | It must be one of 8, 16 or 32. |
| 5736 | If VALUE is a string or FORMAT is nil or not given, FORMAT defaults to 8. | 5736 | If VALUE is a string or FORMAT is nil or not given, FORMAT defaults to 8. |
| 5737 | If OUTER-P is non-nil, the property is changed for the outer X window of | 5737 | If OUTER-P is non-nil, the property is changed for the outer X window of |
| 5738 | FRAME. Default is to change on the edit X window. */) | 5738 | FRAME. Default is to change on the edit X window. |
| 5739 | If SOURCE is non-nil, set the property on that window instead of from | ||
| 5740 | FRAME. The number 0 denotes the root window. */) | ||
| 5739 | (Lisp_Object prop, Lisp_Object value, Lisp_Object frame, | 5741 | (Lisp_Object prop, Lisp_Object value, Lisp_Object frame, |
| 5740 | Lisp_Object type, Lisp_Object format, Lisp_Object outer_p) | 5742 | Lisp_Object type, Lisp_Object format, Lisp_Object outer_p, |
| 5743 | Lisp_Object source) | ||
| 5741 | { | 5744 | { |
| 5742 | struct frame *f = decode_window_system_frame (frame); | 5745 | struct frame *f = decode_window_system_frame (frame); |
| 5743 | Atom prop_atom; | 5746 | Atom prop_atom; |
| @@ -5801,8 +5804,17 @@ FRAME. Default is to change on the edit X window. */) | |||
| 5801 | target_type = XInternAtom (FRAME_X_DISPLAY (f), SSDATA (type), False); | 5804 | target_type = XInternAtom (FRAME_X_DISPLAY (f), SSDATA (type), False); |
| 5802 | } | 5805 | } |
| 5803 | 5806 | ||
| 5804 | if (! NILP (outer_p)) w = FRAME_OUTER_WINDOW (f); | 5807 | if (! NILP (source)) |
| 5805 | else w = FRAME_X_WINDOW (f); | 5808 | { |
| 5809 | CONS_TO_INTEGER (source, Window, w); | ||
| 5810 | if (! w) | ||
| 5811 | w = FRAME_DISPLAY_INFO (f)->root_window; | ||
| 5812 | } | ||
| 5813 | else | ||
| 5814 | { | ||
| 5815 | if (! NILP (outer_p)) w = FRAME_OUTER_WINDOW (f); | ||
| 5816 | else w = FRAME_X_WINDOW (f); | ||
| 5817 | } | ||
| 5806 | 5818 | ||
| 5807 | XChangeProperty (FRAME_X_DISPLAY (f), w, | 5819 | XChangeProperty (FRAME_X_DISPLAY (f), w, |
| 5808 | prop_atom, target_type, element_format, PropModeReplace, | 5820 | prop_atom, target_type, element_format, PropModeReplace, |