Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Distraction Dimmer - Haze Over / dim all but #13035

Open
YoussefRaafatNasry opened this issue Sep 4, 2021 · 43 comments
Open

Distraction Dimmer - Haze Over / dim all but #13035

YoussefRaafatNasry opened this issue Sep 4, 2021 · 43 comments
Labels
Idea-New PowerToy Suggestion for a PowerToy

Comments

@YoussefRaafatNasry
Copy link

YoussefRaafatNasry commented Sep 4, 2021

Description of the new feature / enhancement

A tool like HazeOver to dim inactive windows, to help reduce distraction and increase focus.

Example

Scenario when this would be used?

  • Workflow with a lot of context-switching, like switching back and forth between terminal and code editor.
  • Big screens, where you have multiple windows opened at the same time.
  • Presentations and screen casts.

Supporting information

I found a windows alternative called LeDimmer, but it's abandoned and not open-source. It also lacks a lot of options.

@YoussefRaafatNasry YoussefRaafatNasry added the Needs-Triage For issues raised to be triaged and prioritized by internal Microsoft teams label Sep 4, 2021
@Aaron-Junker Aaron-Junker added the Idea-New PowerToy Suggestion for a PowerToy label Sep 5, 2021
@crutchcorn
Copy link

I'm interested in contributing this tool to the project and would be happy to champion development on it. I'm currently doing some exploratory looks into what APIs we'd use for this

@franky920920
Copy link
Contributor

I'm interested in contributing this tool to the project and would be happy to champion development on it. I'm currently doing some exploratory looks into what APIs we'd use for this

If you would like to contribute to PowerToys, we can discuss it here and you can start working on this :)

cc: @crutkas

@crutchcorn
Copy link

crutchcorn commented Nov 18, 2021

Some initial thoughts, as I'm unfamiliar with what hooks Windows might have to achieve this:

  1. Do we simply get the window borders and draw around them to create a dimming effect? Will this be performant enough on low-powered devices to create a good experience?
  2. Alternatively, how does Windows handle drawing in terms of layering. Like, is there a z-index equivalent on Windows that would let me draw n-1 overlay to create the effect?
  3. It seems like this repo has split C# and CPP code - Does the PowerToys folks have preference one way or the other? I was leaning CPP, simply because FancyZones seems to be using it, and I suspect some codesharing might be able to occur there EDIT: Apologies, it seems to be pretty clearly in favor of CPP per the style guide

Something I wanna test: I want to make sure multi-monitor support is handled OOTB - since this is a big part of the feature for me

@Aaron-Junker
Copy link
Collaborator

Some initial thoughts, as I'm unfamiliar with what hooks Windows might have to achieve this:

  1. Do we simply get the window borders and draw around them to create a dimming effect? Will this be performant enough on low-powered devices to create a good experience?
  2. Alternatively, how does Windows handle drawing in terms of layering. Like, is there a z-index equivalent on Windows that would let me draw n-1 overlay to create the effect?
  3. It seems like this repo has split C# and CPP code - Does the PowerToys folks have preference one way or the other? I was leaning CPP, simply because FancyZones seems to be using it, and I suspect some codesharing might be able to occur there EDIT: Apologies, it seems to be pretty clearly in favor of CPP per the style guide

Something I wanna test: I want to make sure multi-monitor support is handled OOTB - since this is a big part of the feature for me

@crutchcorn I saw you started working on this. I will add the in progress label for you, if this is ok.

@Aaron-Junker Aaron-Junker added the Status-In progress This issue or work-item is under development label Nov 18, 2021
@crutkas
Copy link
Member

crutkas commented Nov 18, 2021

This is actually #9496

@crutkas
Copy link
Member

crutkas commented Nov 18, 2021

but lets move that here as this has more info.

@crutkas crutkas removed the Needs-Triage For issues raised to be triaged and prioritized by internal Microsoft teams label Nov 18, 2021
@crutkas
Copy link
Member

crutkas commented Nov 18, 2021

I would suggest creating a POC that is outside powertoys itself so we can test that directly. From there we can talk about implementation back in. Trust me on so many levels this will be easier :)

Pick either C++ or C#

@Aaron-Junker
Copy link
Collaborator

So there are some questions which need clarification:

  1. Do we need a specifiaction for this?
  2. This doesn't seem to fit really in the existing utilities. But I think it's also to small dor a own utility. Any ideas on this?
  3. Personally I think this would be a good feature for the focus sessions in the new Windows 11 clock app. Should we still integrate it?

