illixion / vscode-vibrancy-continued

Enable Acrylic/Glass effect for your VS Code.
MIT License
560 stars 32 forks source link

[Bug]: Windows 11 - Resize on drag #38

Open reececomo opened 1 year ago

reececomo commented 1 year ago

Is there an existing issue for this?

Current Behavior

When moving the window around on Windows 11, the vscode window shrinks. Not related to built-in snapping features.

Resolution: 3840 x 2160 pixels Scale: 150%

Expected Behavior

Window will retain its existing size.

Steps To Reproduce

  1. In Windows 11
  2. Naked installation
  3. 4K resolution (16:9) with scale at 150%
  4. Drag the window around

Environment

- OS: Windows 11
- VSCode: 1.72.2
- Extension: 1.1.9

Anything else?

No response

reececomo commented 1 year ago

Open issue exists in the old plugin: https://github.com/EYHN/vscode-vibrancy/issues/109

reececomo commented 1 year ago

Likely related to scale factor here: https://github.com/illixion/vscode-vibrancy-continued/blob/27803a92af08de4355bdc6d72e8be59c39c14c34/runtime/win10refresh.js#L181

ynsgnr commented 1 year ago

I have the same issue!

illixion commented 1 year ago

Thanks, will check this out. I’m not sure if this Windows 10 fix is even needed still, so I might just remove it entirely when I get a chance to test Vibrancy on a Windows 10 machine.

ynsgnr commented 1 year ago

I have deleted this lines manually from index.js at VS_CODE_PATH\data\extensions\illixion.vscode-vibrancy-continued-1.1.9\runtime\index.js and run "reload vibrancy" command. It works now!

const win10refresh = require('./win10refresh.js');
win10refresh(window, 60);
MolotovCherry commented 1 year ago

I have deleted this lines manually from index.js at VS_CODE_PATH\data\extensions\illixion.vscode-vibrancy-continued-1.1.9\runtime\index.js and run "reload vibrancy" command. It works now!

const win10refresh = require('./win10refresh.js');
win10refresh(window, 60);

Thanks to your comment, I narrowed down the problem.

The problem with that previous solution is that disabling it causes window resizing to be incredibly slow, which is apparently part of what these functions were fixing.

To fix it entirely, go into VS_CODE_PATH\data\extensions\illixion.vscode-vibrancy-continued-1.1.9\runtime\win10refresh.js

And comment out the entire function win.on('will-move', (e, newBounds), but leave everything else

This way we can have our cake and eat it too. Of course there's now jitter (don't remember if it was there before or not), but at least it "works" mostly now

Also, since we changed disableJitterFix, we can change the win.on('move' from

        if (disableJitterFix) {
            return false
        }

to

        if (isInSnapZone()) {
            return false
        }

Although I honestly didn't see any changes in functionality regardless

illixion commented 1 year ago

I have deleted this lines manually from index.js at VS_CODE_PATH\data\extensions\illixion.vscode-vibrancy-continued-1.1.9\runtime\index.js and run "reload vibrancy" command. It works now!

const win10refresh = require('./win10refresh.js');
win10refresh(window, 60);

Thanks to your comment, I narrowed down the problem.

The problem with that previous solution is that disabling it causes window resizing to be incredibly slow, which is apparently part of what these functions were fixing.

To fix it entirely, go into VS_CODE_PATH\data\extensions\illixion.vscode-vibrancy-continued-1.1.9\runtime\win10refresh.js

And comment out the entire function win.on('will-move', (e, newBounds), but leave everything else

This way we can have our cake and eat it too. Of course there's now jitter (don't remember if it was there before or not), but at least it "works" mostly now

Also, since we changed disableJitterFix, we can change the win.on('move' from

      if (disableJitterFix) {
          return false
      }

to

      if (isInSnapZone()) {
          return false
      }

Although I honestly didn't see any changes in functionality regardless

Thank you for looking into this, tested these changes on my end and everything works well, I've just pushed an update with your changes

MolotovCherry commented 1 year ago

I have deleted this lines manually from index.js at VS_CODE_PATH\data\extensions\illixion.vscode-vibrancy-continued-1.1.9\runtime\index.js and run "reload vibrancy" command. It works now!

const win10refresh = require('./win10refresh.js');
win10refresh(window, 60);

Thanks to your comment, I narrowed down the problem.

The problem with that previous solution is that disabling it causes window resizing to be incredibly slow, which is apparently part of what these functions were fixing.

To fix it entirely, go into VS_CODE_PATH\data\extensions\illixion.vscode-vibrancy-continued-1.1.9\runtime\win10refresh.js

And comment out the entire function win.on('will-move', (e, newBounds), but leave everything else

This way we can have our cake and eat it too. Of course there's now jitter (don't remember if it was there before or not), but at least it "works" mostly now

Also, since we changed disableJitterFix, we can change the win.on('move' from

        if (disableJitterFix) {
            return false
        }

to

        if (isInSnapZone()) {
            return false
        }

Although I honestly didn't see any changes in functionality regardless

Thank you for looking into this, tested these changes on my end and everything works well, I've just pushed an update with your changes

Maybe I shouldn't have used "fix" so freely. I meant it's more of a workable solution until it truly gets fixed. I don't know what problems or side effects my method will cause, especially cause I'm not really familiar with the code or with electron

Commenting out the entire will move function may not be good since I don't completely understand the code (for some reason I'm getting high gpu/cpu usage. I'm not sure why)

(In either case, the issue author was right when they said the problem was probably with the scale factor. That appears to me where the problem is as well)