Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Always add the new window to the center. Update tray when windows are moved. #1689

Merged
merged 1 commit into from
Aug 28, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,11 @@ public void onFocusedWindowChanged(@NonNull WindowWidget aFocusedWindow, @Nullab
public void onWindowBorderChanged(@NonNull WindowWidget aChangeWindow) {
mKeyboard.proxifyLayerIfNeeded(mWindows.getCurrentWindows());
}

@Override
public void onWindowsMoved() {
updateWidget(mTray);
}
});

// Create Browser navigation widget
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ public enum WindowPlacement{
public interface Delegate {
void onFocusedWindowChanged(@NonNull WindowWidget aFocusedWindow, @Nullable WindowWidget aPrevFocusedWindow);
void onWindowBorderChanged(@NonNull WindowWidget aChangeWindow);
void onWindowsMoved();
}

public Windows(Context aContext) {
Expand Down Expand Up @@ -192,14 +193,16 @@ public WindowWidget addWindow() {
placeWindow(frontWindow, WindowPlacement.RIGHT);
} else if (leftWindow != null && focusedWindow == frontWindow) {
// Opening a new window from front window
placeWindow(newWindow, WindowPlacement.RIGHT);
placeWindow(newWindow, WindowPlacement.FRONT);
placeWindow(frontWindow, WindowPlacement.RIGHT);
} else if (rightWindow != null && focusedWindow == rightWindow) {
// Opening a new window from right window
placeWindow(newWindow, WindowPlacement.FRONT);
placeWindow(frontWindow, WindowPlacement.LEFT);
} else if (rightWindow != null && focusedWindow == frontWindow) {
// Opening a new window from right window
placeWindow(newWindow, WindowPlacement.LEFT);
placeWindow(newWindow, WindowPlacement.FRONT);
placeWindow(frontWindow, WindowPlacement.LEFT);
}

updateMaxWindowScales();
Expand Down Expand Up @@ -292,6 +295,9 @@ public void moveWindowRight(@NonNull WindowWidget aWindow) {
placeWindow(frontWindow, WindowPlacement.RIGHT);
}
updateViews();
if (mDelegate != null) {
mDelegate.onWindowsMoved();
}
}

public void moveWindowLeft(@NonNull WindowWidget aWindow) {
Expand All @@ -311,6 +317,9 @@ public void moveWindowLeft(@NonNull WindowWidget aWindow) {
placeWindow(frontWindow, WindowPlacement.LEFT);
}
updateViews();
if (mDelegate != null) {
mDelegate.onWindowsMoved();
}
}

public void focusWindow(@NonNull WindowWidget aWindow) {
Expand Down