aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDavid Benjamin2012-01-07 15:02:06 +0800
committerChong Yidong2012-01-07 15:02:06 +0800
commit75bf0d333960bf6f60af0005194fb21dec5b4485 (patch)
tree408f37d3c297c9d29277669062d3225421d03bd8 /src
parent29232a68e057e6fe47508f24e2fe713ae0cfa0c3 (diff)
downloademacs-75bf0d333960bf6f60af0005194fb21dec5b4485.tar.gz
emacs-75bf0d333960bf6f60af0005194fb21dec5b4485.zip
Fix focus handling for embedded frames.
* xfns.c (Fx_focus_frame): Use it for embedded frames. * xterm.c (x_embed_request_focus): New function. * xterm.h: Add prototype. Fixes: debbugs:9977
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog8
-rw-r--r--src/xfns.c18
-rw-r--r--src/xterm.c12
-rw-r--r--src/xterm.h1
4 files changed, 36 insertions, 3 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 9e236b25785..468e73c190b 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,11 @@
12012-01-07 David Benjamin <davidben@mit.edu> (tiny change)
2
3 * xterm.c (x_embed_request_focus): New function.
4
5 * xterm.h: Add prototype.
6
7 * xfns.c (Fx_focus_frame): Use it for embedded frames (Bug#9977).
8
12012-01-05 Glenn Morris <rgm@gnu.org> 92012-01-05 Glenn Morris <rgm@gnu.org>
2 10
3 * emacs.c (emacs_copyright): Update short copyright year to 2012. 11 * emacs.c (emacs_copyright): Update short copyright year to 2012.
diff --git a/src/xfns.c b/src/xfns.c
index 6f44b05fa6c..f00335b5d03 100644
--- a/src/xfns.c
+++ b/src/xfns.c
@@ -3519,9 +3519,21 @@ FRAME nil means use the selected frame. */)
3519 3519
3520 BLOCK_INPUT; 3520 BLOCK_INPUT;
3521 x_catch_errors (dpy); 3521 x_catch_errors (dpy);
3522 XSetInputFocus (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), 3522
3523 RevertToParent, CurrentTime); 3523 if (FRAME_X_EMBEDDED_P (f))
3524 x_ewmh_activate_frame (f); 3524 {
3525 /* For Xembedded frames, normally the embedder forwards key
3526 events. See XEmbed Protocol Specification at
3527 http://freedesktop.org/wiki/Specifications/xembed-spec */
3528 xembed_request_focus (f);
3529 }
3530 else
3531 {
3532 XSetInputFocus (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f),
3533 RevertToParent, CurrentTime);
3534 x_ewmh_activate_frame (f);
3535 }
3536
3525 x_uncatch_errors (); 3537 x_uncatch_errors ();
3526 UNBLOCK_INPUT; 3538 UNBLOCK_INPUT;
3527 3539
diff --git a/src/xterm.c b/src/xterm.c
index 73bafbda2fa..4b34d6344ac 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -8981,6 +8981,18 @@ x_lower_frame (struct frame *f)
8981 } 8981 }
8982} 8982}
8983 8983
8984/* Request focus with XEmbed */
8985
8986void
8987xembed_request_focus (FRAME_PTR f)
8988{
8989 /* See XEmbed Protocol Specification at
8990 http://freedesktop.org/wiki/Specifications/xembed-spec */
8991 if (f->async_visible)
8992 xembed_send_message (f, CurrentTime,
8993 XEMBED_REQUEST_FOCUS, 0, 0, 0);
8994}
8995
8984/* Activate frame with Extended Window Manager Hints */ 8996/* Activate frame with Extended Window Manager Hints */
8985 8997
8986void 8998void
diff --git a/src/xterm.h b/src/xterm.h
index c77f386a2ad..86daa7bd27e 100644
--- a/src/xterm.h
+++ b/src/xterm.h
@@ -967,6 +967,7 @@ extern void x_clear_errors (Display *);
967extern void x_set_window_size (struct frame *, int, int, int); 967extern void x_set_window_size (struct frame *, int, int, int);
968extern void x_set_mouse_position (struct frame *, int, int); 968extern void x_set_mouse_position (struct frame *, int, int);
969extern void x_set_mouse_pixel_position (struct frame *, int, int); 969extern void x_set_mouse_pixel_position (struct frame *, int, int);
970extern void xembed_request_focus (struct frame *);
970extern void x_ewmh_activate_frame (struct frame *); 971extern void x_ewmh_activate_frame (struct frame *);
971extern void x_make_frame_visible (struct frame *); 972extern void x_make_frame_visible (struct frame *);
972extern void x_make_frame_invisible (struct frame *); 973extern void x_make_frame_invisible (struct frame *);