microsoft / PowerToys

Windows system utilities to maximize productivity
MIT License
109.63k stars 6.46k forks source link

[PTRun] System.Runtime.InteropServices.COMException: {Desktop composition is disabled} #31226

Open AlexDeMoura opened 7 months ago

AlexDeMoura commented 7 months ago

Microsoft PowerToys version

0.78.0.0

Installation method

PowerToys auto-update

Running as admin

Yes

Area(s) with issue?

General

Steps to reproduce

When I was choosing a font in the font menu of Excel, the screen went dark for one second or something, and it came back showing this window: Power Toys Run ran into an issue. Something went wrong. The attached log contents: 2024-02-01.txt The following software was running under an updated Windows 10 (8 MB RAM, 18 GB fixed VM, GPU0 Intel HD 530, GPU1 NVidia not active):

  1. One File Explorer window in the folder containing the Excel file I was working on;
  2. One Opera One (version: 105.0.4970.34) densely tabbed window, with Update stream: Stable, under System: Windows 10 64-bit (WoW64), and Chromium version:119.0.6045.199 - Browser identification: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/119.0.0.0 Safari/537.36 OPR/105.0.0.0 - Installation type: Stand-alone installation (USB), but the opera is installed in a C: folder (I love portable stuff, you know - portable means freedom);
  3. One Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17318.20000) 64-bit running a single <70 KB file in a C: folder;
  4. Background software running in Taskbar: PowerToys 0.78.0.0 (updated yesterday) and five more apps. OneDrive, Webroot anti-virus, f.lux v4.131 (screen brightness management), and two Lenovo hardware monitors (bundled software);
  5. Plus, a lot of stuff in Task Manager that I don't care and it is too much to post here, but it includes at least a bunch of Adobe processes and a half dozen MS Edge processes, even if the Acrobat, Photoshop, and Edge browser are not in use. By the way, MS Edge is the default browser - but I am not a great fan. I like Opera Portable better.

The fonts menu in Excel contains many Asian fonts, mainly Hebraic versions of the most common MS Office fonts. I was choosing one of them (Arial, Calibri, or Roboto) for a single cell. The screen background contains a static picture (no Slideshow) from the Pinnula Dynamic Theme (background management, last version) installed from the Microsoft Store.

✔️ Expected Behavior

Such things shouldn't be happening. It gives me the creeps and sometimes a heart attack. But I like the PowerToys so much, I don't want to uninstall it. The ones I use the most are (in this order):

  1. Text Extractor: a lot, but with limited capability of Microsoft OCR Packs (please give me my Tesseract) - ORP files, two installed: English and Portuguese - both are just... fair;
  2. PowerRename: powerful, despite I hate REGEX with all my guts - I do NOT care what Chomsky said about it - I consider this "language" as LASHEMO (LAzy SHorthand for English MOnoglots). Down with ASCII and its keyboards - welcome UNICODE! Long live the REPUBLICA and the Excel functions, the world's only translatable computer language, but the MS ORPs can't recognize those functions as a text to be OCRed - go figure. I would use an 'extended' MS-DOS BATCH language mixed with some old BASIC string functions and maybe some well-known Excel string functions, but that is me. No need to change - but some numbering (01, 02, ...) or alphabetic itemization (a., b., ...) without using REGEX I think it is necessary;
  3. Color Picker: nice - a loveable one. It needs a few more features to become perfect, such as optional picker areas larger than a single pixel - I suggest 8-around-1 and 16-around-9 - and a few more standard color libraries such as Munsell for painting, the European/German RAL mainly used in varnish, powder coating, and plastics, and the IEC 60062:2016 RKM code for electronic components. The world was not made for software developers only, you know.
  4. Shortcut Guide: it is OK, but why is it limited to [WIN] key's functions only on a single screen? Why combinations aren't available while the Shortcut Guide is ON the screen? Such as, after the Shortcut Guide shows, press [SHIFT] and all [SHIFT]+[WIN] functions appear, press [ALT] and all [ALT]+[WIN] functions show up, press [CTRL] and we have all [CTRL]+[WIN] functions on the screen, and so on - but the thing vanishes with any key pressed or any mouse click.

