Giter Club home page Giter Club logo

glasstron's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

glasstron's Issues

Window not snapping (Windows 10)

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:

  1. Make an app with glasstron, or use the app I am trying to use it on with the v1.3.0 tag
  2. on windows (not sure about other os) try oving it to the edge of the screen and try snapping it.
  3. Dosn't respond.

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):

  • OS: Windows 10
  • Glasstron version: 0.1.0

[Electron-Vue] Webpack does not recognize a language feature that Glasstron uses

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:

  1. Create a new Electron/Electron-Vue project
  2. Implement Glasstron as specified in the README
  3. Run the dev instance

Desktop (please complete the following information):

  • OS: macOS 11.5.1
  • Electron: 2.6.x
  • Processor: Apple M1

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.

Can you provide binary *. node files in releases page

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

Window not spawning, error with electron.app.getPath (not found)

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:

  1. Try to spawn a window with Glasstron

Expected behavior
The window should be created

Screenshots
image

Desktop (please complete the following information):

setVibrancy() broken on macOS

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')
})

Compton Support [LINUX]

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.

Gnome Blur don't work

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:

  1. Run your demo on gnome

Expected behavior
A blur effect

Desktop (please complete the following information):

  • OS: Fedora 34

So, how do you actually install/use Glasstron? (for those - like myself - who are unfamiliar with how it works)

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).

Glasstron is transparent on Mac OS

Describe the bug
Glasstron's effects don't seem to function on a macbook.

To Reproduce
Steps to reproduce the behavior:

  1. Create an electron app, with Glasscord.
  2. Launch the application in production or development mode.
  3. Window is completely transparent, with no visual effects.

Expected behavior
Was expecting the window to have blur effects applied to it.

Desktop (please complete the following information):

  • OS: Mac OS

Can't Remove White Tint on Windows 11 with Acrylic Blur

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).

Screenshots
image

Acrylic (Left) | Blurbehind (Right)

Desktop (please complete the following information):

  • OS: Windows 11 Build 22000.5
  • Glasscord version: 0.0.7

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.

TitleBar White??

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:

  1. Go to 'Create any Glasstron application, Don't use any electron title bar modules and you get this.'

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):

  • OS: Windows 212H
  • Glasscord version: 0.1.1

Design discussion: should I replace glasstron.update() with something more convenient?

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.

Unusual behavior when AlwaysOnTop = screen-saver

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 **

  • OS: Catalina 10.15.6
  • Glasscord version: 0.0.7

Blur types in Linux

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).

Not working on macOS Big Sur

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:

  1. Run this gist in Electron Fiddle, on macOS Big Sur.

Expected behavior
A vibrancy effect in the background of the window.

Screenshots

image

Desktop (please complete the following information):

  • OS: macOS Big Sur 11.1
  • Electron: Tested both 9.4.0 and 11.1.1.
  • Glasstron: 0.0.5

Additional context

  • This is on a 2019 MacBook Pro 15".
  • Standard vibrancy works. Albeit with a noticeable performance hit.
  • I've closely reviewed the docs, but am still a little unclear on what configuration setting to use for macOS. The following is what the gist uses:
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);

Error: Bad atom - X11

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:

  • OS: Fedora 34(GNOME 40.4) and Ubuntu 21.04(GNOME 3.38.5)

Update (June 9th, 2022)

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.

Add Acrylic Transparency Options

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.

Additional context
image
image

Plans for Glasstron 2

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:

  • The entire module will be rewritten to take advantage of modern ECMAScript conventions (ES6+) and it will be rewritten in TypeScript. As such, people using TS to develop will have correct type definitions and we are all happy.
  • Avoiding prototype pollution as much as possible is the new goal. Glasstron will expose an API to which you will pass an already constructed Electron BrowserWindow. No new Glasstron.BrowserWindow() will survive. Hopefully this makes sense in everyone's head.
  • macOS support will be dropped because it was only a wrapper that I used to get the last vibrancy mode set, but it turned out to be a pain to maintain and no one actually used it. Plus, developers who have to remember values can make their own functions to do so.
  • Linux support will be dropped. It's useless to advertise Linux if there's only one configuration that works among countless ones, plus more code to maintain and easy spaghetti (see Linux code on Glasstron 1.x and try to figure out how it works before your brain melts away). Also, it has always been buggy, flickery and overall unreliable.
  • Windows support is basically what Glasstron will be about. It will be rewritten with Windows 11 in mind first and foremost, but the main goal is to offer a consistent blur with the rest of the system. By this I mean, Windows 11 will have Mica blur; Windows 10, Acrylic blur; and Windows 7 (is that still around?) Aero blur. All of this will be handled by Glasstron 2 internally, and the developer will only have to call one function to toggle the blur on and off. Note that the usual Windows caveats could still apply (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.

Naomi, now that you announced plans for Glasstron 2, will Glasscord 2 ever be a thing?

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.