Skip to content

Commit

Permalink
Remove windowFocused copy (to avoid desync)
Browse files Browse the repository at this point in the history
  • Loading branch information
paradoxxxzero committed Aug 13, 2019
1 parent 27f297f commit 04da9b0
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 8 deletions.
5 changes: 1 addition & 4 deletions tilingManager/tilingLayouts/baseTiling.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ var BaseTilingLayout = class BaseTilingLayout {
);
this.superWorkspace = superWorkspace;
this.monitor = superWorkspace.monitor;
this.windowFocused = this.superWorkspace.windowFocused;
this.windowChangedId = this.superWorkspace.connect(
'windows-changed',
this.onWindowsChanged.bind(this)
Expand Down Expand Up @@ -43,9 +42,7 @@ var BaseTilingLayout = class BaseTilingLayout {
}
}

onFocusChanged(windowFocused) {
this.windowFocused = windowFocused;
}
onFocusChanged() {}

onTile() {
log(`Tile ${this.superWorkspace.categoryKey}`);
Expand Down
6 changes: 3 additions & 3 deletions tilingManager/tilingLayouts/maximize.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ var MaximizeLayout = class MaximizeLayout extends BaseTilingLayout {
const oldIndex = this.superWorkspace.windows.indexOf(
oldWindowFocused
);
this.windowFocused = windowFocused;
const direction = newIndex > oldIndex ? 1 : -1;
this.prepareTransition(windowFocused, oldWindowFocused, direction);
this.animateTransition(direction);
Expand All @@ -39,12 +38,13 @@ var MaximizeLayout = class MaximizeLayout extends BaseTilingLayout {
}
windows.forEach(window => {
if (
window !== this.windowFocused ||
window !== this.superWorkspace.windowFocused ||
!this.superWorkspace.isDisplayed()
) {
window.get_compositor_private().hide();
} else {
if (!window.grabbed && !window.maximized_horizontally) {
Main.wm.skipNextEffect(window.get_compositor_private());
window.maximize(Meta.MaximizeFlags.BOTH);
}
window.get_compositor_private().show();
Expand All @@ -55,7 +55,7 @@ var MaximizeLayout = class MaximizeLayout extends BaseTilingLayout {
onDestroy() {
super.onDestroy();
this.superWorkspace.windows.forEach(window => {
if (window !== this.windowFocused) {
if (window !== this.superWorkspace.windowFocused) {
window.get_compositor_private().show();
}
});
Expand Down
2 changes: 1 addition & 1 deletion tilingManager/tilingLayouts/split.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ var SplitLayout = class SplitLayout extends BaseGrabbableLayout {
this.baseIndex = Math.max(
0,
Math.min(
regularWindows.indexOf(this.windowFocused),
regularWindows.indexOf(this.superWorkspace.windowFocused),
regularWindows.length - WINDOW_PER_SCREEN
)
);
Expand Down

0 comments on commit 04da9b0

Please sign in to comment.