Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open New Window doesn't work in Linux #6523

Closed
abijr opened this issue Aug 30, 2022 · 5 comments
Closed

Open New Window doesn't work in Linux #6523

abijr opened this issue Aug 30, 2022 · 5 comments
Labels
multi-window os:linux :type/bug Something isn't working. Affects daily use.

Comments

@abijr
Copy link

abijr commented Aug 30, 2022

What happened?

Trying to open an additional window in Linux doesn't work.

Reproduce the Bug

  1. Use the right click menu for Logseq (in Gnome3)
  2. Click on New Window
  3. Error shows up:
[Main Exception]
Invalid URL
TypeError [ERR_INVALID_URL]: Invalid URL
at new NodeError (node:internal/errors:371:5)
at onParseError (node:internal/url:552:9)
at new URL (node:internal/url:628:5)
at Deeplink.<anonymous> (/tmp/.mount_Logseqv0XEFD/resources/app/electron.js:14933:326)
at Deeplink.emit (node:events:526:28)
at Deeplink._this.secondInstanceEvent (/tmp/.mount_Logseqv0XEFD/resources/app/node_modules/electron-deeplink/dist/index.js:78:23)
at App.emit (node:events:538:35)

Expected Behavior

I expect a new window to show up.

Screenshots

image

Desktop Platform Information

Fedora 36, AppImage 0.82

Mobile Platform Information

No response

Additional Context

Tried different ways to get the new window to open up, such as setting a shortcut for ui/open-new-window in the config.edn

This feature works as expected on OSX.

@Verneri
Copy link

Verneri commented Aug 30, 2022

just noticed the same problem on Arch Linux and AppImage

Following Exception comes out when starting from terminal

0:13:47.996 › Logseq App(0.8.2) Starting... 
10:14:04.544 › open-url {:url "--allow-file-access-from-files"}
uncaughtException TypeError [ERR_INVALID_URL]: Invalid URL
    at new NodeError (node:internal/errors:371:5)
    at onParseError (node:internal/url:552:9)
    at new URL (node:internal/url:628:5)
    at Deeplink.<anonymous> (/tmp/.mount_logseqsSvNGY/resources/app/electron.js:14933:326)
    at Deeplink.emit (node:events:526:28)
    at Deeplink._this.secondInstanceEvent (/tmp/.mount_logseqsSvNGY/resources/app/node_modules/electron-deeplink/dist/index.js:78:23)
    at App.emit (node:events:538:35) {
  input: '--allow-file-access-from-files',
  code: 'ERR_INVALID_URL'
}

@cnrpman
Copy link
Collaborator

cnrpman commented Aug 30, 2022

@Verneri Thank you for the console output you cached! Seems a Logseq protocol is mistakenly triggered on opening new window on Linux.

Some investigation in depth is required to find out the new window mechanism on these OS, but a fast fix would be filtering the --allow-file-access-from-files string in the URL handler

(defn open-url-handler
"win - the main window instance (first renderer process)
url - the input URL"
[win url]
(.info logger "open-url" (str {:url url}))
(let [parsed-url (js/URL. url)
url-protocol (.-protocol parsed-url)]
(when (= (str LSP_SCHEME ":") url-protocol)
(logseq-url-handler win parsed-url))))

@cnrpman cnrpman added the :type/bug Something isn't working. Affects daily use. label Aug 30, 2022
@pwright
Copy link

pwright commented Sep 2, 2022

Any workaround? or should i revert to 0.8.2? or might that cause me more issues?

@pwright
Copy link

pwright commented Sep 2, 2022

To answer my own question (about workaround): If you construct a logseq url (logseq://graph/<graph>), you can open multiple windows on linux avoiding this issue.

@abijr
Copy link
Author

abijr commented Sep 3, 2022

Fixed in version 0.8.4, shift+ctrl+n is working again Linux.

I think this was the fix: 496c2b4

Thanks team!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
multi-window os:linux :type/bug Something isn't working. Affects daily use.
Projects
None yet
Development

No branches or pull requests

4 participants