Git Product home page Git Product logo

Comments (2)

rxhanson avatar rxhanson commented on August 28, 2024

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.

from rectangle.

rxhanson avatar rxhanson commented on August 28, 2024

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.

from rectangle.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.