Merge lp:~khurshid-alam/indicator-appmenu/ignore-desktop-focal into lp:indicator-appmenu

Proposed by Khurshid Alam
Status: Merged
Approved by: Dmitry Shachnev
Approved revision: 286
Merged at revision: 285
Proposed branch: lp:~khurshid-alam/indicator-appmenu/ignore-desktop-focal
Merge into: lp:indicator-appmenu
Diff against target: 170 lines (+18/-21)
5 files modified
src/gdk-get-func.c (+3/-3)
src/indicator-appmenu.c (+7/-4)
src/window-menu-dbusmenu.c (+4/-6)
src/window-menu-model.c (+4/-6)
src/window-menu.c (+0/-2)
To merge this branch: bzr merge lp:~khurshid-alam/indicator-appmenu/ignore-desktop-focal
Reviewer Review Type Date Requested Status
Dmitry Shachnev Approve
Sebastien Bacher Pending
Review via email: mp+379727@code.launchpad.net

Commit message

Fix deprecation warnings; do not track menus for desktop windows.

To post a comment you must log in.
Revision history for this message
Khurshid Alam (khurshid-alam) wrote :

Note, part of the this merge has already been approved before. But I needed to rebase and couldn't overwrite other branch. So I opened this instead.

Please review and merge if don't have any objection.

Revision history for this message
Dmitry Shachnev (mitya57) wrote :

Thanks! It mostly looks good to me, and I can include it in my indicator-appmenu upload. I have left one inline comment — if you fix it, it will be even better.

Also do you know if we can revert https://bazaar.launchpad.net/~indicator-applet-developers/indicator-appmenu/trunk.16.10/revision/282 now?

review: Approve
Revision history for this message
Alberts Muktupāvels (muktupavels) :
286. By Khurshid Alam

 * Do not call gdk_display_get_default everytime. Instead use a variable.
* Fix typo. Remove extra semicolon.

Revision history for this message
Khurshid Alam (khurshid-alam) wrote :

>Also do you know if we can revert https://bazaar.launchpad.net/~indicator-applet-developers/indicator-appmenu/trunk.16.10/revision/282 now?

Yes. That should be reverted.

Revision history for this message
Sebastien Bacher (seb128) :
Revision history for this message
Dmitry Shachnev (mitya57) wrote :

