From 4daa6e8befeb2461eaa298195d0296f85ce7fd4d Mon Sep 17 00:00:00 2001 From: Uli Schlachter Date: Sat, 10 Oct 2015 20:34:43 +0200 Subject: [PATCH] Select SubstructureRedirect on our systray window This ensures that systray icons cannot resize themselves. We assign them some size and they have to deal with what they get! Fixes: https://github.com/awesomeWM/awesome/issues/487 Signed-off-by: Uli Schlachter --- event.c | 6 ++++++ systray.c | 4 ++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/event.c b/event.c index 1246772d1..8fadbceed 100644 --- a/event.c +++ b/event.c @@ -373,6 +373,12 @@ event_handle_configurerequest(xcb_configure_request_event_t *ev) /* ICCCM 4.1.5 / 4.2.3, if nothing was changed, send an event saying so */ client_send_configure(c); } + else if (xembed_getbywin(&globalconf.embedded, ev->window)) + { + /* Ignore this so that systray icons cannot resize themselves. + * We decide their size! + */ + } else event_handle_configurerequest_configure_window(ev); } diff --git a/systray.c b/systray.c index 55518da85..cfccca56e 100644 --- a/systray.c +++ b/systray.c @@ -48,8 +48,8 @@ systray_init(void) xscreen->root, -1, -1, 1, 1, 0, XCB_COPY_FROM_PARENT, xscreen->root_visual, - XCB_CW_BACK_PIXEL, (const uint32_t []) - { xscreen->black_pixel }); + XCB_CW_BACK_PIXEL | XCB_CW_EVENT_MASK, (const uint32_t []) + { xscreen->black_pixel, XCB_EVENT_MASK_SUBSTRUCTURE_REDIRECT }); atom_name = xcb_atom_name_by_screen("_NET_SYSTEM_TRAY", globalconf.default_screen); if(!atom_name)