Skip to content
This repository has been archived by the owner on Jan 26, 2024. It is now read-only.

Commit

Permalink
fix segfault when dragging chromium tabs
Browse files Browse the repository at this point in the history
  • Loading branch information
sevz17 committed May 14, 2022
1 parent 06d9230 commit 3c11ad9
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
15 changes: 9 additions & 6 deletions client.h
Expand Up @@ -30,16 +30,19 @@ client_surface(Client *c)
static inline void
client_activate_surface(struct wlr_surface *s, int activated)
{
struct wlr_xdg_surface *surface;
#ifdef XWAYLAND
if (wlr_surface_is_xwayland_surface(s)) {
wlr_xwayland_surface_activate(
wlr_xwayland_surface_from_wlr_surface(s), activated);
struct wlr_xwayland_surface *xsurface;
if (wlr_surface_is_xwayland_surface(s)
&& (xsurface = wlr_xwayland_surface_from_wlr_surface(s))) {
wlr_xwayland_surface_activate(xsurface, activated);
return;
}
#endif
if (wlr_surface_is_xdg_surface(s))
wlr_xdg_toplevel_set_activated(
wlr_xdg_surface_from_wlr_surface(s), activated);
if (wlr_surface_is_xdg_surface(s)
&& (surface = wlr_xdg_surface_from_wlr_surface(s))
&& surface->role == WLR_XDG_SURFACE_ROLE_TOPLEVEL)
wlr_xdg_toplevel_set_activated(surface, activated);
}

static inline void
Expand Down
2 changes: 1 addition & 1 deletion dwl.c
Expand Up @@ -1121,7 +1121,7 @@ focusclient(Client *c, int lift)
} else {
Client *w;
struct wlr_scene_node *node = old->data;
if ((w = node->data))
if (old->role_data && (w = node->data))
for (i = 0; i < 4; i++)
wlr_scene_rect_set_color(w->border[i], bordercolor);

Expand Down

0 comments on commit 3c11ad9

Please sign in to comment.