🔥 Remove backwards compatibility code

This commit is contained in:
Simon Schneegans
2023-08-07 13:21:50 +02:00
parent d1cddb129d
commit f2768216db
47 changed files with 145 additions and 9406 deletions
+1 -1
View File
@@ -12,7 +12,7 @@
// SPDX-FileCopyrightText: Simon Schneegans <code@simonschneegans.de>
// SPDX-License-Identifier: GPL-3.0-or-later
//'use strict';
'use strict';
import Gio from 'gi://Gio';
import GLib from 'gi://GLib';
+3 -5
View File
@@ -20,7 +20,7 @@ import GObject from 'gi://GObject';
import Clutter from 'gi://Clutter';
import Meta from 'gi://Meta';
import {shellVersionIsAtLeast, getStringResource} from './utils.js';
import {getStringResource} from './utils.js';
//////////////////////////////////////////////////////////////////////////////////////////
// This is the base class for all shaders of Burn-My-Windows. It automagically loads //
@@ -186,10 +186,8 @@ export var Shader = GObject.registerClass(
// to undo this. It is a pity that we have to do this here, as it is not really
// required to be done each frame. But it's the only place where we can do it.
// https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2650
if (shellVersionIsAtLeast(44, 2)) {
this.get_pipeline().set_blend(
'RGBA = ADD (SRC_COLOR * (SRC_COLOR[A]), DST_COLOR * (1-SRC_COLOR[A]))');
}
this.get_pipeline().set_blend(
'RGBA = ADD (SRC_COLOR * (SRC_COLOR[A]), DST_COLOR * (1-SRC_COLOR[A]))');
this.set_uniform_float(this._uProgress, 1, [this._progress]);
super.vfunc_paint_target(...params);
+1 -2
View File
@@ -19,7 +19,6 @@ import Gio from 'gi://Gio';
const _ = imports.gettext.domain('burn-my-windows').gettext;
import {ShaderFactory} from '../ShaderFactory.js';
import {isGTK4} from '../utils.js';
//////////////////////////////////////////////////////////////////////////////////////////
// This effect is a homage to the good old Compiz days. However, it is implemented //
@@ -225,7 +224,7 @@ export default class Effect {
dialog.getBuilder().get_object('fire-preset-button').set_menu_model(menu);
const root = isGTK4() ? widget.get_root() : widget.get_toplevel();
const root = widget.get_root();
root.insert_action_group(groupName, group);
});
}
+5 -24
View File
@@ -15,9 +15,7 @@
'use strict';
import Gio from 'gi://Gio';
import Gtk from 'gi://Gtk';
import GLib from 'gi://GLib';
import Adw from 'gi://Adw';
// Returns the given argument, except for "alpha", "beta", and "rc". In these cases -3,
// -2, and -1 are returned respectively.
@@ -40,38 +38,21 @@ const [GS_MAJOR, GS_MINOR] = Config.PACKAGE_VERSION.split('.').map(toNumericVers
// the standard log() functionality by prepending the extension's name and the location
// where the message was logged. As the extensions name is part of the location, you
// can more effectively watch the log output of GNOME Shell:
// journalctl -f -o cat | grep -E 'particle-effects|'
// This method is based on a similar script from the Fly-Pie GNOME Shell extension which
// os published under the MIT License (https://github.com/Schneegans/Fly-Pie).
// journalctl -f -o cat | grep -E 'burn-my-windows|'
export function debug(message) {
const stack = new Error().stack.split('\n');
// Remove debug() function call from stack.
stack.shift();
// Find the index of the extension directory (e.g. particles@schneegans.github.com) in
// the stack entry. We do not want to print the entire absolute file path.
// const extensionRoot = stack[0].indexOf(Extension.uuid);
log('[' + stack[0] + '] ' + message);
// log('[' + stack[0].slice(extensionRoot) + '] ' + message);
}
// This method simply returns true if we are currently using GTK4.
export function isGTK4() {
return Gtk.get_major_version() == 4;
}
// Starting with GNOME Shell 42, the settings dialog uses libadwaita (at least most of
// the time - it seems that pop!_OS does not support libadwaita even on GNOME 42).
export function isADW() {
return Adw && shellVersionIsAtLeast(42, 'beta');
}
// This method returns 'gtk3', 'gtk4', or 'adw' depending on the currently used GTK / and
// or libadwaita version.
// Currently, the extension supports only one set of UI files. In the past, there were
// three different sets for GTK3, GTK4, and Adwaita. This method returns the name of the
// current UI directory. It's still here since it might be useful in the future.
export function getUIDir() {
return isADW() ? 'adw' : (isGTK4() ? 'gtk4' : 'gtk3');
return 'adw';
}
// This method returns true if the current GNOME Shell version matches the given