Skip to content

Dark Mac #380

Merged
merged 13 commits into from Nov 14, 2013

4 participants

@JeffryBooher

FIXED

UTR

BOLO

  • Intermittently going full screen will produce a blank screen. I thought this was fixed with a few cocoa calls to unhide and activate the app before going full screen. If you click on the brackets dock icon the appear will appear after going full screen. At that point it is no longer a problem. But the problem is intermittent. I had 10-15 successful launches to full screen without this problem so hopefully the additional NSView setNeedsDisplay:YES call after entering full screen mode fixed it but it's hard to say. I'd say since there is a work-around then let's roll with it and, if it's reproducible, then file a bug and we'll address it in the usual way. I don't think it's a show stopper unless it reproduces with great frequency.
@jasonsanjose jasonsanjose commented on an outdated diff Nov 12, 2013
appshell/CustomTitlebarView.h
@@ -0,0 +1,18 @@
+//
@jasonsanjose
Adobe Systems Incorporated member
jasonsanjose added a note Nov 12, 2013

Update copyright:

/*
 * Copyright (c) 2013 Adobe Systems Incorporated. All rights reserved.
 *
 * Permission is hereby granted, free of charge, to any person obtaining a
 * copy of this software and associated documentation files (the "Software"),
 * to deal in the Software without restriction, including without limitation
 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
 * and/or sell copies of the Software, and to permit persons to whom the
 * Software is furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in
 * all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
 * DEALINGS IN THE SOFTWARE.
 */
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
@jasonsanjose jasonsanjose commented on an outdated diff Nov 12, 2013
appshell/CustomTitlebarView.m
@@ -0,0 +1,100 @@
+//
@jasonsanjose
Adobe Systems Incorporated member
jasonsanjose added a note Nov 12, 2013

Copyright again

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
@jasonsanjose jasonsanjose commented on an outdated diff Nov 13, 2013
appshell/client_handler_mac.mm
@@ -330,7 +265,7 @@ - (void)windowDidExitFullScreen:(NSNotification *)notification {
{
NSRect oldFrame = [controller.view frame];
NSRect newFrame = NSMakeRect(kTrafficLightsViewX, // x position
- parentFrame.size.height - oldFrame.size.height - kTrafficLightsViewY, // y position
+ parentFrame.size.height - oldFrame.size.height - 4, // y position
@jasonsanjose
Adobe Systems Incorporated member
jasonsanjose added a note Nov 13, 2013

Refactor 4 to a constant

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
@jasonsanjose
Adobe Systems Incorporated member

I did a high level review, but I can't say much about the Cocoa usage.

@redmunds redmunds commented on the diff Nov 13, 2013
appshell/CustomTitlebarView.m
@@ -0,0 +1,114 @@
+/*
@redmunds
redmunds added a note Nov 13, 2013

Why is this file extension .m and all the other Cocoa files seem to be .mm ?

@bobeast
bobeast added a note Nov 13, 2013

Generally speaking, only files which contain both Objective-C AND c++ should use the .mm extension. Purely Obj-C files should use .m. It really doesn't cause runtime issues either way, but over use of .mm does slow down compile times.

@redmunds
redmunds added a note Nov 13, 2013

@bobeast Thanks for the explanation. Now I know which files I shouldn't touch :) .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
@redmunds redmunds commented on an outdated diff Nov 13, 2013
appshell/CustomTitlebarView.m
+
+#define titleTextHeight 13
+
+@implementation CustomTitlebarView
+
+@synthesize titleString;
+
+- (void)drawRect:(NSRect)dirtyRect
+{
+ NSColorSpace *sRGB = [NSColorSpace sRGBColorSpace];
+ NSColor *fillColor = [NSColor colorWithColorSpace:sRGB components:fillComp count:4];
+ NSRect windowFrame = [NSWindow frameRectForContentRect:[[[self window] contentView] bounds] styleMask:[[self window] styleMask]];
+ NSRect contentBounds = [[[self window] contentView] bounds];
+
+ NSRect titlebarRect = NSMakeRect(0, 0, self.bounds.size.width, windowFrame.size.height - contentBounds.size.height);
+ titlebarRect.origin.y = self.bounds.size.height - titlebarRect.size.height;
@redmunds
redmunds added a note Nov 13, 2013

Fix indenting

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
@JeffryBooher JeffryBooher referenced this pull request Nov 13, 2013
Closed

Bobeast/no swizz #375

@redmunds redmunds was assigned Nov 13, 2013
@bobeast

Gestalt is deprecated as of 10.8. see the discussion in https://developer.apple.com/library/mac/releasenotes/AppKit/RN-AppKit/ regarding runtime version checking. Also should probably factor runtime version checking into its own method to avoid code duplication.

@bobeast
bobeast commented Nov 13, 2013

Once the dust settles, I highly recommend refactoring such that each class gets its own file pair, as opposed to placing multiple classes in a single file.

@redmunds

Merging.

@redmunds redmunds merged commit c8e714d into master Nov 14, 2013
@JeffryBooher JeffryBooher deleted the jeff/rework-dark-mac-from-bobeast branch Nov 14, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.