summaryrefslogtreecommitdiffstats
path: root/chrome/views
diff options
context:
space:
mode:
authorpkasting@chromium.org <pkasting@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-02-24 18:43:06 +0000
committerpkasting@chromium.org <pkasting@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-02-24 18:43:06 +0000
commit5c255c73128dba206e9f2101e00ed73df09a70ee (patch)
tree3514f53a0c4db31b6cee66d617d0d2a55ae16ba1 /chrome/views
parentb0f16b6c2d73f55512dade4545d448daa9bb57c0 (diff)
downloadchromium_src-5c255c73128dba206e9f2101e00ed73df09a70ee.zip
chromium_src-5c255c73128dba206e9f2101e00ed73df09a70ee.tar.gz
chromium_src-5c255c73128dba206e9f2101e00ed73df09a70ee.tar.bz2
Maximized popup windows couldn't be restored by double-clicking the titlebar, because we gofed up the coordinate transforms while adding nonclient button handling to WidgetWin.
Review URL: http://codereview.chromium.org/27095 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@10272 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/views')
-rw-r--r--chrome/views/widget_win.cc9
1 files changed, 7 insertions, 2 deletions
diff --git a/chrome/views/widget_win.cc b/chrome/views/widget_win.cc
index 0c8b6b7..47edf1b 100644
--- a/chrome/views/widget_win.cc
+++ b/chrome/views/widget_win.cc
@@ -723,9 +723,14 @@ bool WidgetWin::ProcessMousePressed(const CPoint& point,
bool dbl_click,
bool non_client) {
last_mouse_event_was_move_ = false;
+ // Windows gives screen coordinates for nonclient events, while the RootView
+ // expects window coordinates; convert if necessary.
+ gfx::Point converted_point(point);
+ if (non_client)
+ View::ConvertPointToView(NULL, root_view_.get(), &converted_point);
MouseEvent mouse_pressed(Event::ET_MOUSE_PRESSED,
- point.x,
- point.y,
+ converted_point.x(),
+ converted_point.y(),
(dbl_click ? MouseEvent::EF_IS_DOUBLE_CLICK : 0) |
(non_client ? MouseEvent::EF_IS_NON_CLIENT : 0) |
Event::ConvertWindowsFlags(flags));