[gnome-panel/wip/status-notifier] snh: sn_item_client_get_menu now returns GtkMenu
- From: Alberts Muktupāvels <muktupavels src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-panel/wip/status-notifier] snh: sn_item_client_get_menu now returns GtkMenu
- Date: Mon, 20 Jul 2015 23:19:03 +0000 (UTC)
commit e4f9a9865c6ae8f8edec33da7bd0eb9aacb033a7
Author: Alberts Muktupāvels <alberts muktupavels gmail com>
Date: Mon Jul 20 18:22:41 2015 +0300
snh: sn_item_client_get_menu now returns GtkMenu
applets/snh/snh-item.c | 59 ++++++++++++++++++------------------------------
configure.ac | 2 +-
2 files changed, 23 insertions(+), 38 deletions(-)
---
diff --git a/applets/snh/snh-item.c b/applets/snh/snh-item.c
index 3a9206c..be5cd48 100644
--- a/applets/snh/snh-item.c
+++ b/applets/snh/snh-item.c
@@ -17,8 +17,6 @@
#include "config.h"
-#include <libdbusmenu-gtk/menu.h>
-
#include "snh-item.h"
#define UPDATE_TIMEOUT 10
@@ -26,33 +24,31 @@
struct _SnhItem
{
- GtkEventBox parent;
-
- SnItemClient *item;
+ GtkEventBox parent;
- GtkOrientation orientation;
- gint size;
+ SnItemClient *item;
- guint update_id;
- guint update_icons_id;
+ GtkOrientation orientation;
+ gint size;
- gchar *title;
- gchar *tooltip_title;
- gchar *tooltip_text;
- gchar *icon_theme_path;
+ guint update_id;
+ guint update_icons_id;
- GdkPixbuf *icon;
- GdkPixbuf *overlay_icon;
- GdkPixbuf *attention_icon;
- GdkPixbuf *tooltip_icon;
+ gchar *title;
+ gchar *tooltip_title;
+ gchar *tooltip_text;
+ gchar *icon_theme_path;
- SnItemStatus status;
+ GdkPixbuf *icon;
+ GdkPixbuf *overlay_icon;
+ GdkPixbuf *attention_icon;
+ GdkPixbuf *tooltip_icon;
- GtkWidget *box;
- GtkWidget *image;
- GtkWidget *label;
+ SnItemStatus status;
- DbusmenuGtkMenu *gtk_menu;
+ GtkWidget *box;
+ GtkWidget *image;
+ GtkWidget *label;
};
enum
@@ -436,28 +432,17 @@ snh_item_button_press_event (GtkWidget *widget,
GdkEventButton *event)
{
SnhItem *item;
+ GtkMenu *menu;
item = SNH_ITEM (widget);
- if (item->gtk_menu == NULL)
- {
- gchar *name;
- const gchar *menu;
-
- g_object_get (item->item, "dbus-name", &name, NULL);
- menu = sn_item_client_get_menu (item->item);
-
- if (menu != NULL)
- item->gtk_menu = dbusmenu_gtkmenu_new (name, (gchar *) menu);
-
- g_free (name);
- }
+ menu = sn_item_client_get_menu (item->item);
- if (item->gtk_menu)
+ if (menu)
{
GtkWidget *widget;
- widget = GTK_WIDGET (item->gtk_menu);
+ widget = GTK_WIDGET (menu);
if (gtk_widget_is_visible (widget) == FALSE)
gtk_menu_popup (GTK_MENU (widget), NULL, NULL, NULL, NULL,
diff --git a/configure.ac b/configure.ac
index f61d566..64bc78d 100644
--- a/configure.ac
+++ b/configure.ac
@@ -119,7 +119,7 @@ PKG_CHECK_MODULES(NOTIFICATION_AREA, gtk+-3.0 >= $GTK_REQUIRED)
AC_SUBST(NOTIFICATION_AREA_CFLAGS)
AC_SUBST(NOTIFICATION_AREA_LIBS)
-PKG_CHECK_MODULES(SNH, gtk+-3.0 >= $GTK_REQUIRED libstatus-notifier-3.0 >= $LIBSTATUS_NOTIFIER_REQUIRED
dbusmenu-gtk3-0.4)
+PKG_CHECK_MODULES(SNH, gtk+-3.0 >= $GTK_REQUIRED libstatus-notifier-3.0 >= $LIBSTATUS_NOTIFIER_REQUIRED)
AC_SUBST(SNH_CFLAGS)
AC_SUBST(SNH_LIBS)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]