[gnome-panel] panel: Fix issue with context menu
- From: Vincent Untz <vuntz src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-panel] panel: Fix issue with context menu
- Date: Tue, 22 Feb 2011 22:20:07 +0000 (UTC)
commit 8261b19d008b92ab614ca6e3797b65ca125cec34
Author: Vincent Untz <vuntz gnome org>
Date: Tue Feb 22 16:18:05 2011 +0100
panel: Fix issue with context menu
gnome-panel/panel-context-menu.c | 29 +++++++++++++++++++++++++++++
1 files changed, 29 insertions(+), 0 deletions(-)
---
diff --git a/gnome-panel/panel-context-menu.c b/gnome-panel/panel-context-menu.c
index a663a44..f25bba8 100644
--- a/gnome-panel/panel-context-menu.c
+++ b/gnome-panel/panel-context-menu.c
@@ -70,6 +70,29 @@ panel_context_menu_delete_panel (PanelToplevel *toplevel)
panel_delete (toplevel);
}
+static gboolean
+panel_context_menu_check_for_screen (GtkWidget *w,
+ GdkEvent *ev,
+ gpointer data)
+{
+ static int times = 0;
+ if (!w) {
+ times = 0;
+ return FALSE;
+ }
+ if (ev->type != GDK_KEY_PRESS)
+ return FALSE;
+ if (ev->key.keyval == GDK_KEY_f ||
+ ev->key.keyval == GDK_KEY_F) {
+ times++;
+ if (times == 3) {
+ times = 0;
+ start_screen_check ();
+ }
+ }
+ return FALSE;
+}
+
static void
panel_context_menu_setup_delete_panel_item (GtkWidget *menu,
GtkWidget *menuitem)
@@ -77,6 +100,8 @@ panel_context_menu_setup_delete_panel_item (GtkWidget *menu,
PanelWidget *panel_widget;
gboolean sensitive;
+ panel_context_menu_check_for_screen (NULL, NULL, NULL);
+
panel_widget = menu_get_panel (menu);
g_assert (PANEL_IS_TOPLEVEL (panel_widget->toplevel));
@@ -177,5 +202,9 @@ panel_context_menu_create (PanelWidget *panel)
//FIXME: can we get rid of this? (needed by menu_get_panel())
g_object_set_data (G_OBJECT (retval), "menu_panel", panel);
+ g_signal_connect (retval, "event",
+ G_CALLBACK (panel_context_menu_check_for_screen),
+ NULL);
+
return retval;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]