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

Can't move window to next display past a fullscreen window #51

Closed
sergej-koscejev opened this issue Dec 12, 2019 · 2 comments
Closed

Can't move window to next display past a fullscreen window #51

sergej-koscejev opened this issue Dec 12, 2019 · 2 comments

Comments

@sergej-koscejev
Copy link

macOS version: 10.14.6
Rectangle version: 0.12

Not sure if you'd consider it a bug or a feature but it's something that Rectangle does differently from Spectacle and that could be improved in my opinion.

I have three displays (1, 2, and 3) arranged horizontally. Display 2 is showing a full-screen app. Display 1 is showing a (non-full-screen) window that I want to move to display 3 (also not in full-screen).

I press the shortcut to move the window to the next display. The window moves to display 2 and becomes hidden behind the full-screen app. I press the shortcut again but nothing happens.

I'd like the shortcut to continue to work and move the window from display 2 to display 3. This is how it worked in Spectacle.

@rxhanson
Copy link
Owner

I'm not opposed to adding this in but it might take a while for me to get around to it.

If anyone wants to submit a PR for it, it shouldn't be much work. I didn't look to see how Spectacle might have done this, but you should be able to cycle through the windows on a target screen and determine if a window is the same size as the screen (see https://stackoverflow.com/questions/23844148/how-do-find-out-if-there-is-a-full-screen-app-running-on-a-specific-nsscreen). A quick search on Spectacle's code doesn't show this specific way being done there.

@rxhanson rxhanson added the good first issue Good for newcomers label Dec 12, 2019
@rxhanson
Copy link
Owner

rxhanson commented Jan 4, 2020

I took a look at this one, and here's what I found.

Spectacle does not do this (and neither does Magnet FWIW). At first, I thought it did, but it turned out that Spectacle has a bug where it cycled through displays backwards - my fullscreen app in the middle of three displays appeared to be skipped but it just cycled through displays the wrong way.

With that in mind, I don't have plans to investigate this further. If someone else wants to give it a go, I don't see a reason to turn down a PR with it. I spent a while digging in Spectacle's code when I thought that it did it, and did find something worth taking a look at if someone were to implement this. It's a way to see if a window is full screen using the accessibility API, as follows:

- (BOOL)isFullScreen
{
  ZKAccessibilityElement *fullScreenButtonElement = [self elementWithAttribute:kAXFullScreenButtonAttribute];

  return [[fullScreenButtonElement stringValueOfAttribute:kAXSubroleAttribute] isEqualToString:(__bridge NSString *)kAXZoomButtonSubrole];
}

Here's the commit where I found it

This might be a better way to determine if a window is fullscreened than comparing the size of the window to the screen (I don't know for sure, though).

Since I'm not going to implement this, I'm closing the issue. Although a PR is welcome if anyone else wants to do it.

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

No branches or pull requests

2 participants