Do not render full screen windows as inactive

The text view itself will still dim the selection, but document tabs, status, and tool bars no longer change colors.

This seems consistent with how Apple’s controls act and is necessary for the status bar since it draws a transparent gradient over the window background, so only its borders got the dimmed look.
This commit is contained in:
Allan Odgaard
2014-04-12 11:07:00 +07:00
parent d1bce2ac4f
commit 6e619ad14c
3 changed files with 4 additions and 4 deletions

View File

@@ -205,7 +205,7 @@ OAK_DEBUG_VAR(OakControl);
if(states[i].active)
res |= states[i].requisite;
}
if(res & layer_t::window_main || res & layer_t::window_key)
if(res & layer_t::window_main || res & layer_t::window_key || [[self window] styleMask] & NSFullScreenWindowMask)
res |= layer_t::window_main_or_key;
return res;
}

View File

@@ -47,7 +47,7 @@
- (void)tmWindowDidChangeStatus:(NSNotification*)aNotification
{
self.renderInactive = ![self.window isKeyWindow] && ![self.window isMainWindow];
self.renderInactive = !([self.window styleMask] & NSFullScreenWindowMask) && ![self.window isKeyWindow] && ![self.window isMainWindow];
}
- (void)setRenderInactive:(BOOL)flag

View File

@@ -134,12 +134,12 @@ NSComboBox* OakCreateComboBox (NSObject* accessibilityLabel)
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(windowDidChangeMainOrKey:) name:NSWindowDidResignKeyNotification object:newWindow];
}
self.usePrimaryColor = [newWindow isMainWindow] || [newWindow isKeyWindow];
self.usePrimaryColor = ([newWindow styleMask] & NSFullScreenWindowMask) || [newWindow isMainWindow] || [newWindow isKeyWindow];
}
- (void)windowDidChangeMainOrKey:(NSNotification*)aNotification
{
self.usePrimaryColor = [self.window isMainWindow] || [self.window isKeyWindow];
self.usePrimaryColor = ([self.window styleMask] & NSFullScreenWindowMask) || [self.window isMainWindow] || [self.window isKeyWindow];
}
- (void)setUsePrimaryColor:(BOOL)flag