diff options
author | Ted Gould <ted@canonical.com> | 2008-11-24 17:30:01 -0600 |
---|---|---|
committer | Ted Gould <ted@canonical.com> | 2008-11-24 17:30:01 -0600 |
commit | f9b7c2428e95625b75faa2d3e8058d1b458496fa (patch) | |
tree | 2e6efc263b279c73020e8a8541df51e3d559b409 /src | |
parent | 10629d4425cf2bdad1438215fb9b52874ffc277f (diff) | |
download | libayatana-indicator-f9b7c2428e95625b75faa2d3e8058d1b458496fa.tar.gz libayatana-indicator-f9b7c2428e95625b75faa2d3e8058d1b458496fa.tar.bz2 libayatana-indicator-f9b7c2428e95625b75faa2d3e8058d1b458496fa.zip |
Blocking the prelight
Diffstat (limited to 'src')
-rw-r--r-- | src/indicator-power.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/indicator-power.c b/src/indicator-power.c index b634023..aedb99b 100644 --- a/src/indicator-power.c +++ b/src/indicator-power.c @@ -8,6 +8,16 @@ typedef struct { char * time; } menuitem_t; +static void +block_prelight (GtkWidget * widget, GtkStateType prev, gpointer data) +{ + if (GTK_WIDGET_STATE(widget) == GTK_STATE_PRELIGHT) { + gtk_widget_set_state(widget, prev); + } + return; +} + + #define MENU_ITEM_CNT 3 menuitem_t menuitems[MENU_ITEM_CNT] = { {"Main", "audio-volume-low", "(1:34 left)"}, @@ -27,6 +37,7 @@ power_menu (void) int i; for (i = 0 ; i < MENU_ITEM_CNT; i++) { GtkWidget * item = gtk_menu_item_new (); + g_signal_connect(G_OBJECT(item), "state-changed", G_CALLBACK(block_prelight), NULL); GtkWidget * hbox = gtk_hbox_new (FALSE, 3); |