aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAkshay Nair <phenax5@gmail.com>2025-08-21 12:12:09 +0530
committerAkshay Nair <phenax5@gmail.com>2025-08-21 12:12:09 +0530
commit7db40483aa2edb9be380bae3c90d2f54eae4deb1 (patch)
treec26498b8c583c1f178edd985a9780a7a668385ab
parenta634243a1d563ab4fe8dcd14bc9abd5b5617c858 (diff)
downloadnull-browser-7db40483aa2edb9be380bae3c90d2f54eae4deb1.tar.gz
null-browser-7db40483aa2edb9be380bae3c90d2f54eae4deb1.zip
Close devtools window when webview is closedHEADmain
-rw-r--r--TODO.org11
-rw-r--r--src/LuaRuntimeApi.hpp2
-rw-r--r--src/widgets/WebView.cpp5
3 files changed, 14 insertions, 4 deletions
diff --git a/TODO.org b/TODO.org
index 6956393..a53b7ad 100644
--- a/TODO.org
+++ b/TODO.org
@@ -26,20 +26,23 @@
- [X] Set search text as the user is typing (dmenu -r)
- [X] Update all api to use opts table options/filters pattern
- [ ] Element focus (input focus)
-- [ ] Prevent scroll when finder is active
+- [ ] Prevent scroll when hints is active
- [ ] Add win options for web.view.list / web.view.current / web.view.current_index /etc
- [ ] web.keymap.configure_mode(modename, { passthrough = false })
- [ ] Fullscreen
-- [ ] Zoom in/out/reset
-- [ ] Remove unwanted "async"-ness in lua calls
- [ ] Api for enabling rpc api in view
- [ ] Hide/show decoration api
- [ ] Review all options and make sure they're passed correctly
- [ ] Delay in tabline module updating (shows outdated titles)
+- [ ] Look into removing unwanted "async"-ness in lua calls
+- [ ] Zoom in/out/reset
+- [ ] Clearing event handlers (auto groups?)
** Bugs
+- [X] Closing webview should close devtools window
- [ ] INVESTIGATE: Segfault on close sometimes
-- [ ] Closing webview should close devtools window
+- [ ] Glitchy find/hints mode (async problem)
+- [ ] Statusline mode doesnt update when a different window updates mode
- [ ] web.view apis in `-e` flag from "clients" (non-servers calls) don't work
- [ ] API's don't validate types. (invalid type conversion segfaults)
- [ ] INVESTIGATE: Check why urlchanged doesnt fire for first url open sometimes
diff --git a/src/LuaRuntimeApi.hpp b/src/LuaRuntimeApi.hpp
index de8cc66..a198d50 100644
--- a/src/LuaRuntimeApi.hpp
+++ b/src/LuaRuntimeApi.hpp
@@ -134,6 +134,7 @@ int lua_api_keymap_set(lua_State *state) {
int lua_api_view_current(lua_State *state) {
auto &router = WindowActionRouter::instance();
+ // TODO: get win id param
auto view_id = router.fetch_current_view_id();
lua_pushinteger(state, view_id);
return 1;
@@ -141,6 +142,7 @@ int lua_api_view_current(lua_State *state) {
int lua_view_list(lua_State *state) {
auto &router = WindowActionRouter::instance();
+ // TODO: get win id param
auto views = router.fetch_webview_data_list();
lua_newtable(state);
diff --git a/src/widgets/WebView.cpp b/src/widgets/WebView.cpp
index ceb9c8e..1cd3d54 100644
--- a/src/widgets/WebView.cpp
+++ b/src/widgets/WebView.cpp
@@ -24,6 +24,11 @@ void WebView::open_devtools() {
devtools_window = nullptr;
});
+ connect(this, &WebView::destroyed, this, [this]() {
+ devtools_window->deleteLater();
+ devtools_window = nullptr;
+ });
+
page()->setDevToolsPage(devtools_window->page());
}