summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Mikhaylenko <alexm@gnome.org>2021-03-23 14:31:28 +0500
committerAlexander Mikhaylenko <alexm@gnome.org>2021-03-24 17:10:26 +0500
commitaae661b3928155555643b39a2f5b2df33e3ccd2e (patch)
treeec1b949a6e246e24a78a80fc67eea59dfa9461af
parent0b28e04738a472d91d4d51c01a5dba4792db010e (diff)
downloadepiphany-aae661b3928155555643b39a2f5b2df33e3ccd2e.tar.gz
fullscreen-box: Listen to enter signal as well
If we never moved pointer (for example, just launched the app and pressed F11), we don't want the header bar to stay until you move it.
-rw-r--r--src/ephy-fullscreen-box.c20
1 files changed, 18 insertions, 2 deletions
diff --git a/src/ephy-fullscreen-box.c b/src/ephy-fullscreen-box.c
index 2a37340fe..bf604d57c 100644
--- a/src/ephy-fullscreen-box.c
+++ b/src/ephy-fullscreen-box.c
@@ -161,8 +161,8 @@ update (EphyFullscreenBox *self,
static void
motion_cb (EphyFullscreenBox *self,
- gdouble x,
- gdouble y)
+ double x,
+ double y)
{
self->is_touch = FALSE;
self->last_y = y;
@@ -171,6 +171,20 @@ motion_cb (EphyFullscreenBox *self,
}
static void
+enter_cb (EphyFullscreenBox *self,
+ double x,
+ double y)
+{
+ g_autoptr (GdkEvent) event = gtk_get_current_event ();
+
+ if (event->crossing.window != gtk_widget_get_window (GTK_WIDGET (self)) ||
+ event->crossing.detail == GDK_NOTIFY_INFERIOR)
+ return;
+
+ motion_cb (self, x, y);
+}
+
+static void
press_cb (EphyFullscreenBox *self,
int n_press,
double x,
@@ -413,6 +427,8 @@ ephy_fullscreen_box_init (EphyFullscreenBox *self)
self->controller = gtk_event_controller_motion_new (GTK_WIDGET (self));
gtk_event_controller_set_propagation_phase (self->controller, GTK_PHASE_CAPTURE);
+ g_signal_connect_object (self->controller, "enter",
+ G_CALLBACK (enter_cb), self, G_CONNECT_SWAPPED);
g_signal_connect_object (self->controller, "motion",
G_CALLBACK (motion_cb), self, G_CONNECT_SWAPPED);