From 777e69fcf8cdd8f868223e5985587fd7ac935033 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=A1=D1=82=D1=80=D0=B0=D1=85=D0=B8=D1=9A=D0=B0=20=D0=A0?= =?UTF-8?q?=D0=B0=D0=B4=D0=B8=D1=9B?= Date: Tue, 10 Oct 2023 22:05:24 +0200 Subject: [PATCH] Make cleaner exit function: quitprogram MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Страхиња Радић --- config.h | 2 +- surf.c | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/config.h b/config.h index 4b42977..56031a2 100644 --- a/config.h +++ b/config.h @@ -159,7 +159,7 @@ static Key keys[] = { { MODKEY, GDK_KEY_slash, spawn, SETPROP("_SURF_FIND", "_SURF_FIND", PROMPT_FIND) }, { MODKEY, GDK_KEY_m, spawn, BM_ADD("_SURF_URI") }, - { MODKEY, GDK_KEY_q, destroywin, { 0 } }, + { MODKEY, GDK_KEY_q, quitprogram, { 0 } }, { 0, GDK_KEY_Escape, stop, { 0 } }, diff --git a/surf.c b/surf.c index 85165ba..64d20fa 100644 --- a/surf.c +++ b/surf.c @@ -241,6 +241,7 @@ static void scrollv(Client *c, const Arg *a); static void scrollh(Client *c, const Arg *a); static void navigate(Client *c, const Arg *a); static void stop(Client *c, const Arg *a); +static void quitprogram(Client *c, const Arg *a); static void toggle(Client *c, const Arg *a); static void togglefullscreen(Client *c, const Arg *a); static void togglecookiepolicy(Client *c, const Arg *a); @@ -2002,6 +2003,12 @@ stop(Client *c, const Arg *a) webkit_web_view_stop_loading(c->view); } +void +quitprogram(Client *c, const Arg *a) +{ + closeview(c->view, c); +} + void toggle(Client *c, const Arg *a) { -- 2.45.2