From b69e649feb5dc5f7daa6daa84c98b3a2d9a28124 Mon Sep 17 00:00:00 2001 From: "estade@chromium.org" Date: Fri, 16 Apr 2010 21:09:00 +0000 Subject: 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 --- chrome/browser/gtk/gtk_util.cc | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'chrome/browser/gtk/gtk_util.cc') 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); -- cgit v1.1