]> khamidou — GitHub mirrors - electron.git/commitdiff
Add 'disable-auto-hide-cursor' option
authorCheng Zhao <zcbenz@gmail.com>
Mon, 27 Apr 2015 04:08:22 +0000 (12:08 +0800)
committerCheng Zhao <zcbenz@gmail.com>
Wed, 29 Apr 2015 02:26:31 +0000 (10:26 +0800)
atom/browser/native_window_mac.mm
atom/common/options_switches.cc
atom/common/options_switches.h

index 12a147ebc2b339226bb6be9fc2a8814ebc1e46a1..b7eccd2a6c7c58e6d9bdb487821e1203c3289876 100644 (file)
@@ -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) &&
index f67a6456964cc378f66bac53f64a0dc038981781..c479b5004d076045c1d84cf4299c8eed1ae2d1d5 100644 (file)
@@ -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";
index 967f626387335939218c08871f23392dca2ac06d..546c6a04eb4d931a62e5931817fc35683bf5d584 100644 (file)
@@ -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[];