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

Add support for GNOME 42 (Ubuntu 22.04) #189

Merged
merged 3 commits into from
May 22, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion metadata.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"localedir": "/usr/local/share/locale",
"shell-version": [
"3.28", "3.36", "3.38", "40"
"3.28", "3.30", "3.36", "3.38", "40", "41", "42"
],
"uuid": "[email protected]",
"name": "CPU Power Manager",
Expand Down
26 changes: 23 additions & 3 deletions src/slider2.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
const {Atk, Clutter, GObject} = imports.gi;

const ExtensionUtils = imports.misc.extensionUtils;
const Config = imports.misc.config;

const Me = ExtensionUtils.getCurrentExtension();
const BarLevel2 = Me.imports.src.barLevel2;

Expand Down Expand Up @@ -83,7 +85,9 @@ var Slider2 = GObject.registerClass({
let device = event.get_device();
let sequence = event.get_event_sequence();

if (sequence) {
if (parseFloat(Config.PACKAGE_VERSION.substring(0, 4)) >= 42) {
this._grab = global.stage.grab(this);
} else if (sequence) {
device.sequence_grab(sequence, this);
} else {
device.grab(this);
Expand All @@ -109,7 +113,12 @@ var Slider2 = GObject.registerClass({
this._releaseId = 0;
}

if (this._grabbedSequence) {
if (parseFloat(Config.PACKAGE_VERSION.substring(0, 4)) >= 42) {
if (this._grab) {
this._grab.dismiss();
this._grab = null;
}
} else if (this._grabbedSequence) {
this._grabbedDevice.sequence_ungrab(this._grabbedSequence);
} else {
this._grabbedDevice.ungrab();
Expand Down Expand Up @@ -141,7 +150,18 @@ var Slider2 = GObject.registerClass({
event.type() === Clutter.EventType.TOUCH_BEGIN) {
this.startDragging(event);
return Clutter.EVENT_STOP;
} else if (device.sequence_get_grabbed_actor(sequence) === this) {
} else if (
(
parseFloat(Config.PACKAGE_VERSION.substring(0, 4)) >= 42 && (
this._grabbedSequence &&
sequence.get_slot() === this._grabbedSequence.get_slot()
)
) || (
parseFloat(Config.PACKAGE_VERSION.substring(0, 4)) < 42 && (
device.sequence_get_grabbed_actor(sequence) === this
)
)
) {
if (event.type() === Clutter.EventType.TOUCH_UPDATE) {
return this._motionEvent(this, event);
} else if (event.type() === Clutter.EventType.TOUCH_END) {
Expand Down
2 changes: 1 addition & 1 deletion tool/cpufreqctl
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
set -o errexit -o nounset

VERSION="10.0.1"
PRODUCTION=yes
PRODUCTION=no

log ()
{
Expand Down