summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/Makefile.am11
-rw-r--r--src/applet-main.c52
-rw-r--r--src/eggaccelerators.h1
3 files changed, 53 insertions, 11 deletions
diff --git a/src/Makefile.am b/src/Makefile.am
index e60f286..56ddb53 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -25,7 +25,8 @@ mate_indicator_applet_CFLAGS = \
-DINDICATOR_APPLET \
-I$(srcdir)/.. \
$(APPLET_CFLAGS) \
- $(INDICATOR_CFLAGS)
+ $(INDICATOR_CFLAGS) \
+ $(WARN_CFLAGS)
mate_indicator_applet_SOURCES = \
applet-main.c \
@@ -47,7 +48,8 @@ mate_indicator_applet_appmenu_CFLAGS = \
-DINDICATOR_APPLET_APPMENU \
-I$(srcdir)/.. \
$(APPLET_CFLAGS) \
- $(INDICATOR_CFLAGS)
+ $(INDICATOR_CFLAGS) \
+ $(WARN_CFLAGS)
mate_indicator_applet_appmenu_SOURCES = \
applet-main.c \
@@ -69,7 +71,8 @@ mate_indicator_applet_complete_CFLAGS = \
-DINDICATOR_APPLET_COMPLETE \
-I$(srcdir)/.. \
$(APPLET_CFLAGS) \
- $(INDICATOR_CFLAGS)
+ $(INDICATOR_CFLAGS) \
+ $(WARN_CFLAGS)
mate_indicator_applet_complete_SOURCES = \
applet-main.c \
@@ -82,3 +85,5 @@ mate_indicator_applet_complete_LDADD = \
$(APPLET_LIBS) \
$(INDICATOR_LIBS) \
-lX11
+
+-include $(top_srcdir)/git.mk
diff --git a/src/applet-main.c b/src/applet-main.c
index d2a42a8..41c0c66 100644
--- a/src/applet-main.c
+++ b/src/applet-main.c
@@ -304,6 +304,42 @@ entry_scrolled (GtkWidget *menuitem, GdkEventScroll *event, gpointer data)
return FALSE;
}
+static gboolean
+entry_pressed (GtkWidget *menuitem, GdkEvent *event, gpointer data)
+{
+ g_return_val_if_fail(GTK_IS_MENU_ITEM(menuitem), FALSE);
+
+ if (((GdkEventButton*)event)->button == 2) /* middle button */
+ {
+ gtk_widget_grab_focus(menuitem);
+
+ return TRUE;
+ }
+
+ return FALSE;
+}
+
+static gboolean
+entry_released (GtkWidget *menuitem, GdkEvent *event, gpointer data)
+{
+ g_return_val_if_fail(GTK_IS_MENU_ITEM(menuitem), FALSE);
+
+ if (((GdkEventButton*)event)->button == 2) /* middle button */
+ {
+ IndicatorObject *io = g_object_get_data (G_OBJECT (menuitem), MENU_DATA_INDICATOR_OBJECT);
+ IndicatorObjectEntry *entry = g_object_get_data (G_OBJECT (menuitem), MENU_DATA_INDICATOR_ENTRY);
+
+ g_return_val_if_fail(INDICATOR_IS_OBJECT(io), FALSE);
+
+ g_signal_emit_by_name (io, INDICATOR_OBJECT_SIGNAL_SECONDARY_ACTIVATE, entry,
+ ((GdkEventButton*)event)->time);
+
+ return TRUE;
+ }
+
+ return FALSE;
+}
+
static void
accessible_desc_update_cb (GtkWidget * widget, gpointer userdata)
{
@@ -360,12 +396,16 @@ entry_added (IndicatorObject * io, IndicatorObjectEntry * entry, GtkWidget * men
/* Allows indicators to receive mouse scroll event */
gtk_widget_add_events(GTK_WIDGET(menuitem), GDK_SCROLL_MASK);
+ gtk_widget_add_events(GTK_WIDGET(menuitem), GDK_BUTTON_PRESS_MASK);
+ gtk_widget_add_events(GTK_WIDGET(menuitem), GDK_BUTTON_RELEASE_MASK);
g_object_set_data (G_OBJECT (menuitem), "indicator", io);
g_object_set_data (G_OBJECT (menuitem), "box", box);
g_signal_connect(G_OBJECT(menuitem), "activate", G_CALLBACK(entry_activated), entry);
g_signal_connect(G_OBJECT(menuitem), "scroll-event", G_CALLBACK(entry_scrolled), entry);
+ g_signal_connect(G_OBJECT(menuitem), "button-press-event", G_CALLBACK(entry_pressed), entry);
+ g_signal_connect(G_OBJECT(menuitem), "button-release-event", G_CALLBACK(entry_released), entry);
if (entry->image != NULL) {
/* Resize to fit panel */
@@ -541,9 +581,9 @@ menu_show (IndicatorObject * io, IndicatorObjectEntry * entry,
if (entry == NULL) {
/* Close any open menus instead of opening one */
GList * entries = indicator_object_get_entries(io);
- GList * entry = NULL;
- for (entry = entries; entry != NULL; entry = g_list_next(entry)) {
- IndicatorObjectEntry * entrydata = (IndicatorObjectEntry *)entry->data;
+ GList * iterator = NULL;
+ for (iterator = entries; iterator != NULL; iterator = g_list_next(iterator)) {
+ IndicatorObjectEntry * entrydata = (IndicatorObjectEntry *)iterator->data;
gtk_menu_popdown(entrydata->menu);
}
g_list_free(entries);
@@ -808,7 +848,7 @@ about_cb (GtkAction *action G_GNUC_UNUSED,
gtk_show_about_dialog(NULL,
"version", VERSION,
"copyright", _("Copyright \xc2\xa9 2009-2010 Canonical, Ltd.\n"
- "Copyright \xc2\xa9 2011-2019 MATE developers"),
+ "Copyright \xc2\xa9 2011-2021 MATE developers"),
#ifdef INDICATOR_APPLET_APPMENU
"comments", _("An applet to hold your application menus."),
#endif
@@ -926,7 +966,6 @@ log_to_file (const gchar * domain G_GNUC_UNUSED,
if (error != NULL) {
g_error("Unable to make directory '%s' for log file: %s", g_get_user_cache_dir(), error->message);
- return;
}
}
@@ -938,7 +977,6 @@ log_to_file (const gchar * domain G_GNUC_UNUSED,
&error); /* error */
if (error != NULL) {
g_error("Unable to replace file: %s", error->message);
- return;
}
log_file = g_io_stream_get_output_stream(G_IO_STREAM(io));
@@ -965,7 +1003,7 @@ applet_fill_cb (MatePanelApplet * applet, const gchar * iid G_GNUC_UNUSED,
#endif
static const GtkActionEntry menu_actions[] = {
- {"About", GTK_STOCK_ABOUT, N_("_About"), NULL, NULL, G_CALLBACK(about_cb)}
+ {"About", "help-about", N_("_About"), NULL, NULL, G_CALLBACK(about_cb)}
};
static const gchar *menu_xml = "<menuitem name=\"About\" action=\"About\"/>";
diff --git a/src/eggaccelerators.h b/src/eggaccelerators.h
index 439cdd2..3ecdd1d 100644
--- a/src/eggaccelerators.h
+++ b/src/eggaccelerators.h
@@ -78,5 +78,4 @@ void egg_keymap_virtualize_modifiers (GdkKeymap *keymap,
G_END_DECLS
-
#endif /* __EGG_ACCELERATORS_H__ */