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

Unified Diff: ui/aura/desktop_host_linux.cc

Issue 8374005: aura: Try to make Linux host resize code more reliable. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: minor cleanup Created 9 years, 2 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 | « no previous file | ui/aura/window_unittest.cc » ('j') | ui/aura/window_unittest.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/aura/desktop_host_linux.cc
diff --git a/ui/aura/desktop_host_linux.cc b/ui/aura/desktop_host_linux.cc
index ed47ca21dad976628412990014f2c581be1e0b07..a90dc67a538ddf93c2153d09f3c410ab8f862922 100644
--- a/ui/aura/desktop_host_linux.cc
+++ b/ui/aura/desktop_host_linux.cc
@@ -377,14 +377,24 @@ gfx::AcceleratedWidget DesktopHostLinux::GetAcceleratedWidget() {
void DesktopHostLinux::Show() {
XMapWindow(xdisplay_, xwindow_);
+ // Wait for notification that the window is mapped, which happens
+ // asynchronously if there's a window manager running. Ideally we wouldn't
+ // need to wait for this, but some window managers don't do anything to let us
+ // know that they're there (*cough*ion3*cough*), in which case we need to make
+ // sure that the window is mapped before sending a SetInputFocus request.
+ while (true) {
+ XEvent event;
+ XWindowEvent(xdisplay_, xwindow_, StructureNotifyMask, &event);
+ if (event.type == MapNotify)
+ break;
+ }
+
// If there's no window manager running, we need to assign the X input focus
- // to our host window. (If there's no window manager running, it should also
- // be safe to assume that the host window will have been mapped by the time
- // that our SetInputFocus request is received.)
- if (!IsWindowManagerPresent())
+ // to our host window.
+ if (!IsWindowManagerPresent()) {
XSetInputFocus(xdisplay_, xwindow_, RevertToNone, CurrentTime);
-
- XFlush(xdisplay_);
+ XFlush(xdisplay_);
+ }
}
gfx::Size DesktopHostLinux::GetSize() const {
« no previous file with comments | « no previous file | ui/aura/window_unittest.cc » ('j') | ui/aura/window_unittest.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698