aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPo Lu2022-02-08 09:25:24 +0800
committerPo Lu2022-02-08 09:25:24 +0800
commitcdf7e2e02130d980c9e70f4d5a019b52d7914de6 (patch)
tree562ba7945c09138a3eba1f550ca8f8c399641ad3 /src
parent1f45d273884a648f47abea919a5246452f542aa9 (diff)
downloademacs-cdf7e2e02130d980c9e70f4d5a019b52d7914de6.tar.gz
emacs-cdf7e2e02130d980c9e70f4d5a019b52d7914de6.zip
Don't allow tooltips to be transient for override redirect windows
* src/xfns.c (Fx_show_tip): Delete WM_TRANSIENT_FOR if the child window is override-redirect. * src/xterm.c (x_term_init): Intern new atom. * src/xterm.h (struct x_display_info): New atom `Xatom_wm_transient_for'.
Diffstat (limited to 'src')
-rw-r--r--src/xfns.c22
-rw-r--r--src/xterm.c1
-rw-r--r--src/xterm.h2
3 files changed, 21 insertions, 4 deletions
diff --git a/src/xfns.c b/src/xfns.c
index 7878ee62f5e..2fd9ad6b054 100644
--- a/src/xfns.c
+++ b/src/xfns.c
@@ -7788,6 +7788,7 @@ Text larger than the specified size is clipped. */)
7788 ptrdiff_t count_1; 7788 ptrdiff_t count_1;
7789 Lisp_Object window, size, tip_buf; 7789 Lisp_Object window, size, tip_buf;
7790 Window child; 7790 Window child;
7791 XWindowAttributes child_attrs;
7791 int dest_x_return, dest_y_return; 7792 int dest_x_return, dest_y_return;
7792 AUTO_STRING (tip, " *tip*"); 7793 AUTO_STRING (tip, " *tip*");
7793 7794
@@ -8028,11 +8029,24 @@ Text larger than the specified size is clipped. */)
8028 FRAME_DISPLAY_INFO (f)->root_window, 8029 FRAME_DISPLAY_INFO (f)->root_window,
8029 root_x, root_y, &dest_x_return, 8030 root_x, root_y, &dest_x_return,
8030 &dest_y_return, &child)) 8031 &dest_y_return, &child))
8031 XSetTransientForHint (FRAME_X_DISPLAY (tip_f), 8032 {
8032 FRAME_X_WINDOW (tip_f), child); 8033 /* But only if the child is not override-redirect, which can
8034 happen if the pointer is above a menu. */
8035
8036 if (XGetWindowAttributes (FRAME_X_DISPLAY (f),
8037 child, &child_attrs)
8038 || child_attrs.override_redirect)
8039 XDeleteProperty (FRAME_X_DISPLAY (tip_f),
8040 FRAME_X_WINDOW (tip_f),
8041 FRAME_DISPLAY_INFO (tip_f)->Xatom_wm_transient_for);
8042 else
8043 XSetTransientForHint (FRAME_X_DISPLAY (tip_f),
8044 FRAME_X_WINDOW (tip_f), child);
8045 }
8033 else 8046 else
8034 XSetTransientForHint (FRAME_X_DISPLAY (tip_f), 8047 XDeleteProperty (FRAME_X_DISPLAY (tip_f),
8035 FRAME_X_WINDOW (tip_f), None); 8048 FRAME_X_WINDOW (tip_f),
8049 FRAME_DISPLAY_INFO (tip_f)->Xatom_wm_transient_for);
8036 8050
8037#ifndef USE_XCB 8051#ifndef USE_XCB
8038 XMoveResizeWindow (FRAME_X_DISPLAY (tip_f), FRAME_X_WINDOW (tip_f), 8052 XMoveResizeWindow (FRAME_X_DISPLAY (tip_f), FRAME_X_WINDOW (tip_f),
diff --git a/src/xterm.c b/src/xterm.c
index 38f181e5df8..b49441ddb79 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -15984,6 +15984,7 @@ x_term_init (Lisp_Object display_name, char *xrm_option, char *resource_name)
15984 ATOM_REFS_INIT ("WM_CONFIGURE_DENIED", Xatom_wm_configure_denied) 15984 ATOM_REFS_INIT ("WM_CONFIGURE_DENIED", Xatom_wm_configure_denied)
15985 ATOM_REFS_INIT ("WM_MOVED", Xatom_wm_window_moved) 15985 ATOM_REFS_INIT ("WM_MOVED", Xatom_wm_window_moved)
15986 ATOM_REFS_INIT ("WM_CLIENT_LEADER", Xatom_wm_client_leader) 15986 ATOM_REFS_INIT ("WM_CLIENT_LEADER", Xatom_wm_client_leader)
15987 ATOM_REFS_INIT ("WM_TRANSIENT_FOR", Xatom_wm_transient_for)
15987 ATOM_REFS_INIT ("Editres", Xatom_editres) 15988 ATOM_REFS_INIT ("Editres", Xatom_editres)
15988 ATOM_REFS_INIT ("CLIPBOARD", Xatom_CLIPBOARD) 15989 ATOM_REFS_INIT ("CLIPBOARD", Xatom_CLIPBOARD)
15989 ATOM_REFS_INIT ("TIMESTAMP", Xatom_TIMESTAMP) 15990 ATOM_REFS_INIT ("TIMESTAMP", Xatom_TIMESTAMP)
diff --git a/src/xterm.h b/src/xterm.h
index 63956fd6434..854d87c83ce 100644
--- a/src/xterm.h
+++ b/src/xterm.h
@@ -364,6 +364,8 @@ struct x_display_info
364 Atom Xatom_wm_configure_denied; /* When our config request is denied */ 364 Atom Xatom_wm_configure_denied; /* When our config request is denied */
365 Atom Xatom_wm_window_moved; /* When the WM moves us. */ 365 Atom Xatom_wm_window_moved; /* When the WM moves us. */
366 Atom Xatom_wm_client_leader; /* Id of client leader window. */ 366 Atom Xatom_wm_client_leader; /* Id of client leader window. */
367 Atom Xatom_wm_transient_for; /* Id of whatever window we are
368 transient for. */
367 369
368 /* EditRes protocol */ 370 /* EditRes protocol */
369 Atom Xatom_editres; 371 Atom Xatom_editres;