diff options
author | estade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-04-16 21:09:00 +0000 |
---|---|---|
committer | estade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-04-16 21:09:00 +0000 |
commit | b69e649feb5dc5f7daa6daa84c98b3a2d9a28124 (patch) | |
tree | 5f56ff83299a2753d388c5fd1d3dcdf59e4be9b0 /chrome/browser/gtk/gtk_util.cc | |
parent | 68b745055e85cc466a0c867e87eacb43539baaa4 (diff) | |
download | chromium_src-b69e649feb5dc5f7daa6daa84c98b3a2d9a28124.zip chromium_src-b69e649feb5dc5f7daa6daa84c98b3a2d9a28124.tar.gz chromium_src-b69e649feb5dc5f7daa6daa84c98b3a2d9a28124.tar.bz2 |
GTK: raise old browser windows when adding a new tab
BUG=38166
TEST=`google-chrome http://google.com` should raise the browser window.
Review URL: http://codereview.chromium.org/1646011
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@44820 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/gtk/gtk_util.cc')
-rw-r--r-- | chrome/browser/gtk/gtk_util.cc | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/chrome/browser/gtk/gtk_util.cc b/chrome/browser/gtk/gtk_util.cc index 0f8b629..4d5796a 100644 --- a/chrome/browser/gtk/gtk_util.cc +++ b/chrome/browser/gtk/gtk_util.cc @@ -861,6 +861,16 @@ gfx::Rect WidgetBounds(GtkWidget* widget) { return gfx::Rect(0, 0, widget->allocation.width, widget->allocation.height); } +void SetWMLastUserActionTime(GtkWindow* window) { + gdk_x11_window_set_user_time(GTK_WIDGET(window)->window, XTimeNow()); +} + +guint32 XTimeNow() { + struct timespec ts; + clock_gettime(CLOCK_MONOTONIC, &ts); + return ts.tv_sec * 1000 + ts.tv_nsec / 1000000; +} + bool URLFromPrimarySelection(Profile* profile, GURL* url) { GtkClipboard* clipboard = gtk_clipboard_get(GDK_SELECTION_PRIMARY); DCHECK(clipboard); |