Chromium Code Reviews| Index: ui/aura/desktop_host_linux.cc |
| diff --git a/ui/aura/desktop_host_linux.cc b/ui/aura/desktop_host_linux.cc |
| index e20b1c57403bbeba3bf1b7d9e8b18aaec46642fc..cb00c7b2b18bb0cfbf235ef57132ba413ded4fea 100644 |
| --- a/ui/aura/desktop_host_linux.cc |
| +++ b/ui/aura/desktop_host_linux.cc |
| @@ -240,6 +240,7 @@ class DesktopHostLinux : public DesktopHost { |
| virtual void SetSize(const gfx::Size& size) OVERRIDE; |
| virtual void SetCursor(gfx::NativeCursor cursor_type) OVERRIDE; |
| virtual gfx::Point QueryMouseLocation() OVERRIDE; |
| + virtual void PostNativeEvent(const base::NativeEvent& event) OVERRIDE; |
| // Returns true if there's an X window manager present... in most cases. Some |
| // window managers (notably, ion3) don't implement enough of ICCCM for us to |
| @@ -481,6 +482,16 @@ gfx::Point DesktopHostLinux::QueryMouseLocation() { |
| max(0, min(size_.height(), win_y_return))); |
| } |
| +void DesktopHostLinux::PostNativeEvent(const base::NativeEvent& native_event) { |
| + DCHECK(xwindow_); |
| + Display* xdisplay = base::MessagePumpX::GetDefaultXDisplay(); |
|
sadrul
2011/11/18 21:46:54
Is there a reason to not use xdisplay_?
|
| + DCHECK(xdisplay); |
| + XEvent xevent = *native_event; |
| + xevent.xany.display = xdisplay; |
| + xevent.xany.window = xwindow_; |
| + ::XPutBackEvent(xdisplay, &xevent); |
| +} |
| + |
| bool DesktopHostLinux::IsWindowManagerPresent() { |
| // Per ICCCM 2.8, "Manager Selections", window managers should take ownership |
| // of WM_Sn selections (where n is a screen number). |