CHANGE: removed actor disconnect due to error
This commit is contained in:
15
Makefile
15
Makefile
@@ -8,17 +8,14 @@ all: dist/extension.js
|
||||
node_modules: package.json
|
||||
npm install
|
||||
|
||||
dist/extension.js dist/prefs.js: node_modules
|
||||
dist/extension.js: node_modules
|
||||
tsc
|
||||
|
||||
dist/stylesheet.css: stylesheet.css
|
||||
cp stylesheet.css dist/
|
||||
|
||||
schemas/gschemas.compiled: schemas/org.gnome.shell.extensions.$(NAME).gschema.xml
|
||||
glib-compile-schemas schemas
|
||||
|
||||
$(NAME).zip: dist/extension.js dist/prefs.js dist/stylesheet.css schemas/gschemas.compiled
|
||||
@cp -r schemas dist/
|
||||
$(NAME).zip: dist/extension.js dist/stylesheet.css
|
||||
@cp metadata.json dist/
|
||||
@(cd dist && zip ../$(NAME).zip -9r .)
|
||||
|
||||
@@ -27,14 +24,10 @@ pack: $(NAME).zip
|
||||
install: $(NAME).zip
|
||||
@touch ~/.local/share/gnome-shell/extensions/$(NAME)@$(DOMAIN)
|
||||
@rm -rf ~/.local/share/gnome-shell/extensions/$(NAME)@$(DOMAIN)
|
||||
@cp -r dist ~/.local/share/gnome-shell/extensions/$(NAME)@$(DOMAIN)
|
||||
@mv dist ~/.local/share/gnome-shell/extensions/$(NAME)@$(DOMAIN)
|
||||
|
||||
clean:
|
||||
@rm -rf dist node_modules $(NAME).zip
|
||||
|
||||
test:
|
||||
@dbus-run-session -- gnome-shell --nested --wayland
|
||||
|
||||
full:
|
||||
@make install
|
||||
@make test
|
||||
@dbus-run-session -- gnome-shell --nested --wayland
|
||||
16
dist/extension.js
vendored
16
dist/extension.js
vendored
@@ -38,13 +38,14 @@ export default class MyExtension extends Extension {
|
||||
this._actorSignalIds.set(global.window_manager, [global.window_manager.connect("switch-workspace", this._updateFloating.bind(this))]);
|
||||
}
|
||||
disable() {
|
||||
for (const actorSignalIds of [this._actorSignalIds, this._windowSignalIds]) {
|
||||
for (const [actor, signalIds] of actorSignalIds) {
|
||||
for (const signalId of signalIds) {
|
||||
actor.disconnect(signalId);
|
||||
}
|
||||
}
|
||||
}
|
||||
// for (const actorSignalIds of [this._actorSignalIds, this._windowSignalIds]) {
|
||||
// for (const [actor, signalIds] of actorSignalIds!) {
|
||||
// for (const signalId of signalIds) {
|
||||
// console.log("SignalID ", signalId);
|
||||
// console.log("Actor ", actor instanceof Clutter.Actor);
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
this._actorSignalIds?.clear();
|
||||
this._windowSignalIds?.clear();
|
||||
this._setFloat(false);
|
||||
@@ -80,7 +81,6 @@ export default class MyExtension extends Extension {
|
||||
this._setFloat(!maximized);
|
||||
}
|
||||
_setFloat(float) {
|
||||
console.log("Float: ", float);
|
||||
Main.panel.add_style_class_name(float ? "floating" : "solid");
|
||||
Main.panel.remove_style_class_name(float ? "solid" : "floating");
|
||||
}
|
||||
|
||||
10
dist/metadata.json
vendored
Normal file
10
dist/metadata.json
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
{
|
||||
"name": "float bar",
|
||||
"description": "Adaptive floating topbar",
|
||||
"uuid": "floatbar@tomtroeger.de",
|
||||
"settings-schema": "org.gnome.shell.extensions.my-extension",
|
||||
"shell-version": [
|
||||
"46"
|
||||
]
|
||||
}
|
||||
|
||||
9
dist/stylesheet.css
vendored
Normal file
9
dist/stylesheet.css
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
#panel.floating {
|
||||
margin: 3px;
|
||||
border-radius: 9999px;
|
||||
}
|
||||
|
||||
#panel.solid {
|
||||
margin: 0;
|
||||
border-radius: 0;
|
||||
}
|
||||
17
extension.ts
17
extension.ts
@@ -1,5 +1,6 @@
|
||||
import Gio from "gi://Gio";
|
||||
import Meta from "gi://Meta";
|
||||
import Clutter from "gi://Clutter";
|
||||
import { Extension } from "resource:///org/gnome/shell/extensions/extension.js";
|
||||
import { EventEmitter } from "resource:///org/gnome/shell/misc/signals.js";
|
||||
import * as Main from "resource:///org/gnome/shell/ui/main.js";
|
||||
@@ -53,13 +54,14 @@ export default class MyExtension extends Extension {
|
||||
}
|
||||
|
||||
disable() {
|
||||
for (const actorSignalIds of [this._actorSignalIds, this._windowSignalIds]) {
|
||||
for (const [actor, signalIds] of actorSignalIds!) {
|
||||
for (const signalId of signalIds) {
|
||||
actor.disconnect(signalId);
|
||||
}
|
||||
}
|
||||
}
|
||||
// for (const actorSignalIds of [this._actorSignalIds, this._windowSignalIds]) {
|
||||
// for (const [actor, signalIds] of actorSignalIds!) {
|
||||
// for (const signalId of signalIds) {
|
||||
// console.log("SignalID ", signalId);
|
||||
// console.log("Actor ", actor instanceof Clutter.Actor);
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
this._actorSignalIds?.clear();
|
||||
this._windowSignalIds?.clear();
|
||||
|
||||
@@ -98,7 +100,6 @@ export default class MyExtension extends Extension {
|
||||
}
|
||||
|
||||
_setFloat(float: boolean) {
|
||||
console.log("Float: ", float);
|
||||
Main.panel.add_style_class_name(float ? "floating" : "solid");
|
||||
Main.panel.remove_style_class_name(float ? "solid" : "floating");
|
||||
}
|
||||
|
||||
BIN
floatbar.zip
Normal file
BIN
floatbar.zip
Normal file
Binary file not shown.
Reference in New Issue
Block a user