How to reduce the dimming effect behind GNOME Shell dialogs

Ubuntu Version

Ubuntu 26.04 LTS

Desktop Environment (if applicable)

GNOME

Problem Description

When clicking on synaptic package manager icon from top panel and requested to enter password in the displayed window, the surroundings of that window become dark. The same happens when trying to log out. This has been bothering me for many years, since, when typing password I didn’t know which language was the selected one, since it becomes completely unseen due to the surrounding darkness.

Relevant System Information

Ubuntu 26.04 with an old TFT monitor. This is not so obvious using a laptop though.

Error Messages / Logs

What I’ve Tried

I used chatgpt in order to create an extention that will increase the brightness around the windows in question. I’m giving you here the code.

→ The code provided herein is working in my system: both under 26.04 and 26.10 beta.

I had tried -in between- solutions proposed -about changing files of- gnome shell and gtk css files, yet to no avail. [The code below should work in one’s system.]

  1. Contents for metadata.json file:
    {
    “uuid”: “lightbox-dimmer@local”,
    “name”: “Lightbox Dimmer”,
    “description”: “Reduces GNOME Shell modal dialog background dimming”,
    “version”: 1,
    “shell-version”: [“50”]
    }

  2. Contents for extension.js file:
    import Clutter from ‘gi://Clutter’;
    import {Extension} from ‘resource:///org/gnome/shell/extensions/extension.js’;
    import * as Lightbox from ‘resource:///org/gnome/shell/ui/lightbox.js’;

const VIGNETTE_BRIGHTNESS = 1.8;

export default class LightboxDimmerExtension extends Extension {
enable() {
this._originalLightOn = Lightbox.Lightbox.prototype.lightOn;

    Lightbox.Lightbox.prototype.lightOn = function (fadeInTime) {
        this.remove_all_transitions();

        const easeProps = {
            duration: fadeInTime || 0,
            mode: Clutter.AnimationMode.EASE_OUT_QUAD,
        };

        const onComplete = () => {
            this._active = true;
            this.notify('active');
        };

        this.show();

        if (this._radialEffect) {
            this.ease_property(
                '@effects.radial.brightness',
                VIGNETTE_BRIGHTNESS,
                easeProps
            );

            this.ease_property(
                '@effects.radial.sharpness',
                0.7,
                {onComplete, ...easeProps}
            );
        } else {
            this.ease({
                ...easeProps,
                opacity: 255 * this._fadeFactor,
                onComplete,
            });
        }
    };
}

disable() {
    if (this._originalLightOn)
        Lightbox.Lightbox.prototype.lightOn = this._originalLightOn;

    this._originalLightOn = null;
}

}

Regards!

I read your extension and checked it against the GNOME Shell source, and I think I can tell you exactly why it did nothing.

What your patch does

You replaced Lightbox.Lightbox.prototype.lightOn with a version that eases @effects.radial.brightness to 1.8 instead of the stock 0.5.

Why it has no visible effect

The brightness property is a GObject.ParamSpec.float with a range of 0 to 1:

// js/ui/lightbox.js
'brightness': GObject.ParamSpec.float(
    'brightness', null, null,
    GObject.ParamFlags.READWRITE,
    0, 1, 1),        // ← minimum, maximum, default

GObject clamps values written to a property into that range, so your 1.8 becomes 1.0.

Here is the second half of it. lightOff() also eases brightness — back to 1.0, which means “no dimming at all”. So by the time your lightOn runs, the current value is already 1.0, and your target (after clamping) is also 1.0.

An ease from 1.0 to 1.0 has nothing to animate, so Clutter skips it. Your override runs, but nothing changes on screen. That is why the surrounding darkness looks completely unaffected.

How the dimming actually works

The radial effect is a fragment shader. The relevant line is:

cogl_color_out.a *= 1.0 - pixel_brightness * brightness;

Higher brightness → lower alpha → less dimming. The default of 0.5 blocks about half the light at the center of the vignette. So to make it lighter you want a value above 0.5, and the ceiling is 1.0, which is no dimming at all.

What to change

In your extension.js, replace the constant:

const VIGNETTE_BRIGHTNESS = 1.8;   // clamped to 1.0, then no-op

with

const VIGNETTE_BRIGHTNESS = 0.8;   // 80% of the background visible

0.8 leaves a 20% dim while still showing the keyboard layout through it. If you want the dim gone entirely, use 1.0 — but then you also lose the visual cue that the dialog is modal.

