systray: do not manage windows twice
Signed-off-by: Julien Danjou <julien@danjou.info>
This commit is contained in:
parent
2b8b9fc08f
commit
ba63e7e784
23
event.c
23
event.c
|
@ -296,9 +296,17 @@ event_handle_destroynotify(void *data __attribute__ ((unused)),
|
|||
xcb_destroy_notify_event_t *ev)
|
||||
{
|
||||
client_t *c;
|
||||
xembed_window_t *emwin;
|
||||
int i;
|
||||
|
||||
if((c = client_getbywin(ev->window)))
|
||||
client_unmanage(c);
|
||||
else if((emwin = xembed_getbywin(globalconf.embedded, ev->event)))
|
||||
{
|
||||
xembed_window_list_detach(&globalconf.embedded, emwin);
|
||||
for(i = 0; i < globalconf.screens_info->nscreen; i++)
|
||||
widget_invalidate_cache(i, WIDGET_CACHE_EMBEDDED);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -550,13 +558,14 @@ event_handle_unmapnotify(void *data __attribute__ ((unused)),
|
|||
* response_type field */
|
||||
bool send_event = ((ev->response_type & 0x80) >> 7);
|
||||
|
||||
if((c = client_getbywin(ev->window))
|
||||
&& ev->event == xutil_screen_get(connection, c->phys_screen)->root
|
||||
&& send_event && window_getstate(c->win) == XCB_WM_NORMAL_STATE)
|
||||
client_unmanage(c);
|
||||
|
||||
/** \todo invalidate for all screen might be too much */
|
||||
if((em = xembed_getbywin(globalconf.embedded, ev->window)))
|
||||
if((c = client_getbywin(ev->window)))
|
||||
{
|
||||
if(ev->event == xutil_screen_get(connection, c->phys_screen)->root
|
||||
&& send_event
|
||||
&& window_getstate(c->win) == XCB_WM_NORMAL_STATE)
|
||||
client_unmanage(c);
|
||||
}
|
||||
else if((em = xembed_getbywin(globalconf.embedded, ev->window)))
|
||||
{
|
||||
xembed_window_list_detach(&globalconf.embedded, em);
|
||||
for(i = 0; i < globalconf.screens_info->nscreen; i++)
|
||||
|
|
12
systray.c
12
systray.c
|
@ -77,7 +77,7 @@ systray_init(int phys_screen)
|
|||
/** Handle a systray request.
|
||||
* \param embed_win The window to embed.
|
||||
*/
|
||||
int
|
||||
static int
|
||||
systray_request_handle(xcb_window_t embed_win, int phys_screen, xembed_info_t *info)
|
||||
{
|
||||
xembed_window_t *em;
|
||||
|
@ -89,6 +89,9 @@ systray_request_handle(xcb_window_t embed_win, int phys_screen, xembed_info_t *i
|
|||
| XCB_EVENT_MASK_ENTER_WINDOW
|
||||
};
|
||||
|
||||
/* check if not already trayed */
|
||||
if((em = xembed_getbywin(globalconf.embedded, embed_win)))
|
||||
return 1;
|
||||
|
||||
xcb_change_window_attributes(globalconf.connection, embed_win, XCB_CW_EVENT_MASK,
|
||||
select_input_val);
|
||||
|
@ -135,7 +138,7 @@ systray_request_handle(xcb_window_t embed_win, int phys_screen, xembed_info_t *i
|
|||
int
|
||||
systray_process_client_message(xcb_client_message_event_t *ev)
|
||||
{
|
||||
int screen_nbr = 0;
|
||||
int screen_nbr = 0, ret = 0;
|
||||
xcb_get_geometry_cookie_t geom_c;
|
||||
xcb_get_geometry_reply_t *geom_r;
|
||||
xcb_screen_iterator_t iter;
|
||||
|
@ -153,10 +156,11 @@ systray_process_client_message(xcb_client_message_event_t *ev)
|
|||
|
||||
p_delete(&geom_r);
|
||||
|
||||
systray_request_handle(ev->data.data32[2], screen_nbr, NULL);
|
||||
ret = systray_request_handle(ev->data.data32[2], screen_nbr, NULL);
|
||||
break;
|
||||
}
|
||||
return 0;
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
/** Handle xembed client message.
|
||||
|
|
Loading…
Reference in New Issue