shell: don't segfault when pressing super+k when no surface is focused
This commit is contained in:
committed by
Kristian Høgsberg
parent
1f54f17ef8
commit
6cef009272
+6
-1
@@ -3271,12 +3271,17 @@ static void
|
|||||||
force_kill_binding(struct wl_seat *seat, uint32_t time, uint32_t key,
|
force_kill_binding(struct wl_seat *seat, uint32_t time, uint32_t key,
|
||||||
void *data)
|
void *data)
|
||||||
{
|
{
|
||||||
|
struct wl_surface *focus_surface;
|
||||||
struct wl_client *client;
|
struct wl_client *client;
|
||||||
pid_t pid;
|
pid_t pid;
|
||||||
uid_t uid;
|
uid_t uid;
|
||||||
gid_t gid;
|
gid_t gid;
|
||||||
|
|
||||||
client = seat->keyboard->focus->resource.client;
|
focus_surface = seat->keyboard->focus;
|
||||||
|
if (!focus_surface)
|
||||||
|
return;
|
||||||
|
|
||||||
|
client = focus_surface->resource.client;
|
||||||
wl_client_get_credentials(client, &pid, &uid, &gid);
|
wl_client_get_credentials(client, &pid, &uid, &gid);
|
||||||
|
|
||||||
kill(pid, SIGKILL);
|
kill(pid, SIGKILL);
|
||||||
|
|||||||
Reference in New Issue
Block a user