| OLD | NEW |
| 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 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 192 XSizeHints size_hints; | 192 XSizeHints size_hints; |
| 193 size_hints.flags = PPosition | PWinGravity; | 193 size_hints.flags = PPosition | PWinGravity; |
| 194 size_hints.x = requested_bounds_.x(); | 194 size_hints.x = requested_bounds_.x(); |
| 195 size_hints.y = requested_bounds_.y(); | 195 size_hints.y = requested_bounds_.y(); |
| 196 // Set StaticGravity so that the window position is not affected by the | 196 // Set StaticGravity so that the window position is not affected by the |
| 197 // frame width when running with window manager. | 197 // frame width when running with window manager. |
| 198 size_hints.win_gravity = StaticGravity; | 198 size_hints.win_gravity = StaticGravity; |
| 199 XSetWMNormalHints(xdisplay_, xwindow_, &size_hints); | 199 XSetWMNormalHints(xdisplay_, xwindow_, &size_hints); |
| 200 | 200 |
| 201 // TODO(sky): provide real scale factor. | 201 // TODO(sky): provide real scale factor. |
| 202 delegate_->OnAcceleratedWidgetAvailable(xwindow_); | 202 delegate_->OnAcceleratedWidgetAvailable(xwindow_, 1.f); |
| 203 | 203 |
| 204 XMapWindow(xdisplay_, xwindow_); | 204 XMapWindow(xdisplay_, xwindow_); |
| 205 | 205 |
| 206 // We now block until our window is mapped. Some X11 APIs will crash and | 206 // We now block until our window is mapped. Some X11 APIs will crash and |
| 207 // burn if passed |xwindow_| before the window is mapped, and XMapWindow is | 207 // burn if passed |xwindow_| before the window is mapped, and XMapWindow is |
| 208 // asynchronous. | 208 // asynchronous. |
| 209 if (X11EventSource::GetInstance()) | 209 if (X11EventSource::GetInstance()) |
| 210 X11EventSource::GetInstance()->BlockUntilWindowMapped(xwindow_); | 210 X11EventSource::GetInstance()->BlockUntilWindowMapped(xwindow_); |
| 211 window_mapped_ = true; | 211 window_mapped_ = true; |
| 212 } | 212 } |
| (...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 359 | 359 |
| 360 case GenericEvent: { | 360 case GenericEvent: { |
| 361 ProcessXInput2Event(xev); | 361 ProcessXInput2Event(xev); |
| 362 break; | 362 break; |
| 363 } | 363 } |
| 364 } | 364 } |
| 365 return POST_DISPATCH_STOP_PROPAGATION; | 365 return POST_DISPATCH_STOP_PROPAGATION; |
| 366 } | 366 } |
| 367 | 367 |
| 368 } // namespace ui | 368 } // namespace ui |
| OLD | NEW |