[gnome-photos/wip/search: 16/22] application: Use an activation timestamp



commit 46c26350c0d9b7f1f24ccce0b0e4c0e121a76517
Author: Debarshi Ray <debarshir gnome org>
Date:   Tue Feb 18 14:28:59 2014 +0100

    application: Use an activation timestamp
    
    This would be used to forward the shell's timestamp when launching
    from the search provider so that the window will get the WM focus.

 src/photos-application.c |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)
---
diff --git a/src/photos-application.c b/src/photos-application.c
index 9fb9b6d..a3f78de 100644
--- a/src/photos-application.c
+++ b/src/photos-application.c
@@ -71,6 +71,7 @@ struct _PhotosApplicationPrivate
   PhotosCameraCache *camera_cache;
   PhotosModeController *mode_cntrlr;
   PhotosSearchProvider *search_provider;
+  guint32 activation_timestamp;
 };
 
 
@@ -486,7 +487,8 @@ photos_application_activate (GApplication *application)
       photos_mode_controller_set_window_mode (priv->mode_cntrlr, PHOTOS_WINDOW_MODE_OVERVIEW);
     }
 
-  gtk_window_present (GTK_WINDOW (priv->main_window));
+  gtk_window_present_with_time (GTK_WINDOW (priv->main_window), priv->activation_timestamp);
+  priv->activation_timestamp = GDK_CURRENT_TIME;
 }
 
 
@@ -735,6 +737,8 @@ photos_application_init (PhotosApplication *self)
                             "launch-search",
                             G_CALLBACK (photos_application_launch_search),
                             self);
+
+  priv->activation_timestamp = GDK_CURRENT_TIME;
 }
 
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]