nyaomidev / glasstron Goto Github PK
View Code? Open in Web Editor NEWThe go-to solution to Electron composition effects, such as blurry windows.
License: Apache License 2.0
The go-to solution to Electron composition effects, such as blurry windows.
License: Apache License 2.0
Describe the bug
The window isn't spawning and node is returning an error saying that electron.app.getPath
is undefined.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
The window should be created
Desktop (please complete the following information):
[email protected]
[email protected]
Node.js v15.8.0
, npm 6.14.11
Describe the bug
I'm using this template but glasstron fail and it didn't find the win32 module.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
The app start with no problems
Desktop (please complete the following information):
How do I pass the blur to the webview?
Going over the readme, it doesn't seem to say which blur type should be used for blurType
. Should this simply be omitted for Linux platforms? I remember that Glasscord only accepted a boolean, but I'm not certain if it's the same to just setBlur(true)
.
Add support for the new Mica effect. Someone has already made it work for flutter and i was wondering if it could be added.
repo: https://github.com/alexmercerind/flutter_acrylic
Thanks.
const { BrowserWindow: GBW } = require('glasstron')
const { app, BrowserWindow: EBW } = require('electron')
app.on('ready', () => {
let w1 = new GBW({})
let w2 = new EBW({})
w1.setVibrancy('fullscreen-ui')
w2.setVibrancy('fullscreen-ui')
})
Describe the bug
In Gnome Shell, the blur background effect don't work. The background is only transparent
Note: This issue section is for Glasstron only!
DO NOT report other apps' issues.
More specifically, DO NOT REPORT ANYTHING RELATED SPECIFICALLY TO GLASSCORD HERE!
To Reproduce
Steps to reproduce the behavior:
Expected behavior
A blur effect
Desktop (please complete the following information):
As soon as the window loses focus the background turns from glassy too very dark. Still can see some blur but looks like bg-black opacity-90
Everything looks as it should when widow is in focus.
Main.js
const mainWindow = createWindow("main", { width: 400, height: 100, resizable: false, x: 788, y: 1000, transparent: true, frame: false, });
mainWindow.setAlwaysOnTop(true, "screen-saver");
mainWindow.setVisibleOnAllWorkspaces(true);
mainWindow.setFullScreenable(false);
Expected behavior
Should maintain opacity and blur at constant value regardless of the window that is in focus.
**Desktop **
I'm pretty unsure of how to actually set up Glasstron. I did the "npm install glasstron" process, but that pretty much the only instruction that actually points to what to do. Am I supposed to move something somewhere? Run something? Edit a snippet of code like Glasscord says to do?
There's also the Glasscord project, which provides a little more of a "what to do", but that hasn't worked for me, with Discord or CodeOSS (which both are shown to work with Glasscord).
Describe the bug
Window Dragging Latency
To Reproduce
Steps to reproduce the behaviour:
Expected behaviour
The Window moves normally
Screenshots
https://user-images.githubusercontent.com/49573906/104110085-3dcda900-52a2-11eb-88e8-51feecf703f9.mp4
Desktop (please complete the following information):
Describe the bug
Glasstron's effects don't seem to function on a macbook.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
Was expecting the window to have blur effects applied to it.
Desktop (please complete the following information):
Describe the bug
Looks like Acrylic effect isn't working in Windows 11 Build 22000.5, of course this is an early build of Windows 11.
When using acrylic
in blurType
, Electron opens with white background even though I have it set to transparent.
Expected behavior
Acrylic effects shows up on Electron like it would with a regular UWP app (e.g. Settings, Calculator).
Acrylic (Left) | Blurbehind (Right)
Desktop (please complete the following information):
I believe we should hold off for a bit until more of Windows 11 is completed, after all this is an early build of Windows 11.
Describe the bug
I am dragging the window to the edge of the screen but it's not snapping like left or right.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
Snaps to the edge of the screen
Screenshots
I dont have time to record it not working will try post it later
Desktop (please complete the following information):
I made a new app with Glasstron: Clear Writer
repo link: https://github.com/Henrylin666/ClearWriter
would you like to put this repo onto README.md? :)
(README.md of Clear Writer is written in Chinese, but it also supports English)
Is your feature request related to a problem? Please describe.
Hello, I want to use this library on multiple platforms, including MacOS, Windows, Linux, and corresponding ARM64, ARM32, X86, X64 architecture
However, there are always errors in different platforms.It is hoped that the binary files that can be generated on Release can, the application can judge the use of files used by pre -processing scripts to achieve the purpose of increasing production speed
Describe the solution you'd like
This is the library I have already used
The author of this library wrote a Github actions to generate files auto
https://github.com/melchor629/node-flac-bindings
Describe alternatives you've considered
If you really don’t consider it, you can only use different computers to deal with these things.
Additional context
nothing
Describe the bug
On Linux, when using Glasstron on any Electron project, an error occurs:
Error: Bad atom
at ReadFixedRequest.callback (/run/media/korbs/My Passport/Development/GitHub/Desktop-App/node_modules/glasstron/node_modules/x11/lib/xcore.js:465:29)
at ReadFixedRequest.execute (/run/media/korbs/My Passport/Development/GitHub/Desktop-App/node_modules/glasstron/node_modules/x11/lib/unpackstream.js:41:10)
at UnpackStream.resume (/run/media/korbs/My Passport/Development/GitHub/Desktop-App/node_modules/glasstron/node_modules/x11/lib/unpackstream.js:165:30)
at UnpackStream.write (/run/media/korbs/My Passport/Development/GitHub/Desktop-App/node_modules/glasstron/node_modules/x11/lib/unpackstream.js:102:10)
at Socket.<anonymous> (/run/media/korbs/My Passport/Development/GitHub/Desktop-App/node_modules/glasstron/node_modules/x11/lib/xcore.js:88:21)
at Socket.emit (node:events:394:28)
at addChunk (node:internal/streams/readable:312:12)
at readableAddChunk (node:internal/streams/readable:287:9)
at Socket.Readable.push (node:internal/streams/readable:226:10)
at Pipe.onStreamRead (node:internal/stream_base_commons:190:23) {
error: 5,
seq: 21,
badParam: 0,
minorOpcode: 0,
majorOpcode: 17
}
Desktop:
This issue does also have occur on KDE and other DEs, I just ended up looking at X11's module and removing stuff that spits out these errors to the console log. So, I'll be using that custom version of x11 instead for now on: https://github.com/KorbsStudio/node-x11
With this one I edited, this error no longer shows.
Describe the bug
Glasstron seems to not be compatible with Apple M1 Macbooks. When implementing in a clean electron project, it yields a fatal error.
To Reproduce
Steps to reproduce the behavior:
Desktop (please complete the following information):
Console Output
ERROR Failed to compile with 1 errors
error in ./node_modules/glasstron/src/native/linux_x11/x11.js
Module parse failed: Unexpected token (23:9)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
| module.exports = class X11 extends EventEmitter {
|
> display = undefined;
|
| createConnection(){
@ ./node_modules/glasstron/src/native/linux_x11/index.js 18:10-26
@ ./node_modules/glasstron/src/platforms/linux.js
@ ./node_modules/glasstron/src/platforms sync ^\.\/.*\.js$
@ ./node_modules/glasstron/src/utils.js
@ ./node_modules/glasstron/src/index.js
@ ./src/background.js
@ multi ./src/background.js
ERROR Build failed with errors.
error Command failed with exit code 1.
As it is now, in order to request blurriness to the system we use glasstron.update(BrowserWindow, Object)
with Object being nothing more than some key-value pairs ("OS => blur mode").
While this is simple enough at a first glance, I am really looking forward to do things in a more stylish way.
What if, for example, we bind custom methods to the BrowserWindow objects?
browserWindow.setBlur(boolean); // General switch
browserWindow.getBlur(); // Get the current blur status
browserWindow.blurType = string; // determining Windows blur type
To me it's way cleaner this way and we can actually achieve it without breaking native casts and anything, really. This could also mean converting a lot of Glasstron classes to static ones or Singletons, saving a bunch of memory.
Plus, we can use the already included browserWindow.setVibrancy(string|null)
method on macOS, which means that we don't have to deal with macOS for the most part (as we already deal with the setBackgroundColor problem on macOS anyway).
Let me know your thoughts and share your ideas.
Is your feature request related to a problem? Please describe.
No. This is just a suggestion to the acrylic option in Windows.
Describe the solution you'd like
When using the acrylic option there should be a feature like in Windows Terminal so you can change the density making it more transparent or more blurry.
ex. "acrylicOpacity": 0.7
Describe alternatives you've considered
The only options to make it less blurry but lose the nice acrylic look is to use blur-behind.
No apparent effect on macOS Big Sur. I've tried various combinations of settings and poked through the source, but cannot get any sort of vibrancy (blurred background) effect.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
A vibrancy effect in the background of the window.
Screenshots
Desktop (please complete the following information):
9.4.0
and 11.1.1
.Additional context
const win = new glasstron.BrowserWindow({
width: 800,
height: 600,
backgroundColor: 'transparent',
// vibrancy: 'sidebar',
// titleBarStyle: 'hiddenInset',
transparent: true,
webPreferences: {
nodeIntegration: true
}
});
// win.blurType = "sidebar";
win.setVibrancy('sidebar')
win.setBlur(true);
Which build tools do I need to install and use Glasstron on Windows?
Glasstron 2.x will be made, sometime in the future (no ETA). Currently searching for other people willing to help, like it was done for Glasstron 1.x.
Main stuff I want to clarify here and now:
new Glasstron.BrowserWindow()
will survive. Hopefully this makes sense in everyone's head.transparent
has to be true; no Aero Snapping; Acrylic slowdown on mouse drag 'workarounds').Glasstron 2 will be a "breaking update" on purpose. I made it with little to no Node/Electron knowledge and it shows. It is time to give people a proper module.
Future plans will probably be reimplementing blur in Plasma and in GNOME to get "on par" with Glasstron 1, but it is not top priority since there's still no way (to my knowledge) to talk to the Wayland compositor from external modules that run in Electron's "main" context.
The official answer is nope.
The not-so-official answer is "with proper funding". I miss having Discord look consistent with my setup, too; but it is a burden I don't want to replicate all alone and with basically no time at disposal if there's no gain nowhere, since I am still a student.
Describe the bug
Some strange reason, the titlebar text turns white, however, the titlebar itself is perfect?
https://img.snaildos.com/u/7QBNde.png
Note: This issue section is for Glasstron only!
DO NOT report other apps' issues.
More specifically, DO NOT REPORT ANYTHING RELATED SPECIFICALLY TO GLASSCORD HERE!
To Reproduce
Steps to reproduce the behavior:
Expected behavior
The text should not be on a white background, instead, of a blurred background.
Screenshots
Described above.
Desktop (please complete the following information):
Is your feature request related to a problem? Please describe.
Compton is a popular X compositor and is not supported by Glasstron, making Glasstron unusable.
Describe the solution you'd like.
I would like to see full compton support.
Describe alternatives you've considered
N/A
Additional context
Other compositors are also very important, not everyone uses KWin.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.