[gnome-games] ui: Stop using 'has-toplevel-focus' property



commit 8f18c82fa64509fdf84357a32ebfa91414ffbcab
Author: Alexander Mikhaylenko <exalm7659 gmail com>
Date:   Sun Jul 29 17:29:01 2018 +0500

    ui: Stop using 'has-toplevel-focus' property
    
    Use 'is-active' instead.

 data/ui/application-window.ui  | 2 +-
 src/ui/application-window.vala | 6 +++---
 2 files changed, 4 insertions(+), 4 deletions(-)
---
diff --git a/data/ui/application-window.ui b/data/ui/application-window.ui
index d9a45e99..9efae3e7 100644
--- a/data/ui/application-window.ui
+++ b/data/ui/application-window.ui
@@ -10,7 +10,7 @@
     <signal name="key-press-event" after="yes" handler="on_key_pressed"/>
     <signal name="button-press-event" after="yes" handler="on_button_pressed"/>
     <signal name="window-state-event" after="yes" handler="on_window_state_event"/>
-    <signal name="notify::has-toplevel-focus" after="yes" handler="on_toplevel_focus"/>
+    <signal name="notify::is-active" after="yes" handler="on_active_changed"/>
     <child>
       <object class="GtkStack" id="content_box">
         <property name="visible">True</property>
diff --git a/src/ui/application-window.vala b/src/ui/application-window.vala
index 255b104a..748d1073 100644
--- a/src/ui/application-window.vala
+++ b/src/ui/application-window.vala
@@ -491,7 +491,7 @@ private class Games.ApplicationWindow : Gtk.ApplicationWindow {
        }
 
        [GtkCallback]
-       private void on_toplevel_focus () {
+       private void on_active_changed () {
                update_pause (true);
        }
 
@@ -541,7 +541,7 @@ private class Games.ApplicationWindow : Gtk.ApplicationWindow {
                if (!can_update_pause ())
                        return;
 
-               if (has_toplevel_focus)
+               if (is_active)
                        try {
                                display_box.runner.resume ();
                        }
@@ -560,7 +560,7 @@ private class Games.ApplicationWindow : Gtk.ApplicationWindow {
                if (!can_update_pause ())
                        return false;
 
-               if (!has_toplevel_focus)
+               if (!is_active)
                        display_box.runner.pause ();
 
                return false;


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