Comments (6)
This is a known issue, and I have been trying to fix it without much luck. What I know is that the themeFrame (superview of [window contentView]) has an NSTrackingArea set up to capture the mouse entered event and activate the mouse over. I have tried manually calling [themeFrame updateTrackingAreas] without success. What you could try is modifying the single tracking area of the themeFrame and set the proper rect for the traffic lights. This would basically mean creating a new tracking area with all the attributes of the current tracking area (except the rect, which would be adjusted to the new traffic light position), removing the old tracking area, and adding the new one.
I'll push a fix as soon as I figure it out (or if you figure it out, send me a pull request and I'll merge the changes).
Thanks.
from inappstorewindow.
Just tried a fix real quick. I executed this code on -awakeForNib (after the traffic lights had been positioned):
- (void)_resetThemeFrameTrackingArea
{
NSView *themeFrame = [[self contentView] superview];
NSArray *trackingAreas = [themeFrame trackingAreas];
if (![trackingAreas count]) { return; }
NSTrackingArea *lightsTracking = [trackingAreas objectAtIndex:0];
NSButton *closeButton = [self standardWindowButton:NSWindowCloseButton];
NSRect newTrackingRect = [lightsTracking rect];
newTrackingRect.origin.y = [closeButton frame].origin.y;
NSTrackingArea *newArea = [[NSTrackingArea alloc] initWithRect:newTrackingRect options:[lightsTracking options] owner:[lightsTracking owner] userInfo:[lightsTracking userInfo]];
[themeFrame removeTrackingArea:lightsTracking];
[themeFrame addTrackingArea:newArea];
[newArea release];
}
This didn't seem to have any effect. Maybe I'm running it too early or something. But there's a place for you to start ;-)
EDIT: If you take a look at Sparrow (another app that uses this same technique to position its traffic lights), they seem to have the exact same bug here which indicates that they most likely were not able to find a solution for it.
from inappstorewindow.
Exactly, they have the same problem.
I found that the reason the newly added trackingArea doesn't work is that the trackingArea is "pending installed, notInstalled, disabled". You can find this information by logging it in the console. I still don't have a solution to fix it. :)
from inappstorewindow.
I doubt that there's an easy way around this one except for completely redrawing the window from scratch; however, doing that would be a lot of work (replicating the traffic lights, resize behaviour, etc. etc.)
from inappstorewindow.
Strange: If you manually resize the window (with the mouse), the tracingArea will move to the right position. I tried to resize the window with setFrame:, but it doesn't work.
from inappstorewindow.
Yeah I found the exact same thing, I'm sure that dragging the resize corner invokes a private method that resets the tracking area.
from inappstorewindow.
Related Issues (20)
- when click minButton to hidden the window, then reopen,move mouse to traffic button and remove mouse, the traffic button always show RollOverImage
- Exit full screen mode in Yosemite HOT 7
- dragging to another virtual desktop is not working
- window frame.height grows from start to start if autosave name is not empty, OS X 10.9.3
- README needs update
- setMovable flag doesn't work
- Box behind title Xcode 6.1 GM HOT 2
- Yosemite double click title bar to maximum window not working HOT 1
- Cocoa pod can't find INAppStoreWindow 1.5
- bad window button positioning on Yosemite HOT 4
- TitleTextColor changes only the Window Title !
- bad way to detect yosemite
- crash, creating window from code inherit INAppStoreWindow 10.10.1 HOT 3
- Window widgets are positioned incorrectly in document-based application when showing sheets HOT 2
- Graphite system appearance appears to be ignored
- Where do I start HOT 1
- AppleMiniaturizeOnDoubleClick Isn't working HOT 2
- Window flicker when drag in the original titlebar area and move to top of the screen
- Traffic light buttons HOT 2
- Every Time At the time of Launch : NSWindow warning: adding an unknown subview: HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from inappstorewindow.