mirror of
https://github.com/gosticks/PaperWM.git
synced 2026-12-04 04:11:38 +00:00
wip 3.38
log no longer takes several arguments... actor.add seems brokenish? MetaBackgoundActor have changed
This commit is contained in:
@@ -3,7 +3,6 @@
|
||||
var Meta = imports.gi.Meta;
|
||||
var Clutter = imports.gi.Clutter;
|
||||
var St = imports.gi.St;
|
||||
var Tweener = imports.ui.tweener;
|
||||
var Main = imports.ui.main;
|
||||
var Shell = imports.gi.Shell;
|
||||
|
||||
|
||||
+3
-3
@@ -54,13 +54,13 @@ function run(method) {
|
||||
|
||||
function safeCall(name, method) {
|
||||
try {
|
||||
log("#paperwm", `${method} ${name}`);
|
||||
print("#paperwm", `${method} ${name}`);
|
||||
let module = Extension.imports[name];
|
||||
module && module[method] && module[method].call(module, errorNotification);
|
||||
return true;
|
||||
} catch(e) {
|
||||
log("#paperwm", `${name} failed ${method}`);
|
||||
log(`JS ERROR: ${e}\n${e.stack}`);
|
||||
print("#paperwm", `${name} failed ${method}`);
|
||||
print(`JS ERROR: ${e}\n${e.stack}`);
|
||||
errorNotification(
|
||||
"PaperWM",
|
||||
`Error occured in ${name} @${method}:\n\n${e.message}`,
|
||||
|
||||
@@ -45,7 +45,7 @@ var MoveGrab = class MoveGrab {
|
||||
|
||||
begin({center} = {}) {
|
||||
this.center = center;
|
||||
log(`begin`)
|
||||
print(`begin`)
|
||||
if (this.grabbed)
|
||||
return;
|
||||
this.grabbed = true
|
||||
@@ -85,7 +85,7 @@ var MoveGrab = class MoveGrab {
|
||||
}
|
||||
!center && clone.set_pivot_point(px, py);
|
||||
center && clone.set_pivot_point(0, 0);
|
||||
log('pointeroffset', this.pointerOffset, clone.get_pivot_point())
|
||||
print('pointeroffset', this.pointerOffset, clone.get_pivot_point())
|
||||
|
||||
this.signals.connect(global.stage, "button-release-event", this.end.bind(this));
|
||||
this.signals.connect(global.stage, "motion-event", this.motion.bind(this));
|
||||
@@ -107,7 +107,7 @@ var MoveGrab = class MoveGrab {
|
||||
return;
|
||||
this.center = center;
|
||||
this.dnd = true;
|
||||
log(`beginDND`)
|
||||
print(`beginDND`)
|
||||
Navigator.getNavigator()
|
||||
.minimaps.forEach(m => typeof(m) === 'number' ?
|
||||
Mainloop.source_remove(m) : m.hide());
|
||||
@@ -133,7 +133,7 @@ var MoveGrab = class MoveGrab {
|
||||
let single = i !== -1 && space[i].length === 1;
|
||||
space.removeWindow(metaWindow);
|
||||
clone.reparent(Main.uiGroup);
|
||||
log(`begin dnd`, point.x, point.y)
|
||||
print(`begin dnd`, point.x, point.y)
|
||||
clone.x = Math.round(point.x);
|
||||
clone.y = Math.round(point.y);
|
||||
let newScale = clone.scale_x*space.actor.scale_x;
|
||||
@@ -313,7 +313,7 @@ var MoveGrab = class MoveGrab {
|
||||
|
||||
if (this.dnd) {
|
||||
if (tx) {
|
||||
log(`motion`, tx, this.pointerOffset)
|
||||
print(`motion`, tx, this.pointerOffset)
|
||||
tx.set_to(gx - dx)
|
||||
ty.set_to(gy - dy)
|
||||
} else {
|
||||
@@ -355,7 +355,7 @@ var MoveGrab = class MoveGrab {
|
||||
}
|
||||
|
||||
end() {
|
||||
log(`end`)
|
||||
print(`end`)
|
||||
this.signals.destroy();
|
||||
|
||||
let metaWindow = this.window;
|
||||
|
||||
+3
-2
@@ -359,7 +359,8 @@ function init() {
|
||||
registerOverridePrototype(imports.ui.messageTray.MessageTray, '_updateState');
|
||||
registerOverridePrototype(WindowManager.WindowManager, '_prepareWorkspaceSwitch');
|
||||
registerOverridePrototype(Workspace.Workspace, '_isOverviewWindow');
|
||||
registerOverridePrototype(Workspace.WindowClone, 'getOriginalPosition');
|
||||
if (Workspace.WindowClone)
|
||||
registerOverridePrototype(Workspace.WindowClone, 'getOriginalPosition');
|
||||
registerOverridePrototype(Workspace.Workspace, '_realRecalculateWindowPositions');
|
||||
registerOverridePrototype(Workspace.UnalignedLayoutStrategy, '_sortRow');
|
||||
registerOverridePrototype(WindowManager.WorkspaceTracker, '_checkWorkspaces', _checkWorkspaces);
|
||||
@@ -451,7 +452,7 @@ function enable() {
|
||||
|
||||
};
|
||||
|
||||
Workspace.WindowClone.prototype.getOriginalPosition = getOriginalPosition;
|
||||
// Workspace.WindowClone.prototype.getOriginalPosition = getOriginalPosition;
|
||||
Workspace.Workspace.prototype._realRecalculateWindowPositions = _realRecalculateWindowPositions;
|
||||
// Prevent any extra sorting of the overview
|
||||
Workspace.UnalignedLayoutStrategy.prototype._sortRow = (row) => row;
|
||||
|
||||
@@ -1036,7 +1036,7 @@ border: ${borderWidth}px ${this.color};
|
||||
border-radius: ${borderWidth}px;
|
||||
box-shadow: 0px 0px 8px 0px rgba(0, 0, 0, .7);
|
||||
`);
|
||||
this.background.background.set_color(Clutter.color_from_string(color)[1]);
|
||||
this.background.content.background.set_color(Clutter.color_from_string(color)[1])
|
||||
}
|
||||
|
||||
updateBackground() {
|
||||
@@ -1053,7 +1053,9 @@ box-shadow: 0px 0px 8px 0px rgba(0, 0, 0, .7);
|
||||
file = Gio.File.new_for_uri('resource:///org/gnome/shell/theme/noise-texture.png');
|
||||
style = BackgroundStyle.WALLPAPER;
|
||||
}
|
||||
this.background.background.set_file(file, style);
|
||||
|
||||
|
||||
this.background.content.background.set_file(file, style);
|
||||
}
|
||||
|
||||
updateName() {
|
||||
@@ -1089,11 +1091,15 @@ box-shadow: 0px 0px 8px 0px rgba(0, 0, 0, .7);
|
||||
this.background = new Meta.BackgroundActor(
|
||||
Object.assign({
|
||||
name: "background",
|
||||
monitor: monitor.index, background: metaBackground,
|
||||
monitor: monitor.index,
|
||||
reactive: true // Disable the background menu
|
||||
}, meta_display)
|
||||
);
|
||||
|
||||
this.background.content.set({
|
||||
background: metaBackground
|
||||
})
|
||||
|
||||
this.actor.insert_child_below(this.background, null);
|
||||
|
||||
this.signals.connect(
|
||||
@@ -1125,7 +1131,7 @@ box-shadow: 0px 0px 8px 0px rgba(0, 0, 0, .7);
|
||||
return;
|
||||
// print(dir, Clutter.ScrollDirection.SMOOTH, Clutter.ScrollDirection.UP, Clutter.ScrollDirection.DOWN)
|
||||
let dx
|
||||
log(utils.ppEnumValue(dir, Clutter.ScrollDirection))
|
||||
// log(utils.ppEnumValue(dir, Clutter.ScrollDirection))
|
||||
// let dx = dir === Clutter.ScrollDirection.DOWN ? -1 : 1
|
||||
// let [dx, dy] = event.get_scroll_delta()
|
||||
|
||||
|
||||
@@ -86,9 +86,9 @@ var PopupMenuEntryHelper = function constructor(text) {
|
||||
this.prevIcon.grab_key_focus();
|
||||
});
|
||||
|
||||
this.actor.add(this.prevIcon, {expand: true});
|
||||
this.actor.add(this.label, {expand: true});
|
||||
this.actor.add(this.nextIcon, {expand: true});
|
||||
this.actor.add_actor(this.prevIcon, {expand: true});
|
||||
this.actor.add_actor(this.label, {expand: true});
|
||||
this.actor.add_actor(this.nextIcon, {expand: true});
|
||||
this.actor.label_actor = this.label;
|
||||
this.label.clutter_text.connect('activate', this.emit.bind(this, 'activate'));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user