From d67cda37cdaaaa7353ec5cee53d57de2d672cede Mon Sep 17 00:00:00 2001 From: Harald Judt Date: Mon, 21 May 2012 13:30:58 +0200 Subject: Make left click toggle the forecast window (bug #8805). When the forecast window is shown and has the focus, a second click on the panel plugin will close it. It can still be closed by clicking on the dialog or the window manager decoration close button. When it is shown but does not have the focus, bring it to the front instead of closing it. --- panel-plugin/weather.c | 10 ++++++++-- 1 files changed, 8 insertions(+), 2 deletions(-) diff --git a/panel-plugin/weather.c b/panel-plugin/weather.c index 054dcda..42323c7 100644 --- a/panel-plugin/weather.c +++ b/panel-plugin/weather.c @@ -627,8 +627,14 @@ forecast_click (GtkWidget *widget, if (data->summary_window != NULL) { - - gtk_window_present (GTK_WINDOW (data->summary_window)); + if (gtk_window_has_toplevel_focus(GTK_WINDOW(data->summary_window))) + { + gtk_widget_destroy (data->summary_window); + } + else + { + gtk_window_present (GTK_WINDOW (data->summary_window)); + } } else { -- 1.7.8.6