Commit f71da9e8 authored by Florian Müllner's avatar Florian Müllner
Browse files

window-list: Replace WorkspaceBackground as well

The shell now scales down the backgrounds and adds a rounded corner
clip. Undo both those changes with another override.

Part-of: <!160>
parent 1b4a20a8
Pipeline #260361 passed with stages
in 37 seconds
......@@ -104,6 +104,42 @@ class MyWorkspace extends Workspace.Workspace {
}
});
const MyWorkspaceBackground = GObject.registerClass(
class MyWorkspaceBackground extends Workspace.WorkspaceBackground {
_updateBorderRadius() {
}
vfunc_allocate(box) {
this.set_allocation(box);
const themeNode = this.get_theme_node();
const contentBox = themeNode.get_content_box(box);
this._bin.allocate(contentBox);
const [contentWidth, contentHeight] = contentBox.get_size();
const monitor = Main.layoutManager.monitors[this._monitorIndex];
const xRatio = contentWidth / this._workarea.width;
const yRatio = contentHeight / this._workarea.height;
const right = area => area.x + area.width;
const bottom = area => area.y + area.height;
const offsets = {
left: xRatio * (this._workarea.x - monitor.x),
right: xRatio * (right(monitor) - right(this._workarea)),
top: yRatio * (this._workarea.y - monitor.y),
bottom: yRatio * (bottom(monitor) - bottom(this._workarea)),
};
contentBox.set_origin(-offsets.left, -offsets.top);
contentBox.set_size(
offsets.left + contentWidth + offsets.right,
offsets.top + contentHeight + offsets.bottom);
this._backgroundGroup.allocate(contentBox);
}
});
var WindowPicker = GObject.registerClass({
Signals: {
'open-state-changed': { param_types: [GObject.TYPE_BOOLEAN] },
......@@ -148,8 +184,10 @@ var WindowPicker = GObject.registerClass({
_injectBackgroundShade() {
this._origWorkspace = Workspace.Workspace;
this._origWorkspaceBackground = Workspace.WorkspaceBackground;
Workspace.Workspace = MyWorkspace;
Workspace.WorkspaceBackground = MyWorkspaceBackground;
}
get visible() {
......@@ -254,6 +292,9 @@ var WindowPicker = GObject.registerClass({
if (this._origWorkspace)
Workspace.Workspace = this._origWorkspace;
if (this._origWorkspaceBackground)
Workspace.WorkspaceBackground = this._origWorkspaceBackground;
if (this._monitorsChangedId)
Main.layoutManager.disconnect(this._monitorsChangedId);
this._monitorsChangedId = 0;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment