luakit / luakit

Fast, small, webkit based browser framework extensible by Lua.
https://luakit.github.io/
GNU General Public License v3.0
2.1k stars 251 forks source link

Tabs of an existing instance are duplicated in new window #945

Open MuhammedZakir opened 3 years ago

MuhammedZakir commented 3 years ago

Current Behavior:

When a new LuaKit window is opened, either manually or when links are clicked in other apps, it will have tabs from an existing instance.

Desired Behavior:

Either:

  1. new window should not contain tabs from an existing window, or
  2. if a window already exists, open new tab in that window, rather than in a new window.

How can we reproduce it (step by step):

  1. Start LuaKit and open a webpage.
  2. Open any URL by clicking it in another app, or run luakit <URL>.
    • `luakit sometimes opens in an existing window.

The new window will have 2 tabs.

Environment:

Linux Distribution & Version: Manjaro X11 Output of luakit --version:

luakit 26df055
  built with webkit 2.32.2 (installed version: 2.32.3)
c0dev0id commented 3 years ago

Have you tried luakit -U?

If you do not want any session handling ever, you can comment the session plugin and change these lines at the very end of rc.lua

-- Restore last saved session
local w = (not luakit.nounique) and (session and session.restore())
if w then
    for i, uri in ipairs(uris) do
        w:new_tab(uri, { switch = i == 1 })
    end
else
    -- Or open new window
    window.new(uris)
end

To only this:

-- Or open new window
window.new(uris)
MuhammedZakir commented 3 years ago

I want session handling, but don't want new window to duplicate tabs from an opened window. -U works for now. Thanks! :-)


I think there is some issue with luakit.unique. unique_instance module is loaded by default. So it should prevent opening more than 1 window, right? It does work, but not always.

Also, is there a particular reason why GTK app id is used rather than X window title/class name?