squalou / google-chat-linux

source of a fork of google-chat-linux unofficial client from robyf
51 stars 11 forks source link

No Window Decoration on Gnome 43 #59

Closed vwbusguy closed 1 year ago

vwbusguy commented 1 year ago

With the most recent release (5.21.18-2), when I now launch it, I no longer have the normal window decorations, meaning that the GUI stuff like title bar, minimize, and being able to move it around without holding down the Super key are now gone. These had previously worked in earlier versions.

This appears to be related from journald:

Dec 20 11:27:18 samus systemd[3466]: Started app-gnome-alacarte\x2dmade-337128.scope - Application launched by gnome-shell.
Dec 20 11:27:18 samus alacarte-made.desktop[337139]: Google Chat Linux - v5.21.18-2
Dec 20 11:27:18 samus alacarte-made.desktop[337139]: Node.js runtime version: v16.16.0
Dec 20 11:27:18 samus alacarte-made.desktop[337139]: runtime platform :  linux
Dec 20 11:27:18 samus alacarte-made.desktop[337139]: {
Dec 20 11:27:18 samus alacarte-made.desktop[337139]:   bounds: { x: 2845, y: 430, width: 1105, height: 757 },
Dec 20 11:27:18 samus alacarte-made.desktop[337139]:   wasMaximized: false,
Dec 20 11:27:18 samus alacarte-made.desktop[337139]:   isThemed: false,
Dec 20 11:27:18 samus alacarte-made.desktop[337139]:   keepMinimized: true,
Dec 20 11:27:18 samus alacarte-made.desktop[337139]:   startHidden: false,
Dec 20 11:27:18 samus alacarte-made.desktop[337139]:   enableKeyboardShortcuts: false,
Dec 20 11:27:18 samus alacarte-made.desktop[337139]:   enableNodeIntegration: true,
Dec 20 11:27:18 samus alacarte-made.desktop[337139]:   openUrlInside: false,
Dec 20 11:27:18 samus alacarte-made.desktop[337139]:   thirdPartyAuthLoginMode: false,
Dec 20 11:27:18 samus alacarte-made.desktop[337139]:   useXdgOpen: false,
Dec 20 11:27:18 samus alacarte-made.desktop[337139]:   useOldUrl: false,
Dec 20 11:27:18 samus alacarte-made.desktop[337139]:   languages: undefined
Dec 20 11:27:18 samus alacarte-made.desktop[337139]: }
Dec 20 11:27:18 samus alacarte-made.desktop[337139]: ?disable-gpu:false
Dec 20 11:27:18 samus alacarte-made.desktop[337177]: [337177:1220/112718.471498:ERROR:gpu_init.cc(521)] Passthrough is not supported, GL is egl, ANGLE is
Dec 20 11:27:20 samus alacarte-made.desktop[337139]: Failed to update window icon :-(
Dec 20 11:27:20 samus alacarte-made.desktop[337139]: TypeError: Cannot read properties of undefined (reading 'setImage')
Dec 20 11:27:20 samus alacarte-made.desktop[337139]:     at setIcon (/home/scott/Projects/google-chat-linux/src/tray.js:93:18)
Dec 20 11:27:20 samus alacarte-made.desktop[337139]:     at IpcMainImpl.<anonymous> (/home/scott/Projects/google-chat-linux/src/tray.js:77:2)
Dec 20 11:27:20 samus alacarte-made.desktop[337139]:     at IpcMainImpl.emit (node:events:527:28)
Dec 20 11:27:20 samus alacarte-made.desktop[337139]:     at EventEmitter.<anonymous> (node:electron/js2c/browser_init:165:11237)
Dec 20 11:27:20 samus alacarte-made.desktop[337139]:     at EventEmitter.emit (node:events:527:28)
Dec 20 11:27:20 samus alacarte-made.desktop[337139]: Failed to update window icon :-(
Dec 20 11:27:20 samus alacarte-made.desktop[337139]: Error: Failed to load image from path '/home/scott/Projects/google-chat-linux/node_modules/electron/dist/resources/icon/normal-64.png'
Dec 20 11:27:20 samus alacarte-made.desktop[337139]:     at Object.updateIcon (/home/scott/Projects/google-chat-linux/src/window.js:140:14)
Dec 20 11:27:20 samus alacarte-made.desktop[337139]:     at setIcon (/home/scott/Projects/google-chat-linux/src/tray.js:99:16)
Dec 20 11:27:20 samus alacarte-made.desktop[337139]:     at IpcMainImpl.<anonymous> (/home/scott/Projects/google-chat-linux/src/tray.js:77:2)
Dec 20 11:27:20 samus alacarte-made.desktop[337139]:     at IpcMainImpl.emit (node:events:527:28)
Dec 20 11:27:20 samus alacarte-made.desktop[337139]:     at EventEmitter.<anonymous> (node:electron/js2c/browser_init:165:11237)
Dec 20 11:27:20 samus alacarte-made.desktop[337139]:     at EventEmitter.emit (node:events:527:28)
Dec 20 11:27:21 samus alacarte-made.desktop[337139]: [337139:1220/112721.961132:ERROR:object_proxy.cc(623)] Failed to call method: org.freedesktop.ScreenSaver.GetActive: object_path= /org/freedesktop/ScreenSaver: org.freedes>
...
Dec 20 11:27:23 samus alacarte-made.desktop[337139]: Failed to update window icon :-(
Dec 20 11:27:23 samus alacarte-made.desktop[337139]: TypeError: Cannot read properties of undefined (reading 'setImage')
Dec 20 11:27:23 samus alacarte-made.desktop[337139]:     at setIcon (/home/scott/Projects/google-chat-linux/src/tray.js:93:18)
Dec 20 11:27:23 samus alacarte-made.desktop[337139]:     at IpcMainImpl.<anonymous> (/home/scott/Projects/google-chat-linux/src/tray.js:77:2)
Dec 20 11:27:23 samus alacarte-made.desktop[337139]:     at IpcMainImpl.emit (node:events:527:28)
Dec 20 11:27:23 samus alacarte-made.desktop[337139]:     at EventEmitter.<anonymous> (node:electron/js2c/browser_init:165:11237)
Dec 20 11:27:23 samus alacarte-made.desktop[337139]:     at EventEmitter.emit (node:events:527:28)
Dec 20 11:27:23 samus alacarte-made.desktop[337139]: Failed to update window icon :-(
Dec 20 11:27:23 samus alacarte-made.desktop[337139]: Error: Failed to load image from path '/home/scott/Projects/google-chat-linux/node_modules/electron/dist/resources/icon/badge-64.png'
Dec 20 11:27:23 samus alacarte-made.desktop[337139]:     at Object.updateIcon (/home/scott/Projects/google-chat-linux/src/window.js:140:14)
Dec 20 11:27:23 samus alacarte-made.desktop[337139]:     at setIcon (/home/scott/Projects/google-chat-linux/src/tray.js:99:16)
Dec 20 11:27:23 samus alacarte-made.desktop[337139]:     at IpcMainImpl.<anonymous> (/home/scott/Projects/google-chat-linux/src/tray.js:77:2)
Dec 20 11:27:23 samus alacarte-made.desktop[337139]:     at IpcMainImpl.emit (node:events:527:28)
Dec 20 11:27:23 samus alacarte-made.desktop[337139]:     at EventEmitter.<anonymous> (node:electron/js2c/browser_init:165:11237)
Dec 20 11:27:23 samus alacarte-made.desktop[337139]:     at EventEmitter.emit (node:events:527:28)

Google-Chat-No-Menu-Bar

vwbusguy commented 1 year ago

It looks like it might be pulling from the wrong path for assets. It seems to be pulling from "/node_modules/electron/dist/resources/icon/" (which doesn't exist) instead of /assets/icon, where those images do exist.

If it's helpful context, this is the .desktop file I've been using to launch it:

[Desktop Entry]
Type=Application
Name=Google Chat
Comment=Google Chat Electron Client
Path=/home/scott/Projects/google-chat-linux
Icon=/home/scott/Projects/google-chat-linux/assets/icon.png
Exec=google-chat-linux.sh
TryExec=google-chat-linux.sh
Terminal=false
Categories=GTK;GNOME;Network;Chat;
MimeType=application/xhtml+xml
vwbusguy commented 1 year ago

OK, I figured it out. The only real change in the recent version is --ozone-platform-hint=auto in google-chat-linux.sh. Removing that fixes it for me. (I'm running Gnome 43 with Wayland on Fedora 37.)

image

squalou commented 1 year ago

Hi, yeah that was 'intended' sorry for the breaking change. I consider titlebas a waste of space, moving them around by holding Super key is fine.

I should make it optional though.

I didn't find a proper way to set the option at runtime so I added it in the .desktop file too. You lay want to copy it from /usr/share/applications to for instance $HOME/.local/share/applications and edit it there, to remove the option.

Apparently there are still work in progress on electron side regarding wayland / xwayalnd rendering, the "auto" value may become the default value one day.

squalou commented 1 year ago

Revert done in 5.21.18-3

squalou commented 1 year ago

It looks like it might be pulling from the wrong path for assets. It seems to be pulling from "/node_modules/electron/dist/resources/icon/" (which doesn't exist) instead of /assets/icon, where those images do exist.

If it's helpful context, this is the .desktop file I've been using to launch it:

[Desktop Entry]
Type=Application
Name=Google Chat
Comment=Google Chat Electron Client
Path=/home/scott/Projects/google-chat-linux
Icon=/home/scott/Projects/google-chat-linux/assets/icon.png
Exec=google-chat-linux.sh
TryExec=google-chat-linux.sh
Terminal=false
Categories=GTK;GNOME;Network;Chat;
MimeType=application/xhtml+xml

Regarding these paths, I have no way to test the package installed on Windows.

I tested your Pull Request unfortunately had to revert it : once packaged and installed it fails with Gnome and Xfce.

Note that he behavior is not the same when installed (with assets being searched from a compiled assets file), and when run from source code (where it fails since it looks for actual paths).

To illustrate, right now from source it fails on my dev machine but works when installed.

squalou commented 1 year ago

will have a look here https://github.com/electron/electron/pull/29618 when I find a few hours