23phy / ewc

Native window composition on Windows for Electron apps.
MIT License
78 stars 7 forks source link

Laggy dragging on 1903 #22

Open reycn opened 4 years ago

reycn commented 4 years ago

Hi,

[Issue] Ewc is literally slow when dragging arcylic windows. [Tried] 1. updated to electron@latest; 2. updated to windows-build tools 2019 with 18362 SDK. [Request] If possible and willing,

Thanks for your efforts. :)

23phy commented 4 years ago

Well hello there, I suppose this is the same as #16. I have no idea why is this, and I cannot reproduce it, as I am on 1809 update. I'll update my windows soon and test again. Lately, windows updates break things on users machine 🤷🏻‍♀️

reycn commented 4 years ago

Thanks for your effort. :)

reycn commented 4 years ago

Well hello there, I suppose this is the same as #16. I have no idea why is this, and I cannot reproduce it, as I am on 1809 update. I'll update my windows soon and test again. Lately, windows updates break things on users machine 🤷🏻‍♀️

It turns out that it may be a bug related to mouse polling frequency on 1903. Simliar questions, explanation, ang temporary solutions here.

23phy commented 4 years ago

Unfortunately I cannot update my windows (due to windows update bugs) to that version to experience that issue. It may be fixed by Microsoft themselves.

reycn commented 4 years ago

Unfortunately I cannot update my windows (due to windows update bugs) to that version to experience that issue. It may be fixed by Microsoft themselves.

Ture and I highly recommend that DO NOT UPDATE... 😂

PegasisForever commented 4 years ago

For me, the lag only happends when set to "arclic", but not "blur behind". No idea what causes this.

But I think a workaround is possible to fix this? Just increase the blur radius of "blur behind" (Don't know if this is possible) and add a 50% translucent black div on top of it (Tried, this can work)

No change to package.json. Windows 10 Pro 1909

reycn commented 4 years ago

For me, the lag only happends when set to "arclic", but not "blur behind". No idea what causes this.

But I think a workaround is possible to fix this? Just increase the blur radius of "blur behind" (Don't know if this is possible) and add a 50% translucent black div on top of it (Tried, this can work)

No change to package.json. Windows 10 Pro 1909

ACCENTPOLICY is provided by MS which pre-defines radius.

reycn commented 4 years ago

It seems that pack KB4541738 of Win 10 2004 fixed this bug.

Toby56 commented 4 years ago

Doesn't seem to have for me:

image

Toby56 commented 4 years ago

I have this fix which disables the acrylic when dragging using a debounce function. It just changes it to a blur behind when dragging, but you can do whatever you want with that:

// Debounce function:
function debounce(func, wait, immediate) {
  var timeout;
  return function() {
    var context = this,
      args = arguments;
    var later = function() {
      timeout = null;
      if (!immediate) func.apply(context, args);
    };
    var callNow = immediate && !timeout;
    clearTimeout(timeout);
    timeout = setTimeout(later, wait);
    if (callNow) func.apply(context, args);
  };
}

// Functions for disable and re-enable:
const disableAcrylic = debounce(
  () => {
    ewc.setBlurBehind(win, 0xdd222222);
  },
  50,
  true
);

const enableAcrylic = debounce(() => {
  ewc.setAcrylic(win, 0xbb000000);
}, 50);

enableAcrylic();

// Event listeners:
win.on("move", () => {
  disableAcrylic();
  enableAcrylic();
});

win.on("resize", () => {
  disableAcrylic();
  enableAcrylic();
});

Search up js debounce function to see how that part works.

PsyVeteran commented 3 years ago

I have found a 2 click solution for this issue in the meantime. toggling off the "show windows content while dragging" toggle item in the Windows visual performance removed whatever causes this. Video attached to show the effects clearly.

https://user-images.githubusercontent.com/87094644/124820320-7b3e9500-dfac-11eb-9e1a-e78933cba591.mp4

ghost commented 2 years ago

i have this issue on my desktop but not on my laptop. have tried setting the polling frequency to match my laptop mouse, but although this helps a little it's still pretty bad.

2wons commented 2 years ago

disabling transparency effects (settings > personalization > colors), seems to be another work around for the problem. Though a big downside is you lose all the nice acrylic transparency from windows ( taskbar & wt terminal).

joshgrift commented 1 year ago

Supposedly fixed in Windows 11: https://forum.obsidian.md/t/translucent-window-setting-results-in-increasingly-laggy-window-drag-movements-as-mouse-polling-frequency-increases/6829/34