OLD | NEW |
---|---|
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/aura/desktop_host.h" | 5 #include "ui/aura/desktop_host.h" |
6 | 6 |
7 #include <X11/cursorfont.h> | 7 #include <X11/cursorfont.h> |
8 #include <X11/Xlib.h> | 8 #include <X11/Xlib.h> |
9 | 9 |
10 // Get rid of a macro from Xlib.h that conflicts with Aura's RootWindow class. | 10 // Get rid of a macro from Xlib.h that conflicts with Aura's RootWindow class. |
(...skipping 449 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
460 break; | 460 break; |
461 } | 461 } |
462 case MapNotify: { | 462 case MapNotify: { |
463 // If there's no window manager running, we need to assign the X input | 463 // If there's no window manager running, we need to assign the X input |
464 // focus to our host window. | 464 // focus to our host window. |
465 if (!IsWindowManagerPresent()) | 465 if (!IsWindowManagerPresent()) |
466 XSetInputFocus(xdisplay_, xwindow_, RevertToNone, CurrentTime); | 466 XSetInputFocus(xdisplay_, xwindow_, RevertToNone, CurrentTime); |
467 handled = true; | 467 handled = true; |
468 break; | 468 break; |
469 } | 469 } |
470 case MappingNotify: { | |
471 XRefreshKeyboardMapping(&xev->xmapping); | |
Daniel Erat
2011/12/05 20:39:36
nit: i think that this should be:
if (xev->xmappi
oshima
2011/12/05 20:57:28
Done.
| |
472 break; | |
473 } | |
470 case MotionNotify: { | 474 case MotionNotify: { |
471 // Discard all but the most recent motion event that targets the same | 475 // Discard all but the most recent motion event that targets the same |
472 // window with unchanged state. | 476 // window with unchanged state. |
473 XEvent last_event; | 477 XEvent last_event; |
474 while (XPending(xev->xany.display)) { | 478 while (XPending(xev->xany.display)) { |
475 XEvent next_event; | 479 XEvent next_event; |
476 XPeekEvent(xev->xany.display, &next_event); | 480 XPeekEvent(xev->xany.display, &next_event); |
477 if (next_event.type == MotionNotify && | 481 if (next_event.type == MotionNotify && |
478 next_event.xmotion.window == xev->xmotion.window && | 482 next_event.xmotion.window == xev->xmotion.window && |
479 next_event.xmotion.subwindow == xev->xmotion.subwindow && | 483 next_event.xmotion.subwindow == xev->xmotion.subwindow && |
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
609 return new DesktopHostLinux(bounds); | 613 return new DesktopHostLinux(bounds); |
610 } | 614 } |
611 | 615 |
612 // static | 616 // static |
613 gfx::Size DesktopHost::GetNativeScreenSize() { | 617 gfx::Size DesktopHost::GetNativeScreenSize() { |
614 ::Display* xdisplay = base::MessagePumpX::GetDefaultXDisplay(); | 618 ::Display* xdisplay = base::MessagePumpX::GetDefaultXDisplay(); |
615 return gfx::Size(DisplayWidth(xdisplay, 0), DisplayHeight(xdisplay, 0)); | 619 return gfx::Size(DisplayWidth(xdisplay, 0), DisplayHeight(xdisplay, 0)); |
616 } | 620 } |
617 | 621 |
618 } // namespace aura | 622 } // namespace aura |
OLD | NEW |