electron icon indicating copy to clipboard operation
electron copied to clipboard

Electron windows causing repaint issues when DWM composition disabled

Open CharlieHess opened this issue 11 years ago • 34 comments

  • Log on to a Windows 7 machine
  • Switch your theme to Windows Basic or Windows Classic (this has the side-effect of disabling Aero's DWM composition)
  • Launch an Electron app
  • Switch to another app window
  • The other window fails to repaint:

window repaint issue

This occurs with almost every app that I've tried, so it seems like something funky with the Electron window. It may or may not require the presence of a webview tag; I haven't isolated that yet. Until now we've been advising users to switch to an Aero theme (this fixes the problem, but is undesirable for many).

CharlieHess avatar May 29 '15 21:05 CharlieHess

Also an issue with any remote desktop session, since that typically disables DWM composition.

CharlieHess avatar Jun 02 '15 19:06 CharlieHess

This is horrendous on a window sitting above outlook. The only real fix is to maximize and minimize slack, since there's so many panes in outlook you have to swirl your mouse pointer around in to clear the screen of repaint artifacts. Disabling gpu in both outlook and slack doesn't change anything either.

Sorry for the obfuscation in the images, I've provided extra to show the detail just in case.

2015-06-09 14_32_40-2015-05-17 22_01_40 2015-06-09 14_41_03-2015-06-09 14_30_06-2015-05-22 10_27_52

2015-06-09 14_34_43-2015-05-22 11_31_11

jakebauer avatar Jun 09 '15 21:06 jakebauer

replaced with https://github.com/rfgamaral/SlackUI - works flawlessly

jakebauer avatar Jul 01 '15 19:07 jakebauer

@CharlieHess Does this happen for the default app? I tried with v0.29.1 on a fresh Window 7 image with basic theme, and the default app seems to work well.

zcbenz avatar Jul 06 '15 08:07 zcbenz

@zcbenz I think it's exclusive to the webview tag.

CharlieHess avatar Jul 07 '15 01:07 CharlieHess

+1 same issue when css animation used.

fxpoet avatar Dec 09 '15 18:12 fxpoet

+1 Same problem with Slack.

LuisPeregrina avatar Feb 04 '16 20:02 LuisPeregrina

+1, I just reported this to Slack and they said it's a bug in Electron. Switching to an Aero theme to work around this would suck. Thanks in advance to whoever's working on this!

myself248 avatar Feb 08 '16 00:02 myself248

@myself248 If you upgrade to any OS newer than Windows 7, you can enable Classic Theme and still not hit this bug. Highly encouraged!

anaisbetts avatar Feb 12 '16 16:02 anaisbetts

slackatomwindowimprint

Imprinting issue is reproducible here too, clicking (in the screenshot shown) on the cmd window, then slack, then drobo dashboard. Happens about 1 time in 4. Win7, non-Aero theme, Nvidia NVS 5400M driver version 345.35.

Just as soon as any OS newer than 7 (I note that you don't say "better than") gets the thumbs-up from corporate IT, I'll have a workaround! :)

myself248 avatar Mar 12 '16 03:03 myself248

slackatomwindowrepaintbordlerless

Got a new and hilarious manifestation: sometimes when switching back to the window, it's drawn without borders. I can just alt-tab back and forth between Spotify and Slack a dozen times, and 1 or 2 of those times, Slack is drawn without a title bar or window borders, as seen here.

Interestingly enough, if I click where the title bar should be, I can move the window. And if I hover over where borders and corners should be, I get the resize cursor, and I can drag to resize the window. After that operation, the window is redrawn completely, 100% of the time.

myself248 avatar Mar 14 '16 00:03 myself248

I'm seeing an issue on Windows 7 where updating the title bar doesn't cause a repaint of the title bar. (I think it's the same problem this person is seeing: https://discuss.atom.io/t/title-bar-doesnt-update-when-switching-tabs/16429) The correct title is shown if I hover over the icon in the taskbar, and resizing the window makes it repaint. Two questions:

  1. Is this the same issue being described here, or should I create a new issue?
  2. Is there a workaround I can use to force a title bar repaint?

ghost avatar Aug 26 '16 13:08 ghost

  1. Yes it should be the same issue. If you want you can verify this by changing to the default Windows 7 theme and testing the repaint of the title bar.

Ben3eeE avatar Aug 26 '16 13:08 Ben3eeE

Confirmed: When I changed the theme, it solved the problem. Unfortunately, I can't tell my users to change their theme, so is there any other workaround I could implement in my code?

ghost avatar Aug 26 '16 13:08 ghost

Are there any Electron developers who can comment on this issue? If this is not going to be fixed, that would be good to know so we can make alternate arrangements.

This has been open for over a year and the issue is fairly serious for the affected users (a not insignificant number of people).

abatkin avatar Aug 26 '16 14:08 abatkin

None of the Electron developers are working on this, but will accept a PR for it

anaisbetts avatar Aug 26 '16 17:08 anaisbetts

We need to use transparent BrowserWindows in our application. This doesn't work with certain Windows settings. But we're able to detect these settings and show a warning to the user with instructions to fix it. We detect it by checking the Registry for certain values:

HKEY_CURRENT_USER\Software\Microsoft\Windows\CompositionPolicy should be 2
HKEY_CURRENT_USER\Software\Microsoft\Windows\Composition should be 1

TimvdEijnden avatar Oct 13 '16 09:10 TimvdEijnden

I'm having same issue with title-bar text not update until you click off app and back on or refresh or close window etc. Unless I change the theme, then it works fine but that's not a practical solution because i can't tell customers to change their theme

emilyofficial avatar Nov 25 '16 16:11 emilyofficial

Considering using Electron for a new project but this issue would be the show stopper as a significant number of our users will have Windows 7.

tohagan avatar Dec 12 '16 00:12 tohagan

Experiencing this issue with current 1.14.0 beta 0 still. (Win7x64, AMD) Re-enabled Aero and problem goes away, but that is not a solution/fix.

bgrimm avatar Jan 12 '17 12:01 bgrimm