cc: @dedavis6797 @crutkas

@crutkas crutkas changed the title [Feature Request] Distraction Dimmer Distraction Dimmer - HazeOver / dim all but Nov 18, 2021
@crutkas
Copy link
Member

crutkas commented Nov 18, 2021

  1. Make this a different app.
  2. Lets not over think this.
  3. Honestly i think this can just a be a c# app.
  4. We can refactor code as needed.
  5. POC first, integrations later. I don't know what types of hooks the clock app has for integration. I think integration would be nice but lets do a Minimal lovable product

Here is what i'm thinking: @crutchcorn what are your thoughts?

  1. hot key activate when a window is in focus
  2. underlay is invoked.
  3. underlay has color + transparency setting.
    1. would be nice to add mica / acrylic later
  4. Right clicking / double clicking on underlay dismisses it.
  5. Alt-Tab dismisses underlay
  6. game mode can't be activated

@crutchcorn
Copy link

Sounds good. I'll try to make it with C# and just do some experimentation. I tried to start with a PowerToys instance, and couldn't even get main or stable building on my end after 3hrs of attempts (I'm not great w/ C# or CPP Windows build tooling, so that's prob on me) so this works out well

Yeah, that makes sense. Ideally, we also have the ability to toggle it on/off from a tray icon as well - although I don't know any other PowerToy that does this

I don't agree about the underlay dismissing it or alt-tab dismissing it entirely, however (at least not without settings).

For example, I do technical content writing and use HazeOver on my laptop to help me focus on writing when I need it. However, I also want to focus on research and quickly switch between the two. It helps a fair bit with my ADHD when I need to go full heads down mode but still need to multitask.

Disabling game mode makes sense to me - although I think that will be a post-POC feature.

@crutkas
Copy link
Member

crutkas commented Nov 18, 2021

PowerToys itself is a hub and spoke model, every feature is actually a different item and everything reports back to runner / settings but even then, everything is designed to be self contained.

I think once we have something to play with, we can make some further design choices like you said. Some of these were guessing how i may want it to work.

Part of me thinks maybe the alt-tab we may want as a setting but yeah, lets test out a POC like we have with Always on top and the find my mouse recently to see what may need to be refined to hit minimal lovable :)

@crutkas
Copy link
Member

crutkas commented Dec 7, 2021

@crutchcorn how is it going! would love to see what insanity you whipped up

@shayne
Copy link

shayne commented Dec 29, 2021

Wanted to see this happen so I wrote PowerDimmer, a first attempt.

Be nice as I know next to nothing about developing .NET/Win32/etc... Got it working and using it, though! 😄

https://github.com/shayne/PowerDimmer

@crutchcorn
Copy link

@shayne is it possible this repo is private? It 404s for me

@crutkas I admittedly haven't yet given it a stab. I was planning on doing so this week, but it seems like @shayne possibly has a strong start. I'm hoping I can help a bit when I can take a look at it :)

@shayne
Copy link

shayne commented Dec 29, 2021

Woops! Yeah, public now.

@crutkas
Copy link
Member

crutkas commented Dec 29, 2021

I will take a look tomorrow!

@crutchcorn
Copy link

crutchcorn commented Dec 29, 2021

It works well! (although does have a bug or two I noticed - but the core is definitely there!)

@shayne - is it okay if I submit bug reports and/or PRs to the GH repo? Or would you like me to hold off for now until @crutkas has a chance to look through the code?

@crutkas
Copy link
Member

crutkas commented Jul 18, 2022

@shayne on multiple launches, it fails to run, i like it however.

  1. I think adding the chance for an acrylic / mica underlay would be baller too
  2. Another quirk is elevated apps when it isn't

Both livable

@shayne
Copy link

shayne commented Jul 19, 2022

@crutkas curious about the launch failures. I do know it doesn't handle conflicting global keybinds gracefully.

I do use it daily, however I find with Windows 11 I have to restart it to get it to properly layer. It's like the "dim windows" stop ordering correctly.

Any direction would be greatly appreciated.

@crutkas
Copy link
Member

crutkas commented Jul 19, 2022

@shayne it crashes on 2nd launch for me on

            settings = new ConfigurationBuilder<ISettings>().UseJsonFile("settings.json").Build();
            settings.DimmingEnabled = settings.ActiveOnLaunch;

System.IO.IOException: 'Unable to move the replacement file to the file to be replaced. The file to be replaced has retained its original name.'

