Merge lp:~jjardon/libappindicator/fix-820080 into lp:libappindicator

Proposed by Javier Jardón
Status: Rejected
Rejected by: Ted Gould
Proposed branch: lp:~jjardon/libappindicator/fix-820080
Merge into: lp:libappindicator
Diff against target: 82 lines (+7/-31)
1 file modified
src/app-indicator.c (+7/-31)
To merge this branch: bzr merge lp:~jjardon/libappindicator/fix-820080
Reviewer Review Type Date Requested Status
Ted Gould (community) Disapprove
Andrea Cimitan Pending
Review via email: mp+76660@code.launchpad.net

This proposal supersedes a proposal from 2011-09-21.

To post a comment you must log in.
Revision history for this message
Andrea Cimitan (cimi) wrote : Posted in a previous version of this proposal

I don't know which is the default coding style, but from the snippet I see you might want to remove the space between function names and their brackets

review: Approve
Revision history for this message
Ted Gould (ted) wrote : Posted in a previous version of this proposal

While I agree that this is the "right" way to do it, GIcon support has been broken in GTK+ for a while and was causing upstream GNOME maintainers to claim our work was shoddy.

https://bugzilla.gnome.org/show_bug.cgi?id=614800

So that's why we stopped using it.

review: Disapprove
Revision history for this message
Ted Gould (ted) wrote :

Sorry I took so long on this. We can't drop adding the "-panel" name extension on the icons as we want the fallback to look the same as the icon would look in the primary case. The "-panel" extension is used so that icon themes can theme the panel differently as they're not given anything like a StyleContext to determine their location otherwise.

review: Disapprove

Unmerged revisions

215. By Javier Jardón

Do not append "-panel" to the given icon name if it's missing.

As the -panel variant can not exist. Also, GtkStatusIcon
support fixed-sized icons nowadays.

Fix https://bugs.launchpad.net/libappindicator/+bug/820080

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/app-indicator.c'
2--- src/app-indicator.c 2011-07-22 19:04:23 +0000
3+++ src/app-indicator.c 2011-09-22 21:28:24 +0000
4@@ -48,8 +48,6 @@
5 #include "dbus-shared.h"
6 #include "generate-id.h"
7
8-#define PANEL_ICON_SUFFIX "panel"
9-
10 /**
11 * AppIndicatorPrivate:
12 * All of the private data in an instance of an application indicator.
13@@ -183,7 +181,6 @@
14 static void status_icon_activate (GtkStatusIcon * icon, gpointer data);
15 static void status_icon_menu_activate (GtkStatusIcon *status_icon, guint button, guint activate_time, gpointer user_data);
16 static void unfallback (AppIndicator * self, GtkStatusIcon * status_icon);
17-static gchar * append_panel_icon_suffix (const gchar * icon_name);
18 static void watcher_owner_changed (GObject * obj, GParamSpec * pspec, gpointer user_data);
19 static void theme_changed_cb (GtkIconTheme * theme, gpointer user_data);
20 static void sec_activate_target_parent_changed(GtkWidget *menuitem, GtkWidget *old_parent, gpointer user_data);
21@@ -1521,30 +1518,26 @@
22 status_icon_changes (AppIndicator * self, gpointer data)
23 {
24 GtkStatusIcon * icon = GTK_STATUS_ICON(data);
25- gchar *longname = NULL;
26+ const gchar *icon_name;
27
28 switch (app_indicator_get_status(self)) {
29 case APP_INDICATOR_STATUS_PASSIVE:
30- longname = append_panel_icon_suffix(app_indicator_get_icon(self));
31+ icon_name = app_indicator_get_icon (self);
32 gtk_status_icon_set_visible(icon, FALSE);
33- gtk_status_icon_set_from_icon_name(icon, longname);
34+ gtk_status_icon_set_from_icon_name(icon, icon_name);
35 break;
36 case APP_INDICATOR_STATUS_ACTIVE:
37- longname = append_panel_icon_suffix(app_indicator_get_icon(self));
38- gtk_status_icon_set_from_icon_name(icon, longname);
39+ icon_name = app_indicator_get_icon (self);
40+ gtk_status_icon_set_from_icon_name(icon, icon_name);
41 gtk_status_icon_set_visible(icon, TRUE);
42 break;
43 case APP_INDICATOR_STATUS_ATTENTION:
44- longname = append_panel_icon_suffix(app_indicator_get_attention_icon(self));
45- gtk_status_icon_set_from_icon_name(icon, longname);
46+ icon_name = app_indicator_get_icon (self);
47+ gtk_status_icon_set_from_icon_name(icon, icon_name);
48 gtk_status_icon_set_visible(icon, TRUE);
49 break;
50 };
51
52- if (longname) {
53- g_free(longname);
54- }
55-
56 return;
57 }
58
59@@ -1590,23 +1583,6 @@
60 return;
61 }
62
63-/* A helper function that appends PANEL_ICON_SUFFIX to the given icon name
64- if it's missing. */
65-static gchar *
66-append_panel_icon_suffix (const gchar *icon_name)
67-{
68- gchar * long_name = NULL;
69-
70- if (!g_str_has_suffix (icon_name, PANEL_ICON_SUFFIX)) {
71- long_name =
72- g_strdup_printf("%s-%s", icon_name, PANEL_ICON_SUFFIX);
73- } else {
74- long_name = g_strdup (icon_name);
75- }
76-
77- return long_name;
78-}
79-
80 static gboolean
81 widget_is_menu_child(AppIndicator * self, GtkWidget *child)
82 {

Subscribers

People subscribed via source and target branches