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)
|
xcb_destroy_notify_event_t *ev)
|
||||||
{
|
{
|
||||||
client_t *c;
|
client_t *c;
|
||||||
|
xembed_window_t *emwin;
|
||||||
|
int i;
|
||||||
|
|
||||||
if((c = client_getbywin(ev->window)))
|
if((c = client_getbywin(ev->window)))
|
||||||
client_unmanage(c);
|
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;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -550,13 +558,14 @@ event_handle_unmapnotify(void *data __attribute__ ((unused)),
|
||||||
* response_type field */
|
* response_type field */
|
||||||
bool send_event = ((ev->response_type & 0x80) >> 7);
|
bool send_event = ((ev->response_type & 0x80) >> 7);
|
||||||
|
|
||||||
if((c = client_getbywin(ev->window))
|
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)
|
if(ev->event == xutil_screen_get(connection, c->phys_screen)->root
|
||||||
client_unmanage(c);
|
&& send_event
|
||||||
|
&& window_getstate(c->win) == XCB_WM_NORMAL_STATE)
|
||||||
/** \todo invalidate for all screen might be too much */
|
client_unmanage(c);
|
||||||
if((em = xembed_getbywin(globalconf.embedded, ev->window)))
|
}
|
||||||
|
else if((em = xembed_getbywin(globalconf.embedded, ev->window)))
|
||||||
{
|
{
|
||||||
xembed_window_list_detach(&globalconf.embedded, em);
|
xembed_window_list_detach(&globalconf.embedded, em);
|
||||||
for(i = 0; i < globalconf.screens_info->nscreen; i++)
|
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.
|
/** Handle a systray request.
|
||||||
* \param embed_win The window to embed.
|
* \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)
|
systray_request_handle(xcb_window_t embed_win, int phys_screen, xembed_info_t *info)
|
||||||
{
|
{
|
||||||
xembed_window_t *em;
|
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
|
| 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,
|
xcb_change_window_attributes(globalconf.connection, embed_win, XCB_CW_EVENT_MASK,
|
||||||
select_input_val);
|
select_input_val);
|
||||||
|
@ -135,7 +138,7 @@ systray_request_handle(xcb_window_t embed_win, int phys_screen, xembed_info_t *i
|
||||||
int
|
int
|
||||||
systray_process_client_message(xcb_client_message_event_t *ev)
|
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_cookie_t geom_c;
|
||||||
xcb_get_geometry_reply_t *geom_r;
|
xcb_get_geometry_reply_t *geom_r;
|
||||||
xcb_screen_iterator_t iter;
|
xcb_screen_iterator_t iter;
|
||||||
|
@ -153,10 +156,11 @@ systray_process_client_message(xcb_client_message_event_t *ev)
|
||||||
|
|
||||||
p_delete(&geom_r);
|
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;
|
break;
|
||||||
}
|
}
|
||||||
return 0;
|
|
||||||
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Handle xembed client message.
|
/** Handle xembed client message.
|
||||||
|
|
|
@ -26,7 +26,6 @@
|
||||||
#include "common/xembed.h"
|
#include "common/xembed.h"
|
||||||
|
|
||||||
void systray_init(int);
|
void systray_init(int);
|
||||||
int systray_request_handle(xcb_window_t, int, xembed_info_t *);
|
|
||||||
int systray_process_client_message(xcb_client_message_event_t *);
|
int systray_process_client_message(xcb_client_message_event_t *);
|
||||||
int xembed_process_client_message(xcb_client_message_event_t *);
|
int xembed_process_client_message(xcb_client_message_event_t *);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue