OLD | NEW |
---|---|
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "content/browser/renderer_host/render_widget_host_view_gtk.h" | 5 #include "content/browser/renderer_host/render_widget_host_view_gtk.h" |
6 | 6 |
7 // If this gets included after the gtk headers, then a bunch of compiler | 7 // If this gets included after the gtk headers, then a bunch of compiler |
8 // errors happen because of a "#define Status int" in Xlib.h, which interacts | 8 // errors happen because of a "#define Status int" in Xlib.h, which interacts |
9 // badly with net::URLRequestStatus::Status. | 9 // badly with net::URLRequestStatus::Status. |
10 #include "content/common/view_messages.h" | 10 #include "content/common/view_messages.h" |
(...skipping 1005 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1016 // attempts to drag past that edge we track the number of times it has | 1016 // attempts to drag past that edge we track the number of times it has |
1017 // occurred, so that we can force the widget to scroll when it otherwise | 1017 // occurred, so that we can force the widget to scroll when it otherwise |
1018 // would be unable to, by modifying the (x,y) position in the drag | 1018 // would be unable to, by modifying the (x,y) position in the drag |
1019 // event that we forward on to webkit. If we get a move that's no longer a | 1019 // event that we forward on to webkit. If we get a move that's no longer a |
1020 // drag or a drag indicating the user is no longer at that edge we stop | 1020 // drag or a drag indicating the user is no longer at that edge we stop |
1021 // altering the drag events. | 1021 // altering the drag events. |
1022 int new_dragged_at_horizontal_edge = 0; | 1022 int new_dragged_at_horizontal_edge = 0; |
1023 int new_dragged_at_vertical_edge = 0; | 1023 int new_dragged_at_vertical_edge = 0; |
1024 // Used for checking the edges of the monitor. We cache the values to save | 1024 // Used for checking the edges of the monitor. We cache the values to save |
1025 // roundtrips to the X server. | 1025 // roundtrips to the X server. |
1026 static gfx::Size drag_monitor_size; | 1026 CR_DEFINE_STATIC_LOCAL(gfx::Size, drag_monitor_size, ()); |
Mark Mentovai
2011/11/09 17:44:44
Separate this and the .gyp work into distinct chan
Nico
2011/11/09 18:16:02
Done.
| |
1027 if (event->state & GDK_BUTTON1_MASK) { | 1027 if (event->state & GDK_BUTTON1_MASK) { |
1028 if (drag_monitor_size.IsEmpty()) { | 1028 if (drag_monitor_size.IsEmpty()) { |
1029 // We can safely cache the monitor size for the duration of a drag. | 1029 // We can safely cache the monitor size for the duration of a drag. |
1030 GdkScreen* screen = gtk_widget_get_screen(widget); | 1030 GdkScreen* screen = gtk_widget_get_screen(widget); |
1031 int monitor = | 1031 int monitor = |
1032 gdk_screen_get_monitor_at_point(screen, event->x_root, event->y_root); | 1032 gdk_screen_get_monitor_at_point(screen, event->x_root, event->y_root); |
1033 GdkRectangle geometry; | 1033 GdkRectangle geometry; |
1034 gdk_screen_get_monitor_geometry(screen, monitor, &geometry); | 1034 gdk_screen_get_monitor_geometry(screen, monitor, &geometry); |
1035 drag_monitor_size.SetSize(geometry.width, geometry.height); | 1035 drag_monitor_size.SetSize(geometry.width, geometry.height); |
1036 } | 1036 } |
(...skipping 378 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1415 } | 1415 } |
1416 } | 1416 } |
1417 | 1417 |
1418 // static | 1418 // static |
1419 void RenderWidgetHostView::GetDefaultScreenInfo( | 1419 void RenderWidgetHostView::GetDefaultScreenInfo( |
1420 WebKit::WebScreenInfo* results) { | 1420 WebKit::WebScreenInfo* results) { |
1421 GdkWindow* gdk_window = | 1421 GdkWindow* gdk_window = |
1422 gdk_display_get_default_group(gdk_display_get_default()); | 1422 gdk_display_get_default_group(gdk_display_get_default()); |
1423 content::GetScreenInfoFromNativeWindow(gdk_window, results); | 1423 content::GetScreenInfoFromNativeWindow(gdk_window, results); |
1424 } | 1424 } |
OLD | NEW |