ewc icon indicating copy to clipboard operation
ewc copied to clipboard

Laggy dragging on 1903

Open reycn opened this issue 5 years ago • 14 comments

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,

  • any explanation on the machanism casusing such problem;
  • a more efficient module on dragging

Thanks for your efforts. :)

reycn avatar Oct 02 '19 05:10 reycn

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 🤷🏻‍♀️

23phy avatar Oct 08 '19 07:10 23phy

Thanks for your effort. :)

reycn avatar Oct 16 '19 13:10 reycn

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.

reycn avatar Feb 17 '20 12:02 reycn

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.

23phy avatar Feb 17 '20 15:02 23phy

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

reycn avatar Feb 18 '20 03:02 reycn

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

PegasisForever avatar Feb 24 '20 08:02 PegasisForever

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 avatar Feb 26 '20 11:02 reycn

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

reycn avatar Mar 16 '20 08:03 reycn

Doesn't seem to have for me:

image

Toby56 avatar Mar 16 '20 09:03 Toby56

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.

Toby56 avatar Mar 16 '20 10:03 Toby56

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

PsyVeteran avatar Jul 07 '21 19:07 PsyVeteran

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.

ghost avatar Jan 11 '22 10:01 ghost

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

2wons avatar Jan 30 '22 18:01 2wons

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

joshgrift avatar Oct 17 '22 21:10 joshgrift