Correctly deny ConfigureRequests for embedded windows (#990)

Since commit 4daa6e8, we are denying resizes and moves for embedded windows
(=tray icons). However, the Xembed spec says that the embedding client acts like
a WM (as specified by ICCCM) to the embedded window. Thus, when denying a
configure request, we have to inform the window by sending it a synthetic
configure notify. Otherwise, GTK seems to sometimes not draw its tray icon.

Fixes: https://github.com/awesomeWM/awesome/issues/986
Signed-off-by: Uli Schlachter <psychon@znc.in>
This commit is contained in:
Uli Schlachter 2016-07-07 21:38:34 +02:00 committed by Daniel Hahler
parent 2337329d71
commit b33fb2a03a
1 changed files with 24 additions and 0 deletions

24
event.c
View File

@ -403,7 +403,31 @@ event_handle_configurerequest(xcb_configure_request_event_t *ev)
{ {
/* Ignore this so that systray icons cannot resize themselves. /* Ignore this so that systray icons cannot resize themselves.
* We decide their size! * We decide their size!
* However, Xembed says that we act like a WM to the embedded window and
* thus we have to send a synthetic configure notify informing the
* window that its configure request was denied.
*/ */
xcb_get_geometry_cookie_t geom_cookie =
xcb_get_geometry_unchecked(globalconf.connection, ev->window);
xcb_translate_coordinates_cookie_t coords_cookie =
xcb_translate_coordinates_unchecked(globalconf.connection,
ev->window, globalconf.screen->root, 0, 0);
xcb_get_geometry_reply_t *geom =
xcb_get_geometry_reply(globalconf.connection, geom_cookie, NULL);
xcb_translate_coordinates_reply_t *coords =
xcb_translate_coordinates_reply(globalconf.connection, coords_cookie, NULL);
if (geom && coords)
{
xwindow_configure(ev->window,
(area_t) { .x = coords->dst_x,
.y = coords->dst_y,
.width = geom->width,
.height = geom->height },
0);
}
p_delete(&geom);
p_delete(&coords);
} }
else else
event_handle_configurerequest_configure_window(ev); event_handle_configurerequest_configure_window(ev);