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

Feat/navigate across monitor #417

Open
wants to merge 17 commits into
base: master
Choose a base branch
from

Conversation

blalande
Copy link
Contributor

Add two functions to workspace manager to allow for navigation across all monitors

@josteink josteink self-assigned this Mar 2, 2023
@josteink josteink added the enhancement New feature or request label Mar 2, 2023
@josteink josteink self-requested a review March 2, 2023 20:38
@josteink
Copy link
Member

josteink commented Mar 3, 2023

Hey there and thanks for the PR!

In general the idea seems useful, and superficially the code looks good.

I'll try to get this properly reviewed and merged as soon as I have time!

{
// shouldn’t happen.
windows[0].Focus();
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If this shouldnt happen, do we really need this code? :)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I copied the code from the window class and didn’t think too much about it, but yeah it shouldn’t be needed

{
// shouldn’t happen.
windows[0].Focus();
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If this shouldnt happen, do we really need this code? :)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I copied the code from the window class and didn’t think too much about it, but yeah it shouldn’t be needed

{
this.SwitchFocusToNextMonitor();
}
while(!FocusedWorkspace.ManagedWindows.Any());
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In theory, if you have no windows open and trigger this method, won't this code loop forever?

I think we may benefit by extracting this code into its own function (SwitchFocusToNextMonitorWithWindows() ?) where we can implement a better check without complicating this method.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes I didn’t see that. Will update

do {
this.SwitchFocusToPreviousMonitor();
}
while(!FocusedWorkspace.ManagedWindows.Any());
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In theory, if you have no windows open and trigger this method, won't this code loop forever?

I think we may benefit by extracting this code into its own function (SwitchFocusToPreviousMonitorWithWindows() ?) where we can implement a better check without complicating this method.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes I didn’t see that. Will update

@josteink
Copy link
Member

josteink commented Mar 7, 2023

Hey there and sorry for the delay.

I finally got around to reviewing this PR and I have a few small comments.

If you get those issues resolved, this looks like a nice addition and I would be happy to merge it.

@blalande
Copy link
Contributor Author

blalande commented Mar 8, 2023

I’m just thinking that I should also have the same method for moving windows across monitor in the same way. I’ll update the MR with that.

@josteink
Copy link
Member

Any news on this PR? :D

@blalande
Copy link
Contributor Author

blalande commented Apr 19, 2023 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants