OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "remoting/client/x11_view.h" | 5 #include "remoting/client/x11_view.h" |
6 | 6 |
7 #include <X11/Xlib.h> | 7 #include <X11/Xlib.h> |
8 #include <X11/Xutil.h> | 8 #include <X11/Xutil.h> |
9 #include <X11/extensions/Xrender.h> | 9 #include <X11/extensions/Xrender.h> |
10 #include <X11/extensions/Xcomposite.h> | 10 #include <X11/extensions/Xcomposite.h> |
(...skipping 25 matching lines...) Loading... |
36 int root_window = RootWindow(display_, screen); | 36 int root_window = RootWindow(display_, screen); |
37 | 37 |
38 // Creates the window. | 38 // Creates the window. |
39 window_ = XCreateSimpleWindow(display_, root_window, 1, 1, 640, 480, 0, | 39 window_ = XCreateSimpleWindow(display_, root_window, 1, 1, 640, 480, 0, |
40 BlackPixel(display_, screen), | 40 BlackPixel(display_, screen), |
41 BlackPixel(display_, screen)); | 41 BlackPixel(display_, screen)); |
42 DCHECK(window_); | 42 DCHECK(window_); |
43 XStoreName(display_, window_, "X11 Remoting"); | 43 XStoreName(display_, window_, "X11 Remoting"); |
44 | 44 |
45 // Specifies what kind of messages we want to receive. | 45 // Specifies what kind of messages we want to receive. |
46 XSelectInput(display_, window_, ExposureMask | ButtonPressMask); | 46 XSelectInput(display_, |
| 47 window_, |
| 48 ExposureMask |
| 49 | KeyPressMask | KeyReleaseMask |
| 50 | ButtonPressMask | ButtonReleaseMask |
| 51 | PointerMotionMask); |
| 52 |
47 XMapWindow(display_, window_); | 53 XMapWindow(display_, window_); |
48 return true; | 54 return true; |
49 } | 55 } |
50 | 56 |
51 void X11View::TearDown() { | 57 void X11View::TearDown() { |
52 if (display_ && window_) { | 58 if (display_ && window_) { |
53 // Shutdown the window system. | 59 // Shutdown the window system. |
54 XDestroyWindow(display_, window_); | 60 XDestroyWindow(display_, window_); |
55 XCloseDisplay(display_); | 61 XCloseDisplay(display_); |
56 } | 62 } |
(...skipping 150 matching lines...) Loading... |
207 XEvent event; | 213 XEvent event; |
208 event.type = Expose; | 214 event.type = Expose; |
209 XSendEvent(display_, static_cast<int>(window_), true, ExposureMask, &event); | 215 XSendEvent(display_, static_cast<int>(window_), true, ExposureMask, &event); |
210 } | 216 } |
211 | 217 |
212 void X11View::OnDecodeDone() { | 218 void X11View::OnDecodeDone() { |
213 // Since we do synchronous decoding here there's nothing in this method. | 219 // Since we do synchronous decoding here there's nothing in this method. |
214 } | 220 } |
215 | 221 |
216 } // namespace remoting | 222 } // namespace remoting |
OLD | NEW |