What I checked, and what I did not

  • Checked against GNOME Shell 50.1, which is what Ubuntu 26.04 ships (gnome-shell 50.1-0ubuntu1). The constants and the ParamSpec range are identical on the 48 branch as well.
  • Your shell-version: ["50"] is correct for 26.04, so the extension is loading. The problem is the clamped value, not installation.
  • I verified the source in js/ui/lightbox.js and js/ui/modalDialog.js (that is where radialEffect: true is set for modal dialogs). I did not run your extension on a live 26.04 session — the clamping behaviour and the shader math are from reading the source, so please treat the suggested value as a starting point to adjust by eye.

The dconf/gtk css route you also tried was the wrong tree: this dimming is not a theme property, it is a Clutter shader effect applied in the compositor, so no GTK or shell theme can touch it.

1 Like

Hello,

thank you very much for your thorough response! The thing is that I might not have phrased it correctly, yet the code that I have posted above is working really fine for my system. That’s why I have the title: how to…

I had doubts increasing the value beyond 1, yet I was able to observe that indeed in my system it had a difference (I tried the values 1.2 and 1.8 if I recall correctly), which indeed had a difference.

This has been bothering me from the advent of gnome shell and the removal of desktop icons from gnome flashback. In gnome flashback, even today, there isn’t any change in brightness when clicking for synaptic or similar applications which require to provide your password, which in turn it doesn’t obscure the top panel where the language selection icon is placed. There were numerous times that I was choosing synaptic just to press escape and see that I had chosen the wrong language for password.

This extension worked both under 26.04 and it is still working under 26.10 beta that I’m using right now. Of course I have added in metadata file version 51.

I will change that in the OP, so as to make it clearer.

Regards!

This is not a matter of phrasing.

You opened your post in the support and help category which is normally used for asking community support questions and asking for help, so people indeed read your post as that :wink:

I guess it should be moved to the tips and tricks section in the lounge instead.

Happy it works for you, that’s the part that actually matters.

I need to correct something I said though. I claimed GObject clamps your 1.8 down to 1.0. I read glib’s gobject.c after your reply and that’s not what happens. When a float lands outside the ParamSpec range it calls g_param_value_validate, which does clamp it, but if the value changed and the param isn’t G_PARAM_LAX_VALIDATION (yours is plain READWRITE, so it isn’t) the value gets thrown out entirely and a g_critical is logged instead. The property keeps whatever it had.

So 1.8 doesn’t become 1.0. It never gets applied.

Which makes me want to ask you something, since you can settle this and I can’t. You said 1.2 and 1.8 looked different. If both are being thrown out they’d fall back to the same value and look identical, so if they really differed, the values are getting through and my reading is wrong.

Next time the dim is up:

journalctl -b /usr/bin/gnome-shell | grep -i "out of range"

Nothing there means I’m wrong and your extension does what you think. A hit means 1.2 and 1.8 were both dropped and you’re seeing the fallback against the stock 0.5. Still a real improvement, just not tunable above 1.0.

One more thing I should say: the wording in this reply was written with AI assistance. The investigation is mine, I read glib’s gobject.c and gnome-shell’s lightbox.js myself and the source lines I quote above are from those files. The phrasing is not all mine.

Sorry for not saying that sooner.

Hello,

nice to know. All the time I was using the “support and help” adding in front the phrase how to. Now I will know and in case I create similar threads I will add them there.

Regards!

1 Like

Hello,

attached please find a screenshot that shows exactly what I have mentioned before: The left hand side, which is brighter, has a value of 1.8, whereas the right hand side, which is darker, has a value of 1.2. What it bothered me was the -en-, part, which, if the value left was the default one, that part of the screen was unrecognizable. Now it is not!

edit: reversed values in order to correspond to the correct screenshot:

→ the greater the value, the brighter (less dark) the image

Now, if I understand correctly you want me to issue the command:
journalctl -b /usr/bin/gnome-shell | grep -i “out of range”

The result was null, nothing.

It is not a matter of right or wrong. Thank you for your time and sorry for the misunderstanding I caused without making at least clear in text, that this thread was a how to one and not one asking for help.

I hope that it helps someone that was/is facing the same issue as me. The screenshots are from ubuntu 26.10 beta, updated just a couple of days ago.

Regards!

That screenshot settles it — 1.2 and 1.8 clearly look different, and an empty grep means my reading of g_param_value_validate was wrong. Your values really are getting through, so 1.8 is doing exactly what you wanted.

Glad it works, and thanks for coming back with the verification. That’s better evidence than I could have gotten from reading the source alone.

1 Like

This topic was automatically closed after 30 days. New replies are no longer allowed.