From c6cf91d11f6e570d513e592dfbceafe79a79ca77 Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Mon, 27 Apr 2015 12:08:22 +0800 Subject: [PATCH] Add 'disable-auto-hide-cursor' option --- atom/browser/native_window_mac.mm | 6 ++++++ atom/common/options_switches.cc | 3 +++ atom/common/options_switches.h | 1 + 3 files changed, 10 insertions(+) diff --git a/atom/browser/native_window_mac.mm b/atom/browser/native_window_mac.mm index 12a147ebc2b..b7eccd2a6c7 100644 --- a/atom/browser/native_window_mac.mm +++ b/atom/browser/native_window_mac.mm @@ -152,6 +152,7 @@ static const CGFloat kAtomWindowCornerRadius = 4.0; bool enable_larger_than_screen_; } @property BOOL acceptsFirstMouse; +@property BOOL disableAutoHideCursor; - (void)setShell:(atom::NativeWindowMac*)shell; - (void)setEnableLargerThanScreen:(bool)enable; @end @@ -347,6 +348,11 @@ NativeWindowMac::NativeWindowMac(content::WebContents* web_contents, options.Get(switches::kAcceptFirstMouse, &acceptsFirstMouse); [window_ setAcceptsFirstMouse:acceptsFirstMouse]; + // Disable auto-hiding cursor. + bool disableAutoHideCursor = false; + options.Get(switches::kDisableAutoHideCursor, &disableAutoHideCursor); + [window_ setDisableAutoHideCursor:disableAutoHideCursor]; + // Disable fullscreen button when 'fullscreen' is specified to false. bool fullscreen; if (!(options.Get(switches::kFullscreen, &fullscreen) && diff --git a/atom/common/options_switches.cc b/atom/common/options_switches.cc index f67a6456964..c479b5004d0 100644 --- a/atom/common/options_switches.cc +++ b/atom/common/options_switches.cc @@ -75,6 +75,9 @@ const char kTransparent[] = "transparent"; // Window type hint. const char kType[] = "type"; +// Disable auto-hiding cursor. +const char kDisableAutoHideCursor[] = "disable-auto-hide-cursor"; + // Web runtime features. const char kExperimentalFeatures[] = "experimental-features"; const char kExperimentalCanvasFeatures[] = "experimental-canvas-features"; diff --git a/atom/common/options_switches.h b/atom/common/options_switches.h index 967f6263873..546c6a04eb4 100644 --- a/atom/common/options_switches.h +++ b/atom/common/options_switches.h @@ -41,6 +41,7 @@ extern const char kGuestInstanceID[]; extern const char kPreloadScript[]; extern const char kTransparent[]; extern const char kType[]; +extern const char kDisableAutoHideCursor[]; extern const char kExperimentalFeatures[]; extern const char kExperimentalCanvasFeatures[];