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'.
This commit is contained in:
22
src/xfns.c
22
src/xfns.c
@@ -7788,6 +7788,7 @@ Text larger than the specified size is clipped. */)
|
||||
ptrdiff_t count_1;
|
||||
Lisp_Object window, size, tip_buf;
|
||||
Window child;
|
||||
XWindowAttributes child_attrs;
|
||||
int dest_x_return, dest_y_return;
|
||||
AUTO_STRING (tip, " *tip*");
|
||||
|
||||
@@ -8028,11 +8029,24 @@ Text larger than the specified size is clipped. */)
|
||||
FRAME_DISPLAY_INFO (f)->root_window,
|
||||
root_x, root_y, &dest_x_return,
|
||||
&dest_y_return, &child))
|
||||
XSetTransientForHint (FRAME_X_DISPLAY (tip_f),
|
||||
FRAME_X_WINDOW (tip_f), child);
|
||||
{
|
||||
/* But only if the child is not override-redirect, which can
|
||||
happen if the pointer is above a menu. */
|
||||
|
||||
if (XGetWindowAttributes (FRAME_X_DISPLAY (f),
|
||||
child, &child_attrs)
|
||||
|| child_attrs.override_redirect)
|
||||
XDeleteProperty (FRAME_X_DISPLAY (tip_f),
|
||||
FRAME_X_WINDOW (tip_f),
|
||||
FRAME_DISPLAY_INFO (tip_f)->Xatom_wm_transient_for);
|
||||
else
|
||||
XSetTransientForHint (FRAME_X_DISPLAY (tip_f),
|
||||
FRAME_X_WINDOW (tip_f), child);
|
||||
}
|
||||
else
|
||||
XSetTransientForHint (FRAME_X_DISPLAY (tip_f),
|
||||
FRAME_X_WINDOW (tip_f), None);
|
||||
XDeleteProperty (FRAME_X_DISPLAY (tip_f),
|
||||
FRAME_X_WINDOW (tip_f),
|
||||
FRAME_DISPLAY_INFO (tip_f)->Xatom_wm_transient_for);
|
||||
|
||||
#ifndef USE_XCB
|
||||
XMoveResizeWindow (FRAME_X_DISPLAY (tip_f), FRAME_X_WINDOW (tip_f),
|
||||
|
||||
@@ -15984,6 +15984,7 @@ x_term_init (Lisp_Object display_name, char *xrm_option, char *resource_name)
|
||||
ATOM_REFS_INIT ("WM_CONFIGURE_DENIED", Xatom_wm_configure_denied)
|
||||
ATOM_REFS_INIT ("WM_MOVED", Xatom_wm_window_moved)
|
||||
ATOM_REFS_INIT ("WM_CLIENT_LEADER", Xatom_wm_client_leader)
|
||||
ATOM_REFS_INIT ("WM_TRANSIENT_FOR", Xatom_wm_transient_for)
|
||||
ATOM_REFS_INIT ("Editres", Xatom_editres)
|
||||
ATOM_REFS_INIT ("CLIPBOARD", Xatom_CLIPBOARD)
|
||||
ATOM_REFS_INIT ("TIMESTAMP", Xatom_TIMESTAMP)
|
||||
|
||||
@@ -364,6 +364,8 @@ struct x_display_info
|
||||
Atom Xatom_wm_configure_denied; /* When our config request is denied */
|
||||
Atom Xatom_wm_window_moved; /* When the WM moves us. */
|
||||
Atom Xatom_wm_client_leader; /* Id of client leader window. */
|
||||
Atom Xatom_wm_transient_for; /* Id of whatever window we are
|
||||
transient for. */
|
||||
|
||||
/* EditRes protocol */
|
||||
Atom Xatom_editres;
|
||||
|
||||
Reference in New Issue
Block a user