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

Unified Diff: ui/views/test/widget_test_aura.cc

Issue 1059853007: Mac/Linux: Ensure window size constraints propagate to the window server during Init (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Cracked the case on Windows Created 5 years, 8 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 | « ui/views/test/widget_test.h ('k') | ui/views/test/widget_test_mac.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/test/widget_test_aura.cc
diff --git a/ui/views/test/widget_test_aura.cc b/ui/views/test/widget_test_aura.cc
index 822ea98e8be301cd131972aadd96235e85d2e96e..778f1f0c99af09ebab14fb07236261a0ff677b4f 100644
--- a/ui/views/test/widget_test_aura.cc
+++ b/ui/views/test/widget_test_aura.cc
@@ -8,6 +8,11 @@
#include "ui/aura/window_tree_host.h"
#include "ui/views/widget/widget.h"
+#if defined(USE_X11)
+#include <X11/Xutil.h>
+#include "ui/gfx/x/x11_types.h"
+#endif
+
namespace views {
namespace test {
@@ -66,6 +71,27 @@ bool WidgetTest::IsWindowStackedAbove(Widget* above, Widget* below) {
}
// static
+gfx::Size WidgetTest::GetNativeWidgetMinimumContentSize(Widget* widget) {
+ // On Windows, HWNDMessageHandler receives a WM_GETMINMAXINFO message whenever
+ // the window manager is interested in knowing the size constraints. On
+ // ChromeOS, it's handled internally. Elsewhere, the size constraints need to
+ // be pushed to the window server when they change.
+#if defined(OS_CHROMEOS) || defined(OS_WIN)
+ return widget->GetNativeWindow()->delegate()->GetMinimumSize();
+#elif defined(USE_X11)
+ XSizeHints hints;
+ long supplied_return;
+ XGetWMNormalHints(
+ gfx::GetXDisplay(),
+ widget->GetNativeWindow()->GetHost()->GetAcceleratedWidget(), &hints,
+ &supplied_return);
+ return gfx::Size(hints.min_width, hints.min_height);
+#else
+ NOTREACHED();
+#endif
+}
+
+// static
ui::EventProcessor* WidgetTest::GetEventProcessor(Widget* widget) {
return widget->GetNativeWindow()->GetHost()->event_processor();
}
« no previous file with comments | « ui/views/test/widget_test.h ('k') | ui/views/test/widget_test_mac.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698