| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "views/widget/widget_gtk.h" | 5 #include "views/widget/widget_gtk.h" |
| 6 | 6 |
| 7 #include <gdk/gdk.h> | 7 #include <gdk/gdk.h> |
| 8 #include <gdk/gdkx.h> | 8 #include <gdk/gdkx.h> |
| 9 #include <X11/extensions/shape.h> | 9 #include <X11/extensions/shape.h> |
| 10 | 10 |
| (...skipping 1092 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1103 // ignoring the 2press/3press events as they are duplicate. To make this | 1103 // ignoring the 2press/3press events as they are duplicate. To make this |
| 1104 // work right we need to write our own code that detects if the press is a | 1104 // work right we need to write our own code that detects if the press is a |
| 1105 // double/triple. For now we're completely punting, which means we always | 1105 // double/triple. For now we're completely punting, which means we always |
| 1106 // get single clicks. | 1106 // get single clicks. |
| 1107 // TODO: fix this. | 1107 // TODO: fix this. |
| 1108 return true; | 1108 return true; |
| 1109 } | 1109 } |
| 1110 | 1110 |
| 1111 // An event may come from a contained widget which has its own gdk window. | 1111 // An event may come from a contained widget which has its own gdk window. |
| 1112 // Translate it to the widget's coordinates. | 1112 // Translate it to the widget's coordinates. |
| 1113 int x, y; | 1113 int x = 0; |
| 1114 int y = 0; |
| 1114 GetContainedWidgetEventCoordinates(event, &x, &y); | 1115 GetContainedWidgetEventCoordinates(event, &x, &y); |
| 1115 last_mouse_event_was_move_ = false; | 1116 last_mouse_event_was_move_ = false; |
| 1116 MouseEvent mouse_pressed(Event::ET_MOUSE_PRESSED, x, y, | 1117 MouseEvent mouse_pressed(Event::ET_MOUSE_PRESSED, x, y, |
| 1117 GetFlagsForEventButton(*event)); | 1118 GetFlagsForEventButton(*event)); |
| 1118 | 1119 |
| 1119 if (root_view_->OnMousePressed(mouse_pressed)) { | 1120 if (root_view_->OnMousePressed(mouse_pressed)) { |
| 1120 is_mouse_down_ = true; | 1121 is_mouse_down_ = true; |
| 1121 if (!has_capture_) | 1122 if (!has_capture_) |
| 1122 DoGrab(); | 1123 DoGrab(); |
| 1123 return true; | 1124 return true; |
| (...skipping 302 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1426 GtkWindow* window = GTK_WINDOW(element->data); | 1427 GtkWindow* window = GTK_WINDOW(element->data); |
| 1427 DCHECK(window); | 1428 DCHECK(window); |
| 1428 RootView *root_view = FindRootView(window); | 1429 RootView *root_view = FindRootView(window); |
| 1429 if (root_view) | 1430 if (root_view) |
| 1430 root_view->NotifyLocaleChanged(); | 1431 root_view->NotifyLocaleChanged(); |
| 1431 } | 1432 } |
| 1432 g_list_free(window_list); | 1433 g_list_free(window_list); |
| 1433 } | 1434 } |
| 1434 | 1435 |
| 1435 } // namespace views | 1436 } // namespace views |
| OLD | NEW |