]> khamidou — GitHub mirrors - electron.git/commitdiff
Switched to `gfx::Rect` constructor that takes a RECT
authorSeppe Stas <seppestas@gmail.com>
Mon, 8 Jun 2015 17:04:56 +0000 (19:04 +0200)
committerSeppe Stas <seppestas@gmail.com>
Mon, 8 Jun 2015 17:04:56 +0000 (19:04 +0200)
As per @zcbenz's suggestion the rect passed to the click event handler now passes a rect constructed using `gfx::Rect(const RECT& r)`.

atom/browser/ui/win/notify_icon.cc

index d319539823cc595a4e97b54f3b6fac630525753e..473a2bcac8d484df2a958cc92dcecccdf49d5792 100644 (file)
@@ -58,9 +58,7 @@ void NotifyIcon::HandleClickEvent(const gfx::Point& cursor_pos,
     RECT rect;
     Shell_NotifyIconGetRect(&icon_id, &rect);
 
-    int width = rect.right - rect.left;
-    int height = rect.bottom - rect.top;
-    NotifyClicked(gfx::Rect(rect.left, rect.top, width, height));
+    NotifyClicked(gfx::Rect(rect));
     return;
   }