Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(652)

Unified Diff: chrome/browser/chrome_browser_main_extra_parts_x11.cc

Issue 1949393007: X11: Better timestamp handling for _NET_ACTIVE_WINDOW (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: ms->microseconds Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/browser/ui/startup/startup_browser_creator.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chrome_browser_main_extra_parts_x11.cc
diff --git a/chrome/browser/chrome_browser_main_extra_parts_x11.cc b/chrome/browser/chrome_browser_main_extra_parts_x11.cc
index 993f4f97299e562888d52a5ba85d546f01438c63..13ff1f0fc7cf48b629271d0727270547b4f28d6d 100644
--- a/chrome/browser/chrome_browser_main_extra_parts_x11.cc
+++ b/chrome/browser/chrome_browser_main_extra_parts_x11.cc
@@ -5,15 +5,19 @@
#include "chrome/browser/chrome_browser_main_extra_parts_x11.h"
#include "base/bind.h"
+#include "base/command_line.h"
#include "base/debug/debugger.h"
#include "base/location.h"
#include "base/sequenced_task_runner.h"
+#include "base/strings/string_number_conversions.h"
#include "base/threading/sequenced_task_runner_handle.h"
#include "chrome/browser/lifetime/application_lifetime.h"
#include "chrome/common/chrome_result_codes.h"
+#include "chrome/common/chrome_switches.h"
#include "content/public/browser/browser_thread.h"
#include "ui/base/x/x11_util.h"
#include "ui/base/x/x11_util_internal.h"
+#include "ui/events/platform/x11/x11_event_source.h"
using content::BrowserThread;
@@ -93,6 +97,17 @@ void ChromeBrowserMainExtraPartsX11::PostMainMessageLoopStart() {
// main message loop has started. This will allow us to exit cleanly
// if X exits before us.
ui::SetX11ErrorHandlers(BrowserX11ErrorHandler, BrowserX11IOErrorHandler);
+
+#if !defined(OS_CHROMEOS)
+ // Get a timestamp from the X server. This makes our requests to the server
+ // less likely to be thrown away by the window manager. Put the timestamp in
+ // a command line flag so we can forward it to an existing browser process if
+ // necessary.
+ base::CommandLine::ForCurrentProcess()->AppendSwitchASCII(
+ switches::kWmUserTimeMs,
+ base::Uint64ToString(
+ ui::X11EventSource::GetInstance()->UpdateLastSeenServerTime()));
+#endif
}
void ChromeBrowserMainExtraPartsX11::PostMainMessageLoopRun() {
« no previous file with comments | « no previous file | chrome/browser/ui/startup/startup_browser_creator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698