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

Unified Diff: views/window/window_gtk.cc

Issue 160474: Status bubble limping in TOOLKIT_VIEWS.... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 11 years, 5 months 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « views/widget/widget_win.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: views/window/window_gtk.cc
===================================================================
--- views/window/window_gtk.cc (revision 22173)
+++ views/window/window_gtk.cc (working copy)
@@ -7,6 +7,7 @@
#include "app/gfx/path.h"
#include "app/l10n_util.h"
#include "base/gfx/rect.h"
+#include "views/screen.h"
#include "views/widget/root_view.h"
#include "views/window/custom_frame_view.h"
#include "views/window/hit_test.h"
@@ -70,19 +71,6 @@
return GDK_ARROW;
}
-gfx::Rect GetScreenWorkArea(GdkWindow* window) {
- guchar* raw_data = NULL;
- gint data_len = 0;
- gboolean success = gdk_property_get(gdk_get_default_root_window(),
- gdk_atom_intern("_NET_WORKAREA", FALSE),
- gdk_atom_intern("CARDINAL", FALSE),
- 0, 0xFF, false, NULL, NULL, &data_len,
- &raw_data);
- DCHECK(success);
- glong* data = reinterpret_cast<glong*>(raw_data);
- return gfx::Rect(data[0], data[1], data[0] + data[2], data[1] + data[3]);
-}
-
} // namespace
namespace views {
@@ -442,7 +430,7 @@
center_rect = gfx::Rect(parent_x, parent_y, parent_w, parent_h);
} else {
// We have no parent window, center over the screen.
- center_rect = GetScreenWorkArea(GTK_WIDGET(GetNativeWindow())->window);
+ center_rect = Screen::GetMonitorWorkAreaNearestWindow(GetNativeWindow());
}
gfx::Size size = non_client_view_->GetPreferredSize();
gfx::Rect bounds(center_rect.x() + (center_rect.width() - size.width()) / 2,
« no previous file with comments | « views/widget/widget_win.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698