I have updated the commit message because multi-line messages are not properly handled by Bileto, see https://launchpad.net/~ci-train-ppa-service/+archive/ubuntu/4101/+sourcepub/11371988/+listing-archive-extra.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/gdk-get-func.c'
2--- src/gdk-get-func.c 2010-10-06 18:43:21 +0000
3+++ src/gdk-get-func.c 2020-06-17 11:42:30 +0000
4@@ -93,13 +93,13 @@
5
6 hints_atom = gdk_x11_get_xatom_by_name_for_display (display, _XA_MOTIF_WM_HINTS);
7
8- gdk_error_trap_push ();
9+ gdk_x11_display_error_trap_push (display);
10 XGetWindowProperty (GDK_DISPLAY_XDISPLAY (display), window,
11 hints_atom, 0, sizeof (MotifWmHints)/sizeof (long),
12 False, AnyPropertyType, &type, &format, &nitems,
13 &bytes_after, &data);
14- gdk_flush ();
15- if ((ret = gdk_error_trap_pop ()))
16+ gdk_display_flush (display);
17+ if ((ret = gdk_x11_display_error_trap_pop (display)))
18 {
19 g_warning ("%s: Unable to get hints for %u: Error Code: %d", G_STRFUNC, (guint32)window, ret);
20 return NULL;
21
22=== modified file 'src/indicator-appmenu.c'
23--- src/indicator-appmenu.c 2015-10-28 15:34:43 +0000
24+++ src/indicator-appmenu.c 2020-06-17 11:42:30 +0000
25@@ -459,6 +459,7 @@
26 static void
27 close_current (GtkMenuItem * mi, gpointer user_data)
28 {
29+ GdkDisplay *display;
30 IndicatorAppmenu * iapp = INDICATOR_APPMENU(user_data);
31
32 if (!BAMF_IS_WINDOW (iapp->active_window) || bamf_view_is_closed (BAMF_VIEW (iapp->active_window))) {
33@@ -484,14 +485,16 @@
34 xev.xclient.data.l[3] = 0;
35 xev.xclient.data.l[4] = 0;
36
37- gdk_error_trap_push ();
38+ display = gdk_display_get_default ();
39+
40+ gdk_x11_display_error_trap_push (display);
41 XSendEvent (gdk_x11_get_default_xdisplay (),
42 gdk_x11_get_default_root_xwindow (),
43 False,
44 SubstructureRedirectMask | SubstructureNotifyMask,
45 &xev);
46- gdk_flush ();
47- gdk_error_trap_pop_ignored ();
48+ gdk_display_flush (display);
49+ gdk_x11_display_error_trap_pop_ignored (display);
50
51 return;
52 }
53@@ -1067,7 +1070,7 @@
54 if (menus == NULL) {
55 gchar * uniquename = bamf_window_get_utf8_prop (window, "_GTK_UNIQUE_BUS_NAME");
56
57- if (uniquename != NULL) {
58+ if (uniquename != NULL && bamf_window_get_window_type (window) != BAMF_WINDOW_DESKTOP) {
59 BamfApplication * app = bamf_matcher_get_application_for_window(iapp->matcher, window);
60
61 menus = WINDOW_MENU(window_menu_model_new(app, window));
62
63=== modified file 'src/window-menu-dbusmenu.c'
64--- src/window-menu-dbusmenu.c 2015-06-01 17:44:45 +0000
65+++ src/window-menu-dbusmenu.c 2020-06-17 11:42:30 +0000
66@@ -57,7 +57,7 @@
67 };
68
69 #define WINDOW_MENU_DBUSMENU_GET_PRIVATE(o) \
70-(G_TYPE_INSTANCE_GET_PRIVATE ((o), WINDOW_MENU_DBUSMENU_TYPE, WindowMenuDbusmenuPrivate))
71+(window_menu_dbusmenu_get_instance_private (WINDOW_MENU_DBUSMENU(o)))
72
73 /* Prototypes */
74
75@@ -81,7 +81,7 @@
76 static void entry_restore (WindowMenu * wm, IndicatorObjectEntry * entry);
77 static void entry_activate (WindowMenu * wm, IndicatorObjectEntry * entry, guint timestamp);
78
79-G_DEFINE_TYPE (WindowMenuDbusmenu, window_menu_dbusmenu, WINDOW_MENU_TYPE);
80+G_DEFINE_TYPE_WITH_PRIVATE (WindowMenuDbusmenu, window_menu_dbusmenu, WINDOW_MENU_TYPE);
81
82 /* Build the one-time class */
83 static void
84@@ -89,8 +89,6 @@
85 {
86 GObjectClass *object_class = G_OBJECT_CLASS (klass);
87
88- g_type_class_add_private (klass, sizeof (WindowMenuDbusmenuPrivate));
89-
90 object_class->dispose = window_menu_dbusmenu_dispose;
91
92 WindowMenuClass * menu_class = WINDOW_MENU_CLASS(klass);
93@@ -617,14 +615,14 @@
94 if (children != NULL) {
95 gpointer * data = g_new(gpointer, 2);
96 data[0] = user_data;
97- data[1] = g_object_ref(newentry);
98+ data[1] = (DbusmenuMenuitem*)g_object_ref(newentry);
99
100 g_signal_connect_data(G_OBJECT(children->data), DBUSMENU_MENUITEM_SIGNAL_REALIZED, G_CALLBACK(menu_child_realized), data, child_realized_data_cleanup, 0);
101 } else {
102 /* Menu entry has no children */
103 gpointer * data = g_new(gpointer, 2);
104 data[0] = user_data;
105- data[1] = g_object_ref(newentry);
106+ data[1] = (DbusmenuMenuitem*)g_object_ref(newentry);
107
108 /* Make sure the menu item gets displayed on the menu bar */
109 menu_child_realized(NULL, data);
110
111=== modified file 'src/window-menu-model.c'
112--- src/window-menu-model.c 2015-06-01 17:44:45 +0000
113+++ src/window-menu-model.c 2020-06-17 11:42:30 +0000
114@@ -48,7 +48,7 @@
115 };
116
117 #define WINDOW_MENU_MODEL_GET_PRIVATE(o) \
118-(G_TYPE_INSTANCE_GET_PRIVATE ((o), WINDOW_MENU_MODEL_TYPE, WindowMenuModelPrivate))
119+(window_menu_model_get_instance_private (WINDOW_MENU_MODEL(o)))
120
121 /* Base class stuff */
122 static void window_menu_model_class_init (WindowMenuModelClass *klass);
123@@ -64,7 +64,7 @@
124 static guint get_xid (WindowMenu * wm);
125
126 /* GLib boilerplate */
127-G_DEFINE_TYPE (WindowMenuModel, window_menu_model, WINDOW_MENU_TYPE);
128+G_DEFINE_TYPE_WITH_PRIVATE (WindowMenuModel, window_menu_model, WINDOW_MENU_TYPE);
129
130 /* Prefixes to the action muxer */
131 #define ACTION_MUX_PREFIX_APP "app"
132@@ -79,8 +79,6 @@
133 {
134 GObjectClass *object_class = G_OBJECT_CLASS (klass);
135
136- g_type_class_add_private (klass, sizeof (WindowMenuModelPrivate));
137-
138 object_class->dispose = window_menu_model_dispose;
139
140 WindowMenuClass * wm_class = WINDOW_MENU_CLASS(klass);
141@@ -146,7 +144,7 @@
142 {
143 g_return_if_fail(G_IS_MENU_MODEL(model));
144
145- menu->priv->app_menu_model = g_object_ref(model);
146+ menu->priv->app_menu_model = (GDBusMenuModel*)g_object_ref(model);
147 menu->priv->application_menu.parent_window = menu->priv->xid;
148
149 if (appname != NULL) {
150@@ -398,7 +396,7 @@
151 static void
152 add_window_menu (WindowMenuModel * menu, GMenuModel * model)
153 {
154- menu->priv->win_menu_model = g_object_ref(model);
155+ menu->priv->win_menu_model = (GDBusMenuModel*)g_object_ref(model);
156
157 menu->priv->win_menu = GTK_MENU_BAR(gtk_menu_bar_new_from_model(model));
158 g_assert(menu->priv->win_menu != NULL);
159
160=== modified file 'src/window-menu.c'
161--- src/window-menu.c 2015-06-03 23:10:07 +0000
162+++ src/window-menu.c 2020-06-17 11:42:30 +0000
163@@ -24,8 +24,6 @@
164 #include "window-menu.h"
165 #include "indicator-appmenu-marshal.h"
166
167-#define WINDOW_MENU_GET_PRIVATE(o) \
168-(G_TYPE_INSTANCE_GET_PRIVATE ((o), WINDOW_MENU_TYPE, WindowMenuPrivate))
169
170 /* Signals */
171

Subscribers

People subscribed via source and target branches