squalou / google-chat-linux

source of a fork of google-chat-linux unofficial client from robyf
50 stars 10 forks source link

Middle-clicking a link causes window to go blank #3

Closed frebib closed 5 years ago

frebib commented 5 years ago

It also opens an empty browser window.

I'd expect that it behaves the same as middle clicking a link in a browser, opening the link in a new tab. Incidentally, that is actually the same as just left-clicking the link as it would open in an external browser anyway

squalou commented 5 years ago

Hi, I knew this one unfortunately, and didn't track it down yet.

Honestly I'm slowly getting really disapointed by the whole eletron experience, I don't get why it has to behave differently from a regular chrome browser.

I'll try to have a look.

squalou commented 5 years ago

Hm, funny, I cannot reproduce it anymore! It now opens a new tab in my fefault browser.

Can you confirm it still blank/crash on your side ?

If so, what kind of link causes it : a basic text link (like, you send a message with an url in it), or an image with a link or anyhting else ?

frebib commented 5 years ago

Yeah I can still reproduce it. Images seem to be ok but textual URLs are not. My default browser is Chromium. Perhaps it is something to do with how the OS handles link opening?

squalou commented 5 years ago

strange, same default browser here. Do you use the .deb packaging, If so, can you run 'from sources' using the 'build and run' instructions from readme ?

Personnaly I'm on archlinux, I don't have any easy way to test the .deb packaging. Maybe something is wrong there.

frebib commented 5 years ago

I'm also on Arch. I'll try rebuilding and reinstalling the package just in case, but I'd assume yay would tell me if I'm out of date

squalou commented 5 years ago

I've juste submitted a small update just in case : electron switched from beta to 5.0.1

Will probably make no difference.

frebib commented 5 years ago

I'm not sure what is going on. It appears that the AUR package built a different version than this repo? Something is not right. I just tried updating which didn't launch unless I set ELECTRON_DISABLE_SANDBOX=true (even though that should be in the launch script but apparently in the build I have it isn't?). With that build electron didn't freak out, but the browser tab target was about:blank.

I tried pulling and doing a fresh makepkg and got back to the place I was at before with the white window and empty browser tab. It seems that the PKGBUILD isn't up-to-date/correct or whatever. Anyway, I probably shouldn't be debugging this whilst I'm at work

squalou commented 5 years ago

Ah, look s like the 'quick and dirty quirks' I did on the arch packaging is getting back at me. long story short : indeed the versioning is crappy, on arch side it counts the number of commits. I need to fix that but it doesn't explain why the app crashes.

I've just removed/rebuilt using yay , it builds r37.2829db3, which works on my laptop. Maybe I have a weird setting or undeclared dependency that make things work on my side ... can't fid it though.

When you can, could you test from this repo again, with a clean git clone, npm install and ./google-chat-linux.sh ?

If things works it means that I probably have to rework arch package.

squalou commented 5 years ago

Try an update. If yay doesn' t suggest anything, you will maybe need to completey remove/reinstall the aur package, since I've just changed the numbering scheme.

If this happens, I'll once again change the numbering in order to force update from r37 to whatever number I'll set.

squalou commented 5 years ago

DAMN With the clean build on my side, I finally can reproduce the issue too ! That's a good news (sort of :) ), I'll finally manage to track down the issue

frebib commented 5 years ago

Ran a cleanbuild with yay and I got the 0.1.6 version with no functional change. I'm glad you can repro it now

frebib commented 5 years ago

It seems that left-clicking a link causes the same behaviour now :'(

squalou commented 5 years ago

OMG I think I spotted the issue ! I used to rely on dependency electron "^5.0.0-beta.6" .. and it automatically switched to a newer version.

If I force to the exact version beta6, then apparently it works again.

I'll have to dig into what is not supported anymore, It will probably be a nightmare.... but the good news is : Ican rollback to a working thing !

You can try, clean build from yay

squalou commented 5 years ago

any better results ? (clean install works again for me)

frebib commented 5 years ago

Nope. Left click works fine but middle click is still broken, even after a clean build from the AUR

squalou commented 5 years ago

I've just tried adding an explicit middle-click catcher that completely duplicates the left click event catch. Maybe it will help. I suppose it depends on how the WM handles the clicks. (xfce in my case) Try to update, should be 0.1.7-1

frebib commented 5 years ago

Ha, that actually works a treat. Admittedly it's a hack but it's good for now :) thanks!

I wonder if Electron will fix it at some point

squalou commented 5 years ago

Good news ! When I have some spare hours, I'll try to make it work on released 5.0.1 version of electron. Maybe they changed things for the better (huh huh huh :) )

Closing this one.

squalou commented 5 years ago

Damn last comment, found out the buggy part I left in the code.

There was a 'sandbox': true in windowoptions, that was ignored until recent versions of electron. It must be set to false... and it is in use in 5.0.0 and more recent. So let's update it soon :)