@davidegiacometti
Copy link
Collaborator

@shayne nice job 😃

I gave it a try and I am also experiencing System.IO.IOException: 'Unable to move the replacement file to the file to be replaced. The file to be replaced has retained its original name.' on 2nd launch that looks related to Config.Net nuget package.
On first launch I am randomly experiencing An unhandled exception of type 'System.ExecutionEngineException' occurred in WindowsBase.dll after a few minutes of usage. I have been able to fix the crash converting the Win32.WinEventDelegate to a field.
https://github.com/shayne/PowerDimmer/blob/5f1b63ecc359f911159f364e6a8c7211decbe52b/App.xaml.cs#L84

Reference: https://stackoverflow.com/a/56774612

@jlcd
Copy link

jlcd commented Jun 14, 2023

How is this feature coming along? I noticed @shayne's PowerDimmer repo is a couple years without any improvements, so I assume it is still a PoC?

@shayne
Copy link

shayne commented Jun 24, 2023

I use it daily and works for me. Unfortunately, I don't have the bandwidth to bring it into PowerToys.

@ca-boh
Copy link

ca-boh commented Aug 15, 2023

One more vote for this! Absolutely needed for focused work.

@viznaut
Copy link

viznaut commented Sep 5, 2023

would love to see this as well

@ca-boh
Copy link

ca-boh commented Sep 5, 2023

These guys just release "Crop & Lock" in v0.73. Interesting feature, but really doesn't help much with focus...

...if you are interested, I found CinemaDrape actually does what we need (or something very close to it).

@crutkas crutkas changed the title Distraction Dimmer - HazeOver / dim all but Distraction Dimmer - Haze Over / dim all but Sep 23, 2023
@TheJoeFin TheJoeFin mentioned this issue Jan 23, 2024
@cylkee
Copy link

cylkee commented Feb 22, 2024

I'm seeing a lot of 'dim screen' feature requests being duped and referred here, so rather than create a new feature request, I'd like to request an extension of the feature described in this thread please.

Sometimes I find that my screen is just way too bright in some dark situations. I don't want to or cannot turn on another light source to counter-balance the situation, so instead I try to dim my screen, but my graphics driver or Windows will only dim it so far. Pitifully so. Dark Mode at the OS or application level is not a solution either - I find its support is patchy. So instead I use colour inversion in dark settings, in Ease of Access > Colour filters. This is good for me, but even then some elements of the screen (text, UI) can be too bright as to be piercing my eyeballs. My device has a pretty good screen, not gonna lie.

So I'm looking for a Super Dim or Ultra Dim app, and I'm hoping it can graduate to the suite of PowerToys.

I imagine it's just a black layer with an opacity setting (I work with CSS, so that's where my thinking comes from). A dark translucent filter layer that covers the entire screen at the touch of a key combo.

I'd also like the option for this filter to be a light (as in white) filter too (remember I talked about colour inversion).

Loving your work with PowerToys, thank you.

This was referenced May 10, 2024
@wooonotcool
Copy link

Hello! The dimming feature is super helpful for me especially with the OLED Display of my laptop. Right now, I am using the LeDimmer because the PowerDimmer does not work on my system and in my opinion, adding this feature in PowerToys is a very great idea. I have been using PowerToys for years and it helped me in being productive. Looking forward in new features PowerToys!

@MarcinOrlowski
Copy link

MarcinOrlowski commented May 15, 2024

Since ticket still opened: PowerDimmer mentioned already works perfectly fine for me on Win11 if one bothers their repo being not too active.

@Sugaroverdose
Copy link

Sugaroverdose commented May 15, 2024

Since ticket still opened: PowerDimmer mentioned already works perfectly fine for me on Win11 if one bothers their repo being not too active.

For me it crashed silently a lot, this fork is working pretty much perfectly, but you have to build it yourself

UPD: updated url to specific branch

@shayne
Copy link

shayne commented May 15, 2024

If they send me a PR I'd be happy to merge it. 🤷‍♂️

@Sugaroverdose
Copy link

If they send me a PR I'd be happy to merge it. 🤷‍♂️

Author of those fork isn't active for two years, i'm pretty sure that it's completely forgotten

@alaseridan
Copy link

Someone reached out to me about my PowerDimmer fork... Yep, I totally forgot about it!
I just opened a PR that fixes the silent crashes and added dimming/shades to windows and selected areas of windows.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Idea-New PowerToy Suggestion for a PowerToy
Projects
Status: No status
Development

No branches or pull requests