Commit 4f6f573f authored by Jonny Lamb's avatar Jonny Lamb
Browse files

shell: add a way of listening to other widgets for enter/leave

Due to the many widgets in the panel, some enter and leave signals get
eaten up by some widgets here and there, so their ::enter-notify-event
should be connected to to make sure the cursor is still over the
panel. ::leave-notify-event isn't required as the panel will always
give us a reliable final leave event.

The reason why these signals are signalled or not signalled are not
fully understood.
parent ab33ce69
......@@ -41,6 +41,11 @@ struct desktop {
guint initial_panel_timeout_id;
guint hide_panel_idle_id;
/* queue of widgets on which to connect to the
* enter-notify-event signal so we know we're still on the
* panel. */
GQueue *panel_widgets;
/* TODO: guessed from the mockups, it'd be nice to have this in stone
......@@ -58,6 +63,7 @@ static gboolean
connect_enter_leave_signals (gpointer data)
struct desktop *desktop = data;
GList *l;
g_signal_connect (desktop->panel->window, "enter-notify-event",
G_CALLBACK (panel_window_enter_cb), desktop);
......@@ -69,6 +75,11 @@ connect_enter_leave_signals (gpointer data)
g_signal_connect (desktop->clock->window, "leave-notify-event",
G_CALLBACK (panel_window_leave_cb), desktop);
for (l = desktop->panel_widgets->head; l != NULL; l = l->next) {
g_signal_connect (l->data, "enter-notify-event",
G_CALLBACK (panel_window_enter_cb), desktop);
return FALSE;
......@@ -465,6 +476,7 @@ main(int argc, char *argv[])
desktop->output = NULL;
desktop->shell = NULL;
desktop->helper = NULL;
desktop->panel_widgets = g_queue_new ();
desktop->gdk_display = gdk_display_get_default();
desktop->display =
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