]> khamidou — GitHub mirrors - electron.git/commitdiff
chnage move hook and add details to doc
authorRobo <hop2deep@gmail.com>
Sun, 10 May 2015 03:44:18 +0000 (09:14 +0530)
committerdeepak1556 <hop2deep@gmail.com>
Fri, 22 May 2015 06:43:01 +0000 (12:13 +0530)
atom/browser/native_window_views.cc
atom/browser/native_window_views.h
docs/api/browser-window.md

index 29e480ce738218bfc1b36505db72c3cb4d57923b..630c7e086f60bbde85b24ae13af4cafa05b3a4a0 100644 (file)
@@ -729,11 +729,6 @@ void NativeWindowViews::OnWidgetBoundsChanged(
     NotifyWindowResize();
     widget_size_ = bounds.size();
   }
-
-  if (widget_pos_ != bounds.origin()) {
-    NotifyWindowMove();
-    widget_pos_ = bounds.origin();
-  }
 }
 
 void NativeWindowViews::DeleteDelegate() {
@@ -823,6 +818,10 @@ views::NonClientFrameView* NativeWindowViews::CreateNonClientFrameView(
 #endif
 }
 
+void NativeWindowViews::OnWidgetMove() {
+  NotifyWindowMove();
+}
+
 #if defined(OS_WIN)
 bool NativeWindowViews::ExecuteWindowsCommand(int command_id) {
   // Windows uses the 4 lower order bits of |command_id| for type-specific
index 88d2c78eee2df5c9125bbaa3ebf4de38692fa662..aa694f053734bcfecf0084cc67ffb0be9149e076 100644 (file)
@@ -115,6 +115,7 @@ class NativeWindowViews : public NativeWindow,
   views::ClientView* CreateClientView(views::Widget* widget) override;
   views::NonClientFrameView* CreateNonClientFrameView(
       views::Widget* widget) override;
+  void OnWidgetMove() override;
 #if defined(OS_WIN)
   bool ExecuteWindowsCommand(int command_id) override;
 #endif
@@ -176,7 +177,6 @@ class NativeWindowViews : public NativeWindow,
   gfx::Size minimum_size_;
   gfx::Size maximum_size_;
   gfx::Size widget_size_;
-  gfx::Point widget_pos_;
 
   scoped_ptr<SkRegion> draggable_region_;
 
index d95baa5deb90456503e703c716cfb0d54563f1e3..00e2ceb46945350acf47c7248b11bbee6adf5d41 100644 (file)
@@ -173,11 +173,12 @@ Emitted when window is restored from minimized state.
 
 ### Event: 'resize'
 
-Emitted when window is resized.
+Emitted when window is getting resized on all platforms.
 
 ### Event: 'move'
 
-Emitted when window is moved.
+Emitted once when the window is moved to a new position on `OSX` and emitted during the process 
+of moving on `Linux` and `Windows`.
 
 ### Event: 'enter-full-screen'