8000 Add support for gnome-shell 43 by jkitching · Pull Request #59 · F-i-f/soft-brightness · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Add support for gnome-shell 43 #59

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

Open
wants to merge 107 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
107 commits
Select commit Hold shift + click to select a range
abb110f
Add support for gnome-shell 43
jkitching Nov 21, 2022
0fffeda
Add support for GNOME 44
jkitching Apr 6, 2023
3f27fcc
Add GitHub action for building extension when pushing to master branch
jkitching Apr 6, 2023
d7493c0
Upload entire build directory as an artifact after building
jkitching Apr 6, 2023
07a0dcb
Bump upload-artifact@v2 to upload-artifact@v3
jkitching Apr 6, 2023
a9f7851
Update metadata.json URL to point to forked GitHub repo
jkitching Apr 6, 2023
f659031
Update meson build files for version 31 under different namespace
jkitching Apr 6, 2023
4ac5cda
Update Download/Install section of README to point to forked package
jkitching Apr 6, 2023
a671625
Update changelog to include version 31
jkitching Apr 6, 2023
e1af5dd
Change ScreenshotClass to access softBrightnessExtension via closure
jkitching Apr 9, 2023
7348eb0
Stop storing softBrightnessExtension as a global
jkitching Apr 9, 2023
de84fcc
Rename extension to add information about fork
jkitching Apr 9, 2023
8940194
Check for `backend` member of `global`
jkitching Apr 10, 2023
d689a54
Drop support for GNOME 3.33 and 3.35
jkitching Apr 10, 2023
81b58f8
Bump release to version 32
jkitching Apr 10, 2023
9b8f386
Remove link to travis-ci.org in README
jkitching Apr 20, 2023
273a9ff
Update README install section to reference v32 instead of v31
jkitching Apr 20, 2023
16e2be7
README: Comment out instructions for installing from extensions.gnome…
jkitching Apr 20, 2023
a7f3584
Rename project to soft-brightness-plus
jkitching Apr 20, 2023
3dc398f
Standardize on capitalization of extension name/title
jkitching Apr 20, 2023
a4d9fd7
Temporarily revert "Stop storing softBrightnessExtension as a global"
jkitching Apr 27, 2023
fe05f69
Revert "Change ScreenshotClass to access softBrightnessExtension via …
jkitching Apr 27, 2023
6aebb23
Access extension via class property on ScreenshotClass
jkitching Apr 27, 2023
d7f63dc
Revert 'Temporarily revert "Stop storing softBrightnessExtension as a…
jkitching Apr 27, 2023
1f220f2
Add missing semicolon at end of assignment
jkitching Apr 27, 2023
f2c8a0d
Modify formatting of apply/then chains
jkitching Apr 27, 2023
1e68bc8
Bump release to version 33
jkitching Apr 27, 2023
66147c8
Bump extension zip references to version 33
jkitching Apr 27, 2023
788e00a
Clarify reason for leaving extension active while on lock screen
jkitching Apr 28, 2023
6da563f
Update metadata.json to advertise that extension runs during unlock d…
jkitching Apr 30, 2023
b84e48f
Replace tabs with 8 spaces in JavaScript source files
jkitching Apr 29, 2023
f2fcce1
Standardize on using single quotes for string literals
jkitching Apr 29, 2023
fa0495b
Rewrite screenshot functionality
jkitching Apr 30, 2023
86baa1c
README: Add link to new extensions.gnome.org entry
jkitching May 1, 2023
5bf40bd
Bump to version 34
jkitching May 1, 2023
ffc77af
README: Standardize on spelling of "backlight"
jkitching May 1, 2023
f5c4ec9
README: Remove LocalWords entries
jkitching May 1, 2023
4a49bef
Update meson build files to correct version number
jkitching May 7, 2023
f087ea4
Explain why checking for session mode is necessary in disable()
jkitching May 8, 2023
f3c256b
Allow disable() in case of gnome-shell 42+
jkitching May 8, 2023
b6cc476
Always follow gnome-shell enable/disable calls
jkitching May 8, 2023
594c4a7
Standardize on references to different gnome-shell versions
jkitching May 8, 2023
47b3462
Remove workaround for version 3.33.90
jkitching May 8, 2023
37df5e8
Remove two unused imports
jkitching May 8, 2023
77b5f92
Remove some rogue whitespace
jkitching May 8, 2023
611f4e8
Change getDisplayConfigProxy to throw exception
jkitching Oct 18, 2023
94c77bd
Fix bug where cursor overlay does not show
jkitching Oct 18, 2023
c3ee8db
Revert a change to meson-gse/README.md
jkitching Oct 18, 2023
e334103
Initial GNOME 45 support
jkitching Oct 18, 2023
01d9288
Specify width and height of preferences window
jkitching Oct 20, 2023
2bb46aa
Remove compatibility code related to cursor cloning
jkitching Oct 19, 2023
f6dfd5f
Remove compatibility code related to restacking methods
jkitching Oct 19, 2023
7fc0a37
Remove compatibility code related to detecting monitors
jkitching Oct 19, 2023
1e8430c
Remove compatibility code related to session modes
jkitching Oct 19, 2023
dc72083
Remove compatibility code related to brightness indicator
jkitching Oct 19, 2023
3c41ed3
Add missing _brightnessSlider and _brightnessIndicator assignments
jkitching Oct 20, 2023
abe9f2e
Enable: wait for quickSettings._brightness to become available
jkitching Oct 20, 2023
9670bb1
Bump release to version 35
jkitching Oct 20, 2023
cd4a57d
README: Update v35 release notes
jkitching Oct 24, 2023
2fd2771
Do not call run_dispose
jkitching Oct 31, 2023
525ee53
Remove unused global constants BrightnessInterface and BrightnessProxy
jkitching Oct 31, 2023
4e9e446
Fix up imports in meson-gse/lib/logger.js
jkitching Oct 31, 2023
4797c33
Export named class directly in meson-gse/lib/logger.js
jkitching Oct 31, 2023
0bc6949
utils.js: Style nits
jkitching Oct 27, 2023
14526d5
Use console.log instead of log
jkitching Oct 31, 2023
342a8c5
metadata.json: Update order to match extensions.gnome.org
jkitching Oct 24, 2023
9e65a61
Fix up copyright notices
jkitching Oct 25, 2023
b77e711
Bump release to version 36
jkitching Oct 31, 2023
efbb9f1
Fix a few style and syntax nits in extension.js
jkitching Nov 5, 2023
b951c22
Remove unused imports and constants from extensions.js
jkitching Nov 5, 2023
b861de6
Refactor method implementations in preferences class
jkitching Nov 5, 2023
a5c2e3a
extension.js: Revert back to non-async enable()
jkitching Nov 6, 2023
2414e2f
Convert some let variable declarations to const
jkitching Nov 6, 2023
24ff0d7
Re-implement preferences window using Adw.ActionRow
jkitching Oct 24, 2023
ed0169a
Do not use return value from Utils.newDisplayConfig
jkitching Oct 27, 2023
48144fd
Refactor main Extension class into separate classes
jkitching Nov 9, 2023
8938dfe
Rewrite settings monitoring
jkitching Nov 13, 2023
2c44f72
Stop using meson-gse logger.js
jkitching Nov 14, 2023
7085d97
Restore (abandon) the original logger.js file
jkitching Nov 14, 2023
ee68d94
Move _logVersion function into Logger
jkitching Nov 14, 2023
4f2cde7
Style changes
jkitching Nov 17, 2023
c08a5bf
Add myself to copyright message in preferences window
jkitching Nov 17, 2023
a58eff3
Bump release to version 37
jkitching Nov 27, 2023
d5544e8
Fix call to nonexistent _setPointerVisible
jkitching Nov 27, 2023
075ac7c
Remove _on_use_backlight_change function
jkitching Mar 31, 2024
9bdb8b4
Add GNOME 46 support
jkitching Mar 31, 2024
afc1f51
Revert to using "actor" for signal names in GS 45
jkitching Apr 2, 2024
38d49a9
Bump release to version 38
jkitching Apr 9, 2024
72b867a
Update copyright notice on preferences page to include 2024
jkitching Apr 19, 2024
b80e6cf
Remove arguments from _updateMousePosition
jkitching Apr 19, 2024
6cbe412
Fix "JS ERROR: TypeError: proxy is undefined"
jkitching Apr 19, 2024
17aa065
Ensure using latest reference to Main.panel.statusArea.quickSettings
jkitching Apr 19, 2024
7fe5447
Rewrite mouse cloning
jkitching Apr 19, 2024
39ad7f3
Bump release to version 39
jkitching Apr 20, 2024
c1cecdb
Update fr.po
WedoneOfficiel Apr 30, 2024
f3dbac6
Merge pull request #21 from WedoneOfficiel/patch-2
jkitching May 10, 2024
eacc42f
Check truthiness instead of strict equality on proxy variable
jkitching May 9, 2024
768f6b5
Check truthiness instead of strict equality on _brightness variable
jkitching May 9, 2024
261928e
Bump release to version 40
jkitching May 10, 2024
7a93009
Update translation template to match gschema.xml
jkitching May 27, 2024
08903f7
:wrench: Add GNOME 47 support
Striffly Oct 3, 2024
8a92fba
Merge pull request #28 from Striffly/patch-1
jkitching Oct 19, 2024
243b675
Bump release to version 41
jkitching Oct 19, 2024
5f5758b
Add support for GS48
jkitching Apr 8, 2025
1b3264f
Bump github actions/upload-artifact to v4
jkitching Apr 8, 2025
83fe60b
Change CursorTracker.get_for_display call to use new function
jkitching Apr 30, 2025
013ee4f
Bump to version 43
jkitching Apr 30, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions .github/workflows/build-extension.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Build GNOME Extension

on:
push:
branches: [ master ]

jobs:
build:
runs-on: ubuntu-latest
name: Build
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y meson ninja-build

- name: Build extension
run: |
meson build
ninja -C build extension.zip

- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: build.zip
path: build/
197 changes: 145 additions & 52 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,18 @@
# Soft Brightness Gnome Shell Extension
# Soft Brightness Plus Gnome Shell Extension

[![Build Status](https://travis-ci.org/F-i-f/soft-brightness.svg?branch=master)](https://travis-ci.org/F-i-f/soft-brightness)

![Brightness slider in Gnome Shell's system menu](docs/soft-brightness.png)
![Brightness slider in Gnome Shell's system menu](docs/soft-brightness-plus.png)

## Overview

Soft Brightness uses an alpha overlay to control the brightness on all
Soft Brightness Plus uses an alpha overlay to control the brightness on all
or some of your monitors. It integrates smoothly and does not
interfere with other Gnome Shell features. It works flawlessly with
the _Night Light_, the _Magnifier_ from the Accessibility Services, or
with screen captures (as long as they are initiated by Gnome Shell).

Common uses are:

- Your laptop has no back-light, maybe because it's not supported, or
- Your laptop has no backlight, maybe because it's not supported, or
you have an OLED display.

- You want to control the brightness level of external monitor like
Expand All @@ -30,30 +28,30 @@ Bonus features:

## Configuration

Soft Brightness comes with a configuration panel, which can be
Soft Brightness Plus comes with a configuration panel, which can be
accessed from the "Tweaks" application or the [Gnome Shell Extensions
page](https://extensions.gnome.org/local/).

![Soft Brightness preference panel](docs/preferences.png)
![Soft Brightness Plus preference panel](docs/preferences.png)

### Configuration Settings

#### _Use backlight control_

When enabled, Soft Brightness will work together with your computer's
back-light. The brightness slider and keyboard brightness hotkeys
will control both the back-light and the Soft Brightness overlays.
When enabled, Soft Brightness Plus will work together with your computer's
backlight. The brightness slider and keyboard brightness hotkeys
will control both the backlight and the Soft Brightness Plus overlays.
This is most useful:

- if you have a back-light and _Monitors_ is set to _External_, or
- if you have a backlight and _Monitors_ is set to _External_, or

- if a back-light is detected by Gnome but is not working (like some
OLED panel laptops which report having a back-light brightness which
- if a backlight is detected by Gnome but is not working (like some
OLED panel laptops which report having a backlight brightness which
doesn't exist). In that latter case _Monitors_ should be set to
_All_.

If _Use backlight control_ is disabled, the Brightness slider will
only control the Soft Brightness overlays. The keyboard brightness
only control the Soft Brightness Plus overlays. The keyboard brightness
hotkeys will keep their default bindings.

#### _Monitor(s)_
Expand Down Expand Up @@ -102,15 +100,15 @@ Choose one of:
brightness overlay is active (brightness is 100%). Applications
will then always be rendered
[tear-free](https://en.wikipedia.org/wiki/Screen_tearing), whatever
the brightness may be. In this mode, Soft Brightness can be used as
the brightness may be. In this mode, Soft Brightness Plus can be used as
a replacement for extensions like _Fix Fullscreen Tearing_.

#### _Minimum brightness_

Sets the minimum allowable brightness for the display where _0_ is
completely dark and _1_ completely bright. Defaults to _0.1_ (10%).

The minimum brightness will also be enforced for the panel back-light
The minimum brightness will also be enforced for the panel backlight
if _Use backlight control_ is on.

When the brightness is set to 0%, the display will go completely dark,
Expand All @@ -133,50 +131,50 @@ brightness will always follow the screen's.

#### _Debug_

When toggled on, Soft Brightness will log extra debugging information
When toggled on, Soft Brightness Plus will log extra debugging information
to the system journal (or syslog).

This will be useful if you encounter a bug: In that case, please turn
_Debug_ on, and try to reproduce the issue with that setting before
capturing the debug logging.

Soft Brightness's debug messages can be watched with:
Soft Brightness Plus's debug messages can be watched with:

```
journalctl -f | grep 'gnome-shell.*Soft-Brightness'
journalctl -f | grep 'gnome-shell.*soft-brightness-plus'
```

### Effect on power consumption

Soft Brightness will cause extra load on the hardware and therefore
Soft Brightness Plus will cause extra load on the hardware and therefore
slightly increase power usage, as it needs to add extra alpha layers
and track the mouse among other things. This is true of any Gnome
Shell extension.

If Soft Brightness controls an LCD panel, changing the brightness will
not change at all the panel's power consumption. Use the back-light
instead: Changing the back-light brightness will affect power
If Soft Brightness Plus controls an LCD panel, changing the brightness will
not change at all the panel's power consumption. Use the backlight
instead: Changing the backlight brightness will affect power
consumption, the lower the brightness, the lower the power usage.

If Soft Brightness controls an OLED panel, changing the brightness
If Soft Brightness Plus controls an OLED panel, changing the brightness
will affect power consumption, the lower the brightness, the lower the
power usage.

### Common use cases and usage scenarios

#### You have a desktop computer

Soft Brightness can be used to control the brightness of all your
Soft Brightness Plus can be used to control the brightness of all your
attached monitors:

- Set _Use backlight control_ to _Off_.

- Set _Monitor(s)_ to _All_.

#### You have a laptop computer with a back-light
#### You have a laptop computer with a backlight

You can leave the control of your attached display to the back-light
and use Soft Brightness to control the brightness of external
You can leave the control of your attached display to the backlight
and use Soft Brightness Plus to control the brightness of external
displays:

- Set _Use backlight control_ to _On_.
Expand All @@ -185,18 +183,18 @@ displays:

- Configure _Built-in monitor_ to your built-in panel's name.

#### You have a laptop computer without a back-light
#### You have a laptop computer without a backlight

For example an OLED panel or non-functional back-light. Have
Soft-Brightness control the brightness for all your monitors:
For example an OLED panel or non-functional backlight. Have
Soft Brightness Plus control the brightness for all your monitors:

- Set _Use backlight control_ to _On_.

- Set _Monitor(s)_ to _All_.

## License

Soft Brightness is free software: you can redistribute it and/or
Soft Brightness Plus is free software: you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation, either version 3 of the
License, or (at your option) any later version.
Expand All @@ -212,15 +210,15 @@ along with this program. If not, see [http://www.gnu.org/licenses/].
## Download / Install

Install directly from the [Gnome Shell Extensions
site](https://extensions.gnome.org/extension/1625/soft-brightness/).
site](https://extensions.gnome.org/extension/5943/soft-brightness-plus/).

Or download the [zip
file](https://github.com/F-i-f/soft-brightness/releases/download/v30/soft-brightness@fifi.org.v30.shell-extension.zip)
file](https://github.com/jkitching/soft-brightness/releases/download/v42/soft-brightness-plus@joelkitching.com.v42.shell-extension.zip)
from the GitHub [releases
page](https://github.com/F-i-f/soft-brightness/releases) and run:
page](https://github.com/jkitching/soft-brightness-plus/releases) and run:

``` shell
gnome-extensions install soft-brightness@fifi.org.v30.shell-extension.zip
gnome-extensions install soft-brightness-plus@joelkitching.com.v42.shell-extension.zip
```

## Building from source
Expand All 10000 @@ -231,9 +229,9 @@ gnome-extensions install soft-brightness@fifi.org.v30.shell-extension.zip

### Running the build

- Check out: `git clone https://github.com/F-i-f/soft-brightness`
- Check out: `git clone https://github.com/jkitching/soft-brightness-plus`

- `cd soft-brightness`
- `cd soft-brightness-plus`

- Run meson: `meson build`

Expand All @@ -243,6 +241,114 @@ gnome-extensions install soft-brightness@fifi.org.v30.shell-extension.zip

## Changelog

### Version 43
#### April 30, 2025

- In Version 42, enabling "Mouse cursor brightness control" on GNOME 48
breaks the extension due to `Meta.CursorTracker.get_for_display` having
been moved. Update to the correct `global.backend.get_cursor_tracker`.

### Version 42
#### April 8, 2025

- Add GNOME 48 support (fix up `*_unredirect_for_display` calls).

### Version 41
#### October 20, 2024

- Add GNOME 47 support (no code changes).

### Version 40
#### May 10, 2024

- Fixed some bugs introduced by using `===` and `!==` strict
equality operators on gnome-shell objects by changing to
truthy/falsy checks.

### Version 39
#### April 20, 2024

- Rewrite mouse cloning to fix bug (see [GitHub issue](https://github.com/jkitching/soft-brightness-plus/issues/20))
introduced as of gnome-shell 46.

### Version 38
#### April 9, 2024

- Update MouseSpriteContent in src/cursor.js to match
changes in gnome-shell/js/ui/magnifier.js.
- Rename Clutter.Container terminology in function calls
and signal names from "actor" to "child".
- Fix a bug which would access a previously-removed
property when changing the "use-backlight" setting.

### Version 37
#### November 17, 2023

- Re-implement preferences window using Adw.ActionRow.
This conveniently sidesteps the "window too small" issue.
- Split main class into multiple compartmentalized classes.
- Add my name to copyright message in preferences window.
- Fix up code for style and consistency.
- Re-implement logger.js instead of using meson-gse.

### Version 36
#### October 31, 2023

- Changes requested by extensions.gnome.org code review of v35.
- Update copyright notices at top of files to include my name.

### Version 35
#### October 20, 2023

- Rewrite to support GNOME 45. Since it is now required to
use ECMAScript modules, and since the `import` and `export`
mechanisms are not compatible with previous GNOME versions,
declare compatibility bankruptcy, and drop all support for
previous GNOME versions.
- Code is vastly simplified by removing all of the workarounds
to support multiple versions of GNOME with the same file.
- Since the GNOME extensions website supports hosting multiple
builds for different GNOME versions, simply leave all GNOME
versions prior to 45 using Soft Brightness Plus v34.
- If bugfixes need to be made to version 34, a branch can be
cut, and fixes can be applied there.
- Rewrite `enable()` function as async in order to wait for the
existence of `quickSettings._brightness`.
- Hard-code width and height of the preferences window, since
after converting it to use Adw, the default width is not
large enough to contain all widgets.

### Version 34
#### May 1, 2023

- Rewrite and simplify screenshot functionality. No longer
need to handle cases for different GNOME versions.
- Code formatting: re-tabbing and other minor changes.

### Version 33
#### April 28, 2023

- Fix a bug which broke disabling and enabling the extension,
due to `ScreenshotClass` getting registered multiple times.
- Rename project to "Soft Brightness Plus". Ensure consistent
capitalization and formatting of the name.

### Version 32
#### April 10, 2023

- Fix a bug in checking for `global.backend` before use.
- These changes were requested as part of review on
extensions.gnome.org:
- Drop support for unstable GNOME releases 3.33 and 3.35.
- Refactor `ScreenshotClass` creation to include access to
`softBrightnessExtension` via closure.
- Stop storing reference to extension as a global.

### Version 31
#### April 6, 2023

- Support Gnome Shell 43 and 44.

### Version 30
#### May 20, 2022

Expand Down Expand Up @@ -503,16 +609,3 @@ First public release.

- The [`meson-gse` credits](https://github.com/F-i-f/meson-gse/) are
included here by reference.

<!-- LocalWords: OLED VSync extensions' Changelog README md GPLv3 X11
-->
<!-- LocalWords: gse gettext DND js ES6 backlight applications' syslog
-->
<!-- LocalWords: unredirect compositing unredirecting composited eg
-->
<!-- LocalWords: fullscreen merchantability Wayland Xorg gdm Gitlab
-->
<!-- LocalWords: bo kludgy gjs CursorSprite mozjs Vistaus gse's
-->
<!-- LocalWords: getSettings initTranslations ExtensionUtils
-->
File renamed without changes
13 changes: 7 additions & 6 deletions meson-gse.build
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Soft-brightness - Control the display's brightness via an alpha channel.
# soft-brightness-plus - Control the display's brightness via an alpha channel.
# Copyright (C) 2019-2022 Philippe Troin (F-i-f on Github)
# Copyright (C) 2023 Joel Kitching (jkitching on Github)
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
Expand All @@ -14,12 +15,12 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.

gse_project({soft-brightness},
{fifi.org},
{30},
gse_project({soft-brightness-plus},
{joelkitching.com},
{43},
{
gse_sources += files('src/utils.js')
gse_libs += [gse_lib_logger]
gse_sources += files('src/utils.js', 'src/cursor.js', 'src/logger.js')
gse_libs += []
gse_data += []
gse_schemas += []
gse_dbus_interfaces += [files('dbus-interfaces/org.gnome.Mutter.DisplayConfig.xml')]
Expand Down
Loading
0