Melvin-Abraham / Google-Assistant-Unofficial-Desktop-Client

A cross-platform unofficial Google Assistant Client for Desktop (powered by Google Assistant SDK)
Apache License 2.0
3.6k stars 401 forks source link

Electron window is not launching #14

Closed sayoojsamuel closed 3 years ago

sayoojsamuel commented 3 years ago

Describe the bug On running npm start, the electron window is not launching. The following error is logged in the terminal,

(node:5462) Electron: Loading non-context-aware native module in renderer: '/home/v4d3r/Downloads/packages/Google-Assistant-Unofficial-Desktop-Client/node_modules/grpc/src/node/extension_binary/electron-v9.0-linux-x64-glibc/grpc_node.node'. This is deprecated, see https://github.com/electron/electron/issues/18397.

To Reproduce Steps to reproduce the behavior:

  1. Go to the project directory
  2. run npm install
  3. run npm start
  4. The task-bar tray icon is started, however the app does not launch.

Expected behavior The landing window should pop up.

Screenshots

Tray Icon

image

Desktop (please complete the following information):

Additional context The same behaviour is noticed after building and running g-assist

Melvin-Abraham commented 3 years ago

The warning in the terminal is expected considering the native module grpc is not context aware as of now. Also, the app has to be launched by Super + Shift + A keyboard shortcut (refer to this). You can also launch the assistant by right-clicking the tray icon and selecting "Launch Assistant" option.

sayoojsamuel commented 3 years ago

@Melvin-Abraham so I had already tried both the methods. However, the same error is logged in the terminal.

GAUDC

Melvin-Abraham commented 3 years ago

I have added a new commit which includes addition of "Open DevTools" option in tray icon context menu. Launch the assistant as usual (via any of the two methods) and then click "Open DevTools". If there are any errors logged in the DevTools console, do specify in here...

sayoojsamuel commented 3 years ago

@Melvin-Abraham DevTools option gave a great head start. The issue was due to having dual screens with different orientation. The app defaults to open in the center of the screenspace, hence was hidden in the non visible area.

image

Would it be possible to align the app within one screen?

Melvin-Abraham commented 3 years ago

Just to get some idea about the display, can you execute electron.remote.screen.getAllDisplay() and electron.remote.screen.getPrimaryDisplay() in the DevTools and share the log?

sayoojsamuel commented 3 years ago

Running electron.remote.screen.getPrimaryDisplay() yields

electron.remote.screen.getPrimaryDisplay()
{id: 1881264395124802, bounds: {…}, workArea: {…}, accelerometerSupport: "unknown", monochrome: false, …}
accelerometerSupport: "unknown"
bounds: {x: 0, y: 598, width: 1366, height: 768}
colorDepth: 24
colorSpace: "{primaries:BT709, transfer:IEC61966_2_1, matrix:RGB, range:FULL}"
depthPerComponent: 8
id: 1881264395124802
internal: false
monochrome: false
rotation: 0
scaleFactor: 1
size: {width: 1366, height: 768}
touchSupport: "unknown"
workArea: {x: 0, y: 598, width: 1366, height: 768}
workAreaSize: {width: 1366, height: 768}
__proto__: Object

Running electron.remote.screen.getAllDisplays() return the following


(2) [{…}, {…}]
0:
accelerometerSupport: "unknown"
bounds: {x: 0, y: 598, width: 1366, height: 768}
colorDepth: 24
colorSpace: "{primaries:BT709, transfer:IEC61966_2_1, matrix:RGB, range:FULL}"
depthPerComponent: 8
id: 1881264395124802
internal: false
monochrome: false
rotation: 0
scaleFactor: 1
size: {width: 1366, height: 768}
touchSupport: "unknown"
workArea: {x: 0, y: 598, width: 1366, height: 768}
workAreaSize: {width: 1366, height: 768}
__proto__: Object
1:
accelerometerSupport: "unknown"
bounds: {x: 1366, y: 0, width: 768, height: 1366}
colorDepth: 24
colorSpace: "{primaries:BT709, transfer:IEC61966_2_1, matrix:RGB, range:FULL}"
depthPerComponent: 8
id: 4692798670932035
internal: false
monochrome: false
rotation: 90
scaleFactor: 1
size: {width: 768, height: 1366}
touchSupport: "unknown"
workArea: {x: 1366, y: 0, width: 768, height: 1366}
workAreaSize: {width: 768, height: 1366}```
Melvin-Abraham commented 3 years ago

Thank you @sayoojsamuel, I'll look into that...

Melvin-Abraham commented 3 years ago

@sayoojsamuel Can you check if this commit helps?

sayoojsamuel commented 3 years ago

I suppose this issue is now resolved. The Display Preferences option is working perfectectly.
image