Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(102)

Side by Side Diff: views/screen_gtk.cc

Issue 328012: Makes it so that when a folder is open on the bookmark bar and the... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « views/screen.h ('k') | views/screen_win.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 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/screen.h" 5 #include "views/screen.h"
6 6
7 #include <gtk/gtk.h> 7 #include <gtk/gtk.h>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 10
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
51 51
52 // static 52 // static
53 gfx::Rect Screen::GetMonitorAreaNearestPoint(const gfx::Point& point) { 53 gfx::Rect Screen::GetMonitorAreaNearestPoint(const gfx::Point& point) {
54 GdkScreen* screen = gdk_screen_get_default(); 54 GdkScreen* screen = gdk_screen_get_default();
55 gint monitor = gdk_screen_get_monitor_at_point(screen, point.x(), point.y()); 55 gint monitor = gdk_screen_get_monitor_at_point(screen, point.x(), point.y());
56 GdkRectangle bounds; 56 GdkRectangle bounds;
57 gdk_screen_get_monitor_geometry(screen, monitor, &bounds); 57 gdk_screen_get_monitor_geometry(screen, monitor, &bounds);
58 return gfx::Rect(bounds); 58 return gfx::Rect(bounds);
59 } 59 }
60 60
61 gfx::NativeWindow Screen::GetWindowAtCursorScreenPoint() {
62 GdkWindow* window = gdk_window_at_pointer(NULL, NULL);
63 if (!window)
64 return NULL;
65
66 gpointer data = NULL;
67 gdk_window_get_user_data(window, &data);
68 GtkWidget* widget = reinterpret_cast<GtkWidget*>(data);
69 if (!widget)
70 return NULL;
71 widget = gtk_widget_get_toplevel(widget);
72 return GTK_IS_WINDOW(widget) ? GTK_WINDOW(widget) : NULL;
73 }
74
61 } // namespace 75 } // namespace
62 76
OLDNEW
« no previous file with comments | « views/screen.h ('k') | views/screen_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698