| 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 "chrome/browser/ui/gtk/browser_window_gtk.h" | 5 #include "chrome/browser/ui/gtk/browser_window_gtk.h" |
| 6 | 6 |
| 7 #include <gdk/gdkkeysyms.h> | 7 #include <gdk/gdkkeysyms.h> |
| 8 | 8 |
| 9 #include <dlfcn.h> | 9 #include <dlfcn.h> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 2057 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2068 int win_x, win_y; | 2068 int win_x, win_y; |
| 2069 gdk_window_get_origin(GTK_WIDGET(window_)->window, &win_x, &win_y); | 2069 gdk_window_get_origin(GTK_WIDGET(window_)->window, &win_x, &win_y); |
| 2070 | 2070 |
| 2071 GdkWindowEdge edge; | 2071 GdkWindowEdge edge; |
| 2072 gfx::Point point(static_cast<int>(event->x_root - win_x), | 2072 gfx::Point point(static_cast<int>(event->x_root - win_x), |
| 2073 static_cast<int>(event->y_root - win_y)); | 2073 static_cast<int>(event->y_root - win_y)); |
| 2074 bool has_hit_edge = GetWindowEdge(point.x(), point.y(), &edge); | 2074 bool has_hit_edge = GetWindowEdge(point.x(), point.y(), &edge); |
| 2075 | 2075 |
| 2076 // Ignore clicks that are in/below the browser toolbar. | 2076 // Ignore clicks that are in/below the browser toolbar. |
| 2077 GtkWidget* toolbar = toolbar_->widget(); | 2077 GtkWidget* toolbar = toolbar_->widget(); |
| 2078 if (!GTK_WIDGET_VISIBLE(toolbar)) { | 2078 if (!gtk_widget_get_visible(toolbar)) { |
| 2079 // If the toolbar is not showing, use the location of web contents as the | 2079 // If the toolbar is not showing, use the location of web contents as the |
| 2080 // boundary of where to ignore clicks. | 2080 // boundary of where to ignore clicks. |
| 2081 toolbar = render_area_vbox_; | 2081 toolbar = render_area_vbox_; |
| 2082 } | 2082 } |
| 2083 gint toolbar_y; | 2083 gint toolbar_y; |
| 2084 gtk_widget_get_pointer(toolbar, NULL, &toolbar_y); | 2084 gtk_widget_get_pointer(toolbar, NULL, &toolbar_y); |
| 2085 bool has_hit_titlebar = !IsFullscreen() && (toolbar_y < 0) | 2085 bool has_hit_titlebar = !IsFullscreen() && (toolbar_y < 0) |
| 2086 && !has_hit_edge; | 2086 && !has_hit_edge; |
| 2087 if (event->button == 1) { | 2087 if (event->button == 1) { |
| 2088 if (GDK_BUTTON_PRESS == event->type) { | 2088 if (GDK_BUTTON_PRESS == event->type) { |
| (...skipping 267 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2356 // are taken from the WMs' source code. | 2356 // are taken from the WMs' source code. |
| 2357 return (wm_name == "Blackbox" || | 2357 return (wm_name == "Blackbox" || |
| 2358 wm_name == "compiz" || | 2358 wm_name == "compiz" || |
| 2359 wm_name == "Compiz" || | 2359 wm_name == "Compiz" || |
| 2360 wm_name == "e16" || // Enlightenment DR16 | 2360 wm_name == "e16" || // Enlightenment DR16 |
| 2361 wm_name == "Metacity" || | 2361 wm_name == "Metacity" || |
| 2362 wm_name == "Mutter" || | 2362 wm_name == "Mutter" || |
| 2363 wm_name == "Openbox" || | 2363 wm_name == "Openbox" || |
| 2364 wm_name == "Xfwm4"); | 2364 wm_name == "Xfwm4"); |
| 2365 } | 2365 } |
| OLD | NEW |