Is there any Browser Selector (by link, domain, or user's choice) in your roadmap? Or is it against THE company's policy?

Am I asking too much? I appreciate your work, but you guys opened Pandora's box - it was full of users' wishes.

❌ Actual Behavior

Thank God the computer didn't freeze this time, but it already happened once this year. I didn't lose the work - I continued to work on the Excel spreadsheet. No other app was closed - however, I had to restart Excel since its visual elements and components, such as buttons, menus, bars, and a few others, went black or empty (with their background color only).

Thanks for your excellent work, and best regards.

Other Software

No response

jaimecbernardo commented 7 months ago

[2024-02-01 00:10:25.7737] [FATAL]

Exception

System.Runtime.InteropServices.COMException: {Desktop composition is disabled} The operation could not be completed because desktop composition is disabled. (0x80263001)
   Source: PresentationFramework
   TargetAssembly: PresentationFramework, Version=8.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
   TargetModule: PresentationFramework.dll
   TargetSite: Void DwmExtendFrameIntoClientArea(IntPtr, Standard.MARGINS ByRef)
   at Standard.NativeMethods.DwmExtendFrameIntoClientArea(IntPtr hwnd, MARGINS& pMarInset)
   at System.Windows.Shell.WindowChromeWorker._ExtendGlassFrame()
   at System.Windows.Shell.WindowChromeWorker._UpdateFrameState(Boolean force)
   at System.Windows.Shell.WindowChromeWorker._HandleDwmCompositionChanged(WM uMsg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   at System.Windows.Shell.WindowChromeWorker._WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   at System.Windows.Interop.HwndSource.PublicHooksFilterMessage(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
   at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)

Environment

davidegiacometti commented 7 months ago

This is a duplicate of #30507

gokcekantarci commented 7 months ago

/needinfo

Hi, Desktop composition should always be enabled. https://learn.microsoft.com/en-us/windows/win32/dwm/wm-dwmcompositionchanged

I tried to force PTRun with some benchmark and stress tests but I couldnt reproduce it. Can you share your machine specs to check and compare?

I also found same issues in other apps too. https://forums.bohemia.net/forums/topic/217460-computer-keep-crashing-and-here-is-the-log-error-can-someone-help/ https://itecnote.com/tecnote/c-desktop-composition-is-disabled-error/

Does this issue still persist? If so, please share the Task Manager screenshot with GPU priority and /bugreport to check PTRun settings you have.

Also please update your graphics card driver and try again.

Thanks,

AlexDeMoura commented 7 months ago

ok, 3.8 MB of XML to read. Gmail blocked the attachment for security reasons - it doesn't like ZIP files - I need to upload it to Google Drive and send the link to you. Sorry, I supposed this Bug Report was automatically sent to you. Anyway, here they are:

Just wait.

On Mon, Feb 5, 2024 at 12:32 PM microsoft-github-policy-service[bot] < @.***> wrote:

Hi there!

We need a bit more information to really debug this issue. Can you add a "Report Bug" zip file here? You right click on our system tray icon and just go to report bug. Then drag the zipfile from your desktop onto the GitHub comment box in this issue. Thanks! [image: Report Bug] https://user-images.githubusercontent.com/11349917/133042052-4975be21-4699-4363-83c9-a8e1869d079d.png

— Reply to this email directly, view it on GitHub https://github.com/microsoft/PowerToys/issues/31226#issuecomment-1927266988, or unsubscribe https://github.com/notifications/unsubscribe-auth/A2QPHYDKNTGLOMNYVS5PYR3YSD3QPAVCNFSM6AAAAABCUJLKO6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSMRXGI3DMOJYHA . You are receiving this because you authored the thread.Message ID: @.***>

AlexDeMoura commented 7 months ago

ok dokey, here we go... I am sending two of them, just in case

PowerToysReport_2024-02-05-15-10-42.zip https://drive.google.com/file/d/1FmL4ZqPAS-NZUxRJB4yxdqzJd1bhB1rm/view?usp=drive_web

PowerToysReport_2024-02-05-15-02-11.zip https://drive.google.com/file/d/1Lb8Z6lxR5oRU4rRgckEyDlZDlF3Fy2B3/view?usp=drive_web

On Mon, Feb 5, 2024 at 3:23 PM Alex de Moura @.***> wrote:

ok, 3.8 MB of XML to read. Gmail blocked the attachment for security reasons - it doesn't like ZIP files - I need to upload it to Google Drive and send the link to you. Sorry, I supposed this Bug Report was automatically sent to you. Anyway, here they are:

Just wait.

On Mon, Feb 5, 2024 at 12:32 PM microsoft-github-policy-service[bot] < @.***> wrote:

Hi there!

We need a bit more information to really debug this issue. Can you add a "Report Bug" zip file here? You right click on our system tray icon and just go to report bug. Then drag the zipfile from your desktop onto the GitHub comment box in this issue. Thanks! [image: Report Bug] https://user-images.githubusercontent.com/11349917/133042052-4975be21-4699-4363-83c9-a8e1869d079d.png

— Reply to this email directly, view it on GitHub https://github.com/microsoft/PowerToys/issues/31226#issuecomment-1927266988, or unsubscribe https://github.com/notifications/unsubscribe-auth/A2QPHYDKNTGLOMNYVS5PYR3YSD3QPAVCNFSM6AAAAABCUJLKO6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSMRXGI3DMOJYHA . You are receiving this because you authored the thread.Message ID: @.***>

Jay-o-Way commented 7 months ago

Please update issue title to be more specific? :)

AlexDeMoura commented 7 months ago

I can't. This is the only message that PowerToys left. I copied the message from the PowerToys error notification and pasted it as a title, I have no idea what it could be to be more specific. As explained in the details it was just 1 to 2 seconds flickering/dark screen and then the PT error, nothing else. All other open apps were still running, and Excel (a more sensitive one) had some visual elements missing. I restarted the Excel and continued to work as before.

On Tue, Feb 6, 2024 at 10:56 AM Jay @.***> wrote:

Please update issue title to be more specific? :)

— Reply to this email directly, view it on GitHub https://github.com/microsoft/PowerToys/issues/31226#issuecomment-1929715877, or unsubscribe https://github.com/notifications/unsubscribe-auth/A2QPHYGHBBY7OSKNOH33CDDYSIZCVAVCNFSM6AAAAABCUJLKO6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSMRZG4YTKOBXG4 . You are receiving this because you authored the thread.Message ID: @.***>

Jay-o-Way commented 7 months ago

That's okay. Maybe one of the core people can :⁠-⁠)

Frooastside commented 7 months ago

I have the same issue and it happened while installing a new Graphics Driver for my Intel Arc A770, maybe his graphics card that is not active still got some update or something like that

chryscrz commented 7 months ago

Hello had the same error message regarding desktop composition:

Version: 0.77.0.0 OS Version: Microsoft Windows NT 10.0.22631.0 IntPtr Length: 8 x64: True Date: 2/16/2024 10:28:43 Exception: System.Runtime.InteropServices.COMException (0x80263001): {Desktop composition is disabled} The operation could not be completed because desktop composition is disabled. (0x80263001) at Standard.NativeMethods.DwmExtendFrameIntoClientArea(IntPtr hwnd, MARGINS& pMarInset) at System.Windows.Shell.WindowChromeWorker._ExtendGlassFrame() at System.Windows.Shell.WindowChromeWorker._UpdateFrameState(Boolean force) at System.Windows.Shell.WindowChromeWorker._HandleDwmCompositionChanged(WM uMsg, IntPtr wParam, IntPtr lParam, Boolean& handled) at System.Windows.Shell.WindowChromeWorker._WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled) at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled) at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs) at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)

Happened while switching screens from HDMI to internal on my laptop (Ryzen CPU, AMD graphics). Apparently the video driver crashed (timed-out) as well.

frareinif commented 6 months ago

Same here while installing another app...

2024-02-21.txt

johanneskonst commented 6 months ago

Adding another:

Version: 0.78.0.0
OS Version: Microsoft Windows NT 10.0.22621.0
IntPtr Length: 8
x64: True
Date: 22-2-2024 10:07:07
Exception:
System.Runtime.InteropServices.COMException (0x80263001): {Bureaubladsamenstelling is uitgeschakeld} De bewerking kan niet worden voltooid omdat bureaubladsamenstelling is uitgeschakeld. (0x80263001)
   at Standard.NativeMethods.DwmExtendFrameIntoClientArea(IntPtr hwnd, MARGINS& pMarInset)
   at System.Windows.Shell.WindowChromeWorker._ExtendGlassFrame()
   at System.Windows.Shell.WindowChromeWorker._UpdateFrameState(Boolean force)
   at System.Windows.Shell.WindowChromeWorker._HandleDwmCompositionChanged(WM uMsg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   at System.Windows.Shell.WindowChromeWorker._WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   at System.Windows.Interop.HwndSource.PublicHooksFilterMessage(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
   at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)

I've had these black screens before, my first thought was that the New Teams client was somehow crashing my videodriver but come to think of it I did install PT around the same time so it might have been PT all along...

I'm running Windows 11 enterprise on a Elitebook 655 G9 with Ryzen 5 5625U

2024-02-22.txt

printableaccounting commented 6 months ago

I opened a different ticket and they said my issue is a duplication of this one.

My screen goes black for a few seconds when I'm trying to type - I type pretty fast, and it doesn't happen all the time, but it has happened when typing in Outlook, Chrome, and Word.

Is there any fix for this -- specifically in lamens terms for people who don't know what the heck all this jargon is or how to do special stuff with the computer? I just want to be able to use my laptop without it going black simply for typing.

FMKerckhof commented 6 months ago

I also experience this issue consistently when my connected screen layout changes (going from home office to work). After waking from hibernate/sleep, as soon as I connect my dock at work screens go black intermittently and PT crashes with the error messages shown above. I am running window 10 enterprise on a Dell Precision 7540 with a Xeon E-2286M processor, 96GB of RAM and an NVIDIA Quadro T1000. The dock I am using is a Dell WD19DCS. Below I include the error message, as well as the logs:

Version: 0.78.0.0
OS Version: Microsoft Windows NT 10.0.19045.0
IntPtr Length: 8
x64: True
Date: 27/02/2024 8:58:19
Exception:
System.Runtime.InteropServices.COMException (0x80263001): {Desktop composition is disabled} The operation could not be completed because desktop composition is disabled. (0x80263001)
   at Standard.NativeMethods.DwmExtendFrameIntoClientArea(IntPtr hwnd, MARGINS& pMarInset)
   at System.Windows.Shell.WindowChromeWorker._ExtendGlassFrame()
   at System.Windows.Shell.WindowChromeWorker._UpdateFrameState(Boolean force)
   at System.Windows.Shell.WindowChromeWorker._HandleDwmCompositionChanged(WM uMsg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   at System.Windows.Shell.WindowChromeWorker._WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   at System.Windows.Interop.HwndSource.PublicHooksFilterMessage(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
   at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)

2024-02-27.txt

johanneskonst commented 6 months ago

Is there any fix for this -- specifically in lamens terms for people who don't know what the heck all this jargon is or how to do special stuff with the computer? I just want to be able to use my laptop without it going black simply for typing.

only "fix" so far (for me) is to disable PT run, after doing that I (think I) have no issues.

AlexDeMoura commented 6 months ago

can't see this one in the thread.

On Tue, Mar 19, 2024 at 3:22 AM DustyNight @.***> wrote:

I have the same issue recently. Since this issue happened on a PC provided by my company, I can't share any log or screenshot for security reasons. Besides screen flickering between black and normal, I found that occupied RAM is in an abnormally high number, like 85 to 90%. Normally I keep 20+ chrome tabs and 4+ Intellij IDEA projects opening, on a PC with 32G RAM, and the average occupied RAM would be no more than 60% averagely. After disable PowerToys Run, everything is back to normal and steady.

— Reply to this email directly, view it on GitHub https://github.com/microsoft/PowerToys/issues/31226#issuecomment-2005890621, or unsubscribe https://github.com/notifications/unsubscribe-auth/A2QPHYGLK2H4ZCI2UJG4LEDYY7KQTAVCNFSM6AAAAABCUJLKO6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAMBVHA4TANRSGE . You are receiving this because you authored the thread.Message ID: @.***>

DustyNight commented 6 months ago

can't see this one in the thread. On Tue, Mar 19, 2024 at 3:22 AM DustyNight @.> wrote: I have the same issue recently. Since this issue happened on a PC provided by my company, I can't share any log or screenshot for security reasons. Besides screen flickering between black and normal, I found that occupied RAM is in an abnormally high number, like 85 to 90%. Normally I keep 20+ chrome tabs and 4+ Intellij IDEA projects opening, on a PC with 32G RAM, and the average occupied RAM would be no more than 60% averagely. After disable PowerToys Run, everything is back to normal and steady. — Reply to this email directly, view it on GitHub <#31226 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/A2QPHYGLK2H4ZCI2UJG4LEDYY7KQTAVCNFSM6AAAAABCUJLKO6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAMBVHA4TANRSGE . You are receiving this because you authored the thread.Message ID: @.>

After replying I found that the information may be misleading so I just deleted it. Maybe I should just reply to it for clarification. Sorry about that.

jakubsturc-thermofisher commented 5 months ago

The same issue here. I was running 0.77 version.

AlexDeMoura commented 3 months ago

Guys, sorry for the inconvenience. Yesterday the PowerToys finally reached update 0.81, a version that, at least, I was waiting for with some anxiety. I read the 'What's new' carefully, and in addition to a new utility and several improvements, it seems that the topics covered refer more to version 0.80 bug fixes.

The 'crash issue' reported in this thread (#31226) is on the 0.81 'To Do' list, but I can't say it has been completely resolved - I believe it requires a more complex solution - or set of solutions.

Is there any expected date or version for solution #31226? And if so, update the 'To Do'. Please let us know if any more information can be provided to help find a solution. I trust in your ability to resolve this issue once and for all. Many thanks.

adrianflutur commented 1 month ago

Same problem here, version 0.80.1. I will update to the latest version and see if it happens again.

The scenario which ended up with this error was like this: I was watching a video of a specific game on its Steam page using a google chrome browser. After a few seconds explorer.exe was frozen, then got a black screen for a few seconds, then back to normal with the PowerToys Run error dialog showing. Hope this helps.

Error:

Title: PowerToys Run ran into an issue

Version: 0.80.1.0
OS Version: Microsoft Windows NT 10.0.22631.0
IntPtr Length: 8
x64: True
Date: 7/21/2024 1:33:53 AM
Exception:
System.Runtime.InteropServices.COMException (0x80263001): {Desktop composition is disabled} The operation could not be completed because desktop composition is disabled. (0x80263001)
   at Standard.NativeMethods.DwmExtendFrameIntoClientArea(IntPtr hwnd, MARGINS& pMarInset)
   at System.Windows.Shell.WindowChromeWorker._ExtendGlassFrame()
   at System.Windows.Shell.WindowChromeWorker._UpdateFrameState(Boolean force)
   at System.Windows.Shell.WindowChromeWorker._HandleDwmCompositionChanged(WM uMsg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   at System.Windows.Shell.WindowChromeWorker._WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   at System.Windows.Interop.HwndSource.PublicHooksFilterMessage(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
   at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)
hangy commented 1 month ago

I get this error regularly - currently with v0.79.0.0. I can't reproduce it without failure, but when it happens, it's always when PowerToys are running in my VMware Horizon VDI, and I connect to the VDI from a PC with a different screen layout than the previous one. Sometimes, it also happens when I change screen layout in the VMware Horizon client. I suspect this might suspend/restart Desktop composition temporarily?