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

Side by Side Diff: ui/platform_window/x11/x11_window.cc

Issue 1305893006: view-manager: Fix some issues regarding running tests in x11. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 5 years, 3 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 unified diff | Download patch
« no previous file with comments | « mojo/tools/data/apptests ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "ui/platform_window/x11/x11_window.h" 5 #include "ui/platform_window/x11/x11_window.h"
6 6
7 #include <X11/extensions/XInput2.h> 7 #include <X11/extensions/XInput2.h>
8 #include <X11/Xatom.h> 8 #include <X11/Xatom.h>
9 #include <X11/Xlib.h> 9 #include <X11/Xlib.h>
10 #include <X11/Xutil.h> 10 #include <X11/Xutil.h>
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after
193 // will ignore toplevel XMoveWindow commands. 193 // will ignore toplevel XMoveWindow commands.
194 XSizeHints size_hints; 194 XSizeHints size_hints;
195 size_hints.flags = PPosition | PWinGravity; 195 size_hints.flags = PPosition | PWinGravity;
196 size_hints.x = requested_bounds_.x(); 196 size_hints.x = requested_bounds_.x();
197 size_hints.y = requested_bounds_.y(); 197 size_hints.y = requested_bounds_.y();
198 // Set StaticGravity so that the window position is not affected by the 198 // Set StaticGravity so that the window position is not affected by the
199 // frame width when running with window manager. 199 // frame width when running with window manager.
200 size_hints.win_gravity = StaticGravity; 200 size_hints.win_gravity = StaticGravity;
201 XSetWMNormalHints(xdisplay_, xwindow_, &size_hints); 201 XSetWMNormalHints(xdisplay_, xwindow_, &size_hints);
202 202
203 // TODO(sky): provide real scale factor.
204 delegate_->OnAcceleratedWidgetAvailable(xwindow_, 1.f);
205
206 XMapWindow(xdisplay_, xwindow_); 203 XMapWindow(xdisplay_, xwindow_);
207 204
208 // We now block until our window is mapped. Some X11 APIs will crash and 205 // We now block until our window is mapped. Some X11 APIs will crash and
209 // burn if passed |xwindow_| before the window is mapped, and XMapWindow is 206 // burn if passed |xwindow_| before the window is mapped, and XMapWindow is
210 // asynchronous. 207 // asynchronous.
211 if (X11EventSource::GetInstance()) 208 if (X11EventSource::GetInstance())
212 X11EventSource::GetInstance()->BlockUntilWindowMapped(xwindow_); 209 X11EventSource::GetInstance()->BlockUntilWindowMapped(xwindow_);
213 window_mapped_ = true; 210 window_mapped_ = true;
211
212 // TODO(sky): provide real scale factor.
213 delegate_->OnAcceleratedWidgetAvailable(xwindow_, 1.f);
214 } 214 }
215 215
216 void X11Window::Hide() { 216 void X11Window::Hide() {
217 if (!window_mapped_) 217 if (!window_mapped_)
218 return; 218 return;
219 XWithdrawWindow(xdisplay_, xwindow_, 0); 219 XWithdrawWindow(xdisplay_, xwindow_, 0);
220 window_mapped_ = false; 220 window_mapped_ = false;
221 } 221 }
222 222
223 void X11Window::Close() { 223 void X11Window::Close() {
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after
372 } 372 }
373 373
374 namespace test { 374 namespace test {
375 375
376 void SetUseOverrideRedirectWindowByDefault(bool override_redirect) { 376 void SetUseOverrideRedirectWindowByDefault(bool override_redirect) {
377 g_override_redirect = override_redirect; 377 g_override_redirect = override_redirect;
378 } 378 }
379 379
380 } // namespace test 380 } // namespace test
381 } // namespace ui 381 } // namespace ui
OLDNEW
« no previous file with comments | « mojo/tools/data/apptests ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698