Commit 9a981d02 authored by Jonny Lamb's avatar Jonny Lamb
Browse files

shell: don't hide the panel if the app launcher is showing

parent 816ffed2
......@@ -42,6 +42,8 @@ struct desktop {
guint initial_panel_timeout_id;
guint hide_panel_idle_id;
gboolean grid_visible;
};
static gboolean panel_window_enter_cb (GtkWidget *widget,
......@@ -67,6 +69,11 @@ connect_enter_leave_signals (gpointer data)
g_signal_connect (desktop->clock->window, "leave-notify-event",
G_CALLBACK (panel_window_leave_cb), desktop);
g_signal_connect (desktop->launcher_grid->window, "enter-notify-event",
G_CALLBACK (panel_window_enter_cb), desktop);
g_signal_connect (desktop->launcher_grid->window, "leave-notify-event",
G_CALLBACK (panel_window_leave_cb), desktop);
return FALSE;
}
......@@ -140,6 +147,26 @@ static const struct desktop_shell_listener listener = {
desktop_shell_grab_cursor
};
static void
launcher_grid_toggle (GtkWidget *widget, struct desktop *desktop)
{
if (desktop->grid_visible) {
shell_helper_slide_surface_back(desktop->helper,
desktop->launcher_grid->surface);
} else {
int width;
gtk_widget_get_size_request (desktop->launcher_grid->window,
&width, NULL);
shell_helper_slide_surface(desktop->helper,
desktop->launcher_grid->surface,
width + WESTON_GTK_PANEL_WIDTH, 0);
}
desktop->grid_visible = !desktop->grid_visible;
}
static void
launcher_grid_create (struct desktop *desktop)
{
......@@ -153,6 +180,9 @@ launcher_grid_create (struct desktop *desktop)
gdk_window = gtk_widget_get_window(launcher_grid->window);
launcher_grid->surface = gdk_wayland_window_get_wl_surface(gdk_window);
g_signal_connect(launcher_grid->window, "app-launched",
G_CALLBACK(launcher_grid_toggle), desktop);
gtk_widget_show_all(launcher_grid->window);
desktop->launcher_grid = launcher_grid;
......@@ -241,6 +271,9 @@ panel_window_leave_cb (GtkWidget *widget,
if (desktop->hide_panel_idle_id > 0)
return;
if (desktop->grid_visible)
return;
desktop->hide_panel_idle_id = g_idle_add (leave_panel_idle_cb, desktop);
return FALSE;
......@@ -436,6 +469,8 @@ main(int argc, char *argv[])
while (!desktop->output || !desktop->shell || !desktop->helper)
wl_display_roundtrip (desktop->display);
desktop->grid_visible = FALSE;
css_setup(desktop);
panel_create(desktop);
clock_create(desktop);
......
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