diff options
Diffstat (limited to 'client.h')
-rw-r--r-- | client.h | 52 |
1 files changed, 47 insertions, 5 deletions
@@ -94,9 +94,12 @@ client_activate_surface(struct wlr_surface *s, int activated) { struct wlr_xdg_toplevel *toplevel; #ifdef XWAYLAND - struct wlr_xwayland_surface *xsurface; - if ((xsurface = wlr_xwayland_surface_try_from_wlr_surface(s))) { - wlr_xwayland_surface_activate(xsurface, activated); + struct wlr_xwayland_surface *surface; + if ((surface = wlr_xwayland_surface_try_from_wlr_surface(s))) { + if (activated && surface->minimized) + wlr_xwayland_surface_set_minimized(surface, false); + + wlr_xwayland_surface_activate(surface, activated); return; } #endif @@ -131,6 +134,18 @@ client_get_appid(Client *c) return c->surface.xdg->toplevel->app_id ? c->surface.xdg->toplevel->app_id : "broken"; } +static inline int +client_get_pid(Client *c) +{ + pid_t pid; +#ifdef XWAYLAND + if (client_is_x11(c)) + return c->surface.xwayland->pid; +#endif + wl_client_get_credentials(c->surface.xdg->client->client, &pid, NULL, NULL); + return pid; +} + static inline void client_get_clip(Client *c, struct wlr_box *clip) { @@ -314,8 +329,35 @@ static inline void client_set_border_color(Client *c, const float color[static 4]) { int i; - for (i = 0; i < 4; i++) - wlr_scene_rect_set_color(c->border[i], color); + + if (!c) + return; + + if (c == focustop(selmon)) { + if (selmon->lt[selmon->sellt] == (Layout*)&layouts[1] || c->isfloating) + color = floatcolor; + else if (selmon->lt[selmon->sellt] == (Layout*)&layouts[2]) + color = monoclecolor; + else if (c->isurgent) + color = urgentcolor; + else if (!exclusive_focus && !seat->drag) + color = focuscolor; + } else + color = color; + + + for (i = 0; i < 4; i++) { + if (border_color_type == BrdOriginal) { + wlr_scene_rect_set_color(c->border[i], color); + } else if (border_color_type == BrdStart) { + wlr_scene_rect_set_color(c->borders[i], color); + } else if (border_color_type == BrdEnd) { + wlr_scene_rect_set_color(c->bordere[i], color); + } else if (border_color_type == BrdStartEnd) { + wlr_scene_rect_set_color(c->borders[i], color); + wlr_scene_rect_set_color(c->bordere[i], color); + } + } } static inline void |