diff --git a/client.c b/client.c index 487f0927..0440472c 100644 --- a/client.c +++ b/client.c @@ -35,6 +35,7 @@ #include "lua.h" #include "stack.h" #include "mouse.h" +#include "systray.h" #include "layouts/floating.h" #include "common/markup.h" @@ -376,6 +377,12 @@ client_manage(xcb_window_t w, xcb_get_geometry_reply_t *wgeom, int screen) xcb_change_window_attributes(globalconf.connection, w, XCB_CW_EVENT_MASK, select_input_val); + if(systray_iskdedockapp(w)) + { + systray_request_handle(w, screen_virttophys(screen), NULL); + return; + } + c = p_new(client_t, 1); c->screen = screen_get_bycoord(globalconf.screens_info, screen, wgeom->x, wgeom->y); diff --git a/event.c b/event.c index d31a3805..ae8e94d5 100644 --- a/event.c +++ b/event.c @@ -460,23 +460,6 @@ event_handle_maprequest(void *data __attribute__ ((unused)), client_raise(c); } } - else if(systray_iskdedockapp(ev->window)) - { - geom_c = xcb_get_geometry_unchecked(connection, ev->window); - - if(!(geom_r = xcb_get_geometry_reply(connection, geom_c, NULL))) - { - ret = -1; - goto bailout; - } - - /* get real screen */ - for(iter = xcb_setup_roots_iterator(xcb_get_setup(connection)), screen_nbr = 0; - iter.rem && iter.data->root != geom_r->root; xcb_screen_next (&iter), ++screen_nbr); - systray_request_handle(ev->window, screen_nbr, NULL); - - p_delete(&geom_r); - } else { geom_c = xcb_get_geometry_unchecked(connection, ev->window);