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

Unified Diff: chrome/browser/ui/startup/startup_browser_creator.cc

Issue 1949393007: X11: Better timestamp handling for _NET_ACTIVE_WINDOW (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Change kAtomStr, fix formatting 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
Index: chrome/browser/ui/startup/startup_browser_creator.cc
diff --git a/chrome/browser/ui/startup/startup_browser_creator.cc b/chrome/browser/ui/startup/startup_browser_creator.cc
index 11e51f87a412c529176e3afbb26c78733ad20f43..db287351e536a7c61a3664a5a2d45a774cc98e58 100644
--- a/chrome/browser/ui/startup/startup_browser_creator.cc
+++ b/chrome/browser/ui/startup/startup_browser_creator.cc
@@ -104,6 +104,10 @@
#include "components/search_engines/desktop_search_utils.h"
#endif
+#if defined(OS_LINUX) && !defined(OS_CHROMEOS)
+#include "ui/views/widget/desktop_aura/x11_desktop_handler.h"
+#endif
+
#if defined(ENABLE_PRINT_PREVIEW)
#include "chrome/browser/printing/cloud_print/cloud_print_proxy_service.h"
#include "chrome/browser/printing/cloud_print/cloud_print_proxy_service_factory.h"
@@ -712,6 +716,21 @@ bool StartupBrowserCreator::ProcessCmdLineImpl(
}
#endif // defined(OS_WIN)
+#if defined(OS_LINUX) && !defined(OS_CHROMEOS)
+ // Our request to Activate may be discarded on some linux window
+ // managers unless given a recent timestamp, so update the timestamp if
+ // we were given one.
+ if (command_line.HasSwitch(switches::kWmUserTimeMs)) {
+ uint64_t time;
+ std::string switchValue =
sky 2016/05/07 16:58:34 switch_value
Tom (Use chromium acct) 2016/05/09 17:49:59 Done.
+ command_line.GetSwitchValueASCII(switches::kWmUserTimeMs);
+ if (base::StringToUint64(switchValue, &time)) {
+ views::X11DesktopHandler::get()->set_wm_user_time_ms(
+ static_cast<Time>(time));
+ }
+ }
+#endif
+
chrome::startup::IsProcessStartup is_process_startup = process_startup ?
chrome::startup::IS_PROCESS_STARTUP :
chrome::startup::IS_NOT_PROCESS_STARTUP;
@@ -748,7 +767,6 @@ bool StartupBrowserCreator::ProcessCmdLineImpl(
last_used_profile = last_opened_profiles[0];
}
#endif
-
// Launch the last used profile with the full command line, and the other
// opened profiles without the URLs to launch.
base::CommandLine command_line_without_urls(command_line.GetProgram());
@@ -772,7 +790,6 @@ bool StartupBrowserCreator::ProcessCmdLineImpl(
startup_pref.type == SessionStartupPref::DEFAULT &&
!HasPendingUncleanExit(*it))
continue;
-
if (!LaunchBrowser((*it == last_used_profile) ? command_line
: command_line_without_urls,
*it, cur_dir, is_process_startup, is_first_run))

Powered by Google App Engine
This is Rietveld 408576698