Skip to content

Commit 8e6a31c

Browse files
committed
1. Bump version to 38 2. Support Gnome Shell 44
1 parent 1e98ba0 commit 8e6a31c

5 files changed

Lines changed: 28 additions & 28 deletions

File tree

README.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -99,15 +99,16 @@ sudo dnf install ydotool
9999

100100
#Check the permission of `/dev/uinput`, if it's `crw-rw----+`, you can skip step 2
101101
# 2. Get permission to access to `/dev/uinput` as the normal user
102-
sudo touch /etc/udev/rules.d/60-awsm-ydotool-uinput.
102+
sudo touch /etc/udev/rules.d/60-awsm-ydotool-uinput.rules
103103
# Here we use `tee`, not redirect(>), to avoid `warning: An error occurred while redirecting file '/etc/udev/rules.d/60-awsm-ydotool-uinput.rules' open: Permission denied`
104104
# See: https://www.shellhacks.com/sudo-echo-to-file-permission-denied/
105105
echo '# See:
106-
# https://github.com/ValveSoftware/steam-devices/blob/master/60-steam-input.rules
107-
# https://github.com/ReimuNotMoe/ydotool/issues/25
106+
# https://github.com/ValveSoftware/steam-devices/blob/master/60-steam-input.rules
107+
# https://github.com/ReimuNotMoe/ydotool/issues/25
108+
109+
# ydotool udev write access
110+
KERNEL=="uinput", SUBSYSTEM=="misc", TAG+="uaccess", OPTIONS+="static_node=uinput"' | sudo tee --append /etc/udev/rules.d/60-awsm-ydotool-uinput.rules
108111

109-
# ydotool udev write access
110-
KERNEL=="uinput", SUBSYSTEM=="misc", TAG+="uaccess", OPTIONS+="static_node=uinput"' | sudo tee --append /etc/udev/rules.d/60-awsm-ydotool-uinput.rules
111112
cat /etc/udev/rules.d/60-awsm-ydotool-uinput.rules
112113
#Remove executable permission (a.k.a. x)
113114
sudo chmod 644 /etc/udev/rules.d/60-awsm-ydotool-uinput.rules

metadata.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,10 @@
66
"40",
77
"41",
88
"42",
9-
"43"
9+
"43",
10+
"44"
1011
],
1112
"url": "https://github.com/nlpsuge/gnome-shell-extension-another-window-session-manager",
1213
"uuid": "another-window-session-manager@gmail.com",
13-
"version": 37
14+
"version": 38
1415
}

prefsCloseWindow.js

Lines changed: 3 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -541,12 +541,7 @@ const RuleRow = GObject.registerClass({
541541

542542
const frame = new Gtk.Frame();
543543
frame.set_child(box);
544-
const cssProvider = new Gtk.CssProvider();
545-
cssProvider.load_from_data(
546-
"frame { border-style: dashed; }");
547-
frame.get_style_context().add_provider(cssProvider,
548-
Gtk.STYLE_PROVIDER_PRIORITY_APPLICATION);
549-
544+
PrefsWidgets.updateStyle(frame, 'frame { border-style: dashed; }');
550545
parentWidget.append(frame);
551546
}
552547

@@ -788,11 +783,7 @@ const RuleRowByApp = GObject.registerClass({
788783
});
789784
label.set_tooltip_text(displayName);
790785
if (!appInfo) {
791-
const cssProvider = new Gtk.CssProvider();
792-
cssProvider.load_from_data(
793-
"label { color: red; }");
794-
label.get_style_context().add_provider(cssProvider,
795-
Gtk.STYLE_PROVIDER_PRIORITY_APPLICATION);
786+
PrefsWidgets.updateStyle(label, 'label { color: red; }');
796787
}
797788
this.boxLeft.insert_child_after(label, icon);
798789

@@ -880,10 +871,6 @@ const RuleRowByKeyword = GObject.registerClass({
880871
_init(ruleDetail) {
881872
super._init(ruleDetail);
882873

883-
const icon = new Gtk.Image({
884-
gicon: IconFinder.find('empty-symbolic.svg'),
885-
pixel_size: 32,
886-
});
887874
const compareWithDropDown = this._newCompareWithDropDown();
888875
const methodDropDown = this._newMethodDropDown();
889876
const pickableEntry = new PrefsWindowPickableEntry.WindowPickableEntry({
@@ -898,8 +885,7 @@ const RuleRowByKeyword = GObject.registerClass({
898885
this._compareWithDropDown = compareWithDropDown;
899886
this._methodDropDown = methodDropDown;
900887

901-
this.boxLeft.insert_child_after(icon, this._enabledCheckButton);
902-
this.boxLeft.insert_child_after(compareWithDropDown, icon);
888+
this.boxLeft.insert_child_after(compareWithDropDown, this._enabledCheckButton);
903889
this.boxLeft.insert_child_after(methodDropDown, compareWithDropDown);
904890
this.boxLeft.insert_child_after(pickableEntry, methodDropDown);
905891

prefsWidgets.js

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@
22

33
const { Gtk, GLib, GObject } = imports.gi;
44

5+
const ExtensionUtils = imports.misc.extensionUtils;
6+
const Me = ExtensionUtils.getCurrentExtension();
7+
8+
const GnomeVersion = Me.imports.utils.gnomeVersion;
9+
10+
511
var boxProperties = {
612
spacing: 0,
713
margin_start: 6,
@@ -43,7 +49,11 @@ var newLabelSwitch = function(text, tooltipText, active) {
4349

4450
var updateStyle = function(widget, css) {
4551
const cssProvider = new Gtk.CssProvider();
46-
cssProvider.load_from_data(css);
52+
if (GnomeVersion.isLessThan44()) {
53+
cssProvider.load_from_data(css);
54+
} else {
55+
cssProvider.load_from_data(css, -1);
56+
}
4757
widget.get_style_context().add_provider(cssProvider, Gtk.STYLE_PROVIDER_PRIORITY_APPLICATION);
4858
}
4959

utils/gnomeVersion.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,14 @@ const Config = imports.misc.config;
66
const GNOME_VERSION = parseFloat(Config.PACKAGE_VERSION);
77

88

9-
function isLessThan42() {
10-
return GNOME_VERSION < 42;
9+
function isLessThan44() {
10+
return GNOME_VERSION < 44;
1111
}
1212

1313
function isLessThan43() {
1414
return GNOME_VERSION < 43;
1515
}
1616

17-
17+
function isLessThan42() {
18+
return GNOME_VERSION < 42;
19+
}

0 commit comments

Comments
 (0)