summaryrefslogtreecommitdiff
path: root/shell/gtk-shell.c
diff options
context:
space:
mode:
authorJonny Lamb <jonny.lamb@collabora.co.uk>2014-02-17 18:52:15 +0100
committerJonny Lamb <jonny.lamb@collabora.co.uk>2014-02-17 20:17:47 +0100
commit4f6f573f4d7e3812eae1450956e12573dd68cab4 (patch)
tree7b78160152cf35932f6dee9595f21c0b43ec160d /shell/gtk-shell.c
parentab33ce6939718f258c2c99379c45f0542524fedc (diff)
downloadgraynard-4f6f573f4d7e3812eae1450956e12573dd68cab4.tar.gz
graynard-4f6f573f4d7e3812eae1450956e12573dd68cab4.zip
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.
Diffstat (limited to 'shell/gtk-shell.c')
-rw-r--r--shell/gtk-shell.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/shell/gtk-shell.c b/shell/gtk-shell.c
index 278dab6..feffb1e 100644
--- a/shell/gtk-shell.c
+++ b/shell/gtk-shell.c
@@ -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 =