| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/views/widget/desktop_aura/desktop_window_tree_host_x11.h" | 5 #include "ui/views/widget/desktop_aura/desktop_window_tree_host_x11.h" |
| 6 | 6 |
| 7 #include <X11/Xatom.h> | 7 #include <X11/Xatom.h> |
| 8 #include <X11/Xregion.h> | 8 #include <X11/Xregion.h> |
| 9 #include <X11/Xutil.h> | 9 #include <X11/Xutil.h> |
| 10 #include <X11/extensions/XInput2.h> | 10 #include <X11/extensions/XInput2.h> |
| (...skipping 1424 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1435 void DesktopWindowTreeHostX11::UpdateWMUserTime( | 1435 void DesktopWindowTreeHostX11::UpdateWMUserTime( |
| 1436 const ui::PlatformEvent& event) { | 1436 const ui::PlatformEvent& event) { |
| 1437 if (!IsActive()) | 1437 if (!IsActive()) |
| 1438 return; | 1438 return; |
| 1439 | 1439 |
| 1440 ui::EventType type = ui::EventTypeFromNative(event); | 1440 ui::EventType type = ui::EventTypeFromNative(event); |
| 1441 if (type == ui::ET_MOUSE_PRESSED || | 1441 if (type == ui::ET_MOUSE_PRESSED || |
| 1442 type == ui::ET_KEY_PRESSED || | 1442 type == ui::ET_KEY_PRESSED || |
| 1443 type == ui::ET_TOUCH_PRESSED) { | 1443 type == ui::ET_TOUCH_PRESSED) { |
| 1444 unsigned long wm_user_time_ms = static_cast<unsigned long>( | 1444 unsigned long wm_user_time_ms = static_cast<unsigned long>( |
| 1445 ui::EventTimeFromNative(event).InMilliseconds()); | 1445 (ui::EventTimeFromNative(event) - base::TimeTicks()).InMilliseconds()); |
| 1446 XChangeProperty(xdisplay_, | 1446 XChangeProperty(xdisplay_, |
| 1447 xwindow_, | 1447 xwindow_, |
| 1448 atom_cache_.GetAtom("_NET_WM_USER_TIME"), | 1448 atom_cache_.GetAtom("_NET_WM_USER_TIME"), |
| 1449 XA_CARDINAL, | 1449 XA_CARDINAL, |
| 1450 32, | 1450 32, |
| 1451 PropModeReplace, | 1451 PropModeReplace, |
| 1452 reinterpret_cast<const unsigned char *>(&wm_user_time_ms), | 1452 reinterpret_cast<const unsigned char *>(&wm_user_time_ms), |
| 1453 1); | 1453 1); |
| 1454 X11DesktopHandler::get()->set_wm_user_time_ms(wm_user_time_ms); | 1454 X11DesktopHandler::get()->set_wm_user_time_ms(wm_user_time_ms); |
| 1455 } | 1455 } |
| (...skipping 597 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2053 if (linux_ui) { | 2053 if (linux_ui) { |
| 2054 ui::NativeTheme* native_theme = linux_ui->GetNativeTheme(window); | 2054 ui::NativeTheme* native_theme = linux_ui->GetNativeTheme(window); |
| 2055 if (native_theme) | 2055 if (native_theme) |
| 2056 return native_theme; | 2056 return native_theme; |
| 2057 } | 2057 } |
| 2058 | 2058 |
| 2059 return ui::NativeThemeAura::instance(); | 2059 return ui::NativeThemeAura::instance(); |
| 2060 } | 2060 } |
| 2061 | 2061 |
| 2062 } // namespace views | 2062 } // namespace views |
| OLD | NEW |