Commit 6c08a938 authored by Alexander Mikhaylenko's avatar Alexander Mikhaylenko

fullscreen-box: Check for autohide on is_fullscreen changes

Also use a setter instead of a signal handler and skip the setter if the
value didn't change.
parent 853d10e5
Pipeline #103517 passed with stages
in 39 minutes and 55 seconds
......@@ -17,7 +17,6 @@
<property name="transition-type">slide-down</property>
<property name="transition-duration">500</property>
<property name="events">pointer-motion-mask</property>
<signal name="notify::is-fullscreen" handler="on_fullscreen_changed"/>
<signal name="motion-notify-event" handler="on_motion_event"/>
</object>
</child>
......
......@@ -5,7 +5,26 @@ private class Games.FullscreenBox : Gtk.EventBox, Gtk.Buildable {
private const uint INACTIVITY_TIME_MILLISECONDS = 3000;
private const int SHOW_HEADERBAR_DISTANCE = 5;
public bool is_fullscreen { get; set; }
private bool _is_fullscreen;
public bool is_fullscreen {
get { return _is_fullscreen; }
set {
if (is_fullscreen == value)
return;
_is_fullscreen = value;
if (!autohide)
return;
if (is_fullscreen) {
show_ui ();
on_cursor_moved ();
}
else
on_restore ();
}
}
private bool _autohide = true;
public bool autohide {
......@@ -92,16 +111,6 @@ private class Games.FullscreenBox : Gtk.EventBox, Gtk.Buildable {
overlay.add (widget);
}
[GtkCallback]
private void on_fullscreen_changed () {
if (is_fullscreen) {
show_ui ();
on_cursor_moved ();
}
else
on_restore ();
}
[GtkCallback]
private bool on_motion_event (Gdk.EventMotion event) {
if (!autohide)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment