Skip to content

Commit

Permalink
Correctly deny ConfigureRequests for embedded windows
Browse files Browse the repository at this point in the history
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: awesomeWM#986
Signed-off-by: Uli Schlachter <psychon@znc.in>
  • Loading branch information
psychon committed Jul 7, 2016
1 parent 2337329 commit 31b7d9d
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions event.c
Original file line number Diff line number Diff line change
Expand Up @@ -403,7 +403,31 @@ event_handle_configurerequest(xcb_configure_request_event_t *ev)
{
/* Ignore this so that systray icons cannot resize themselves.
* 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
event_handle_configurerequest_configure_window(ev);
Expand Down

0 comments on commit 31b7d9d

Please sign in to comment.