Update upstream source from tag 'upstream/1.8.7'
Update to upstream version '1.8.7'
with Debian dir f2c8ac538c20ca16fc6cb09ee71e12372dfde71a
Norbert Preining
3 years ago
110 | 110 | <span class="returnvalue">void</span> |
111 | 111 | </td> |
112 | 112 | <td class="function_name"> |
113 | <a class="link" href="XAppStatusIcon.html#xapp-status-icon-popup-menu" title="xapp_status_icon_popup_menu ()">xapp_status_icon_popup_menu</a> <span class="c_punctuation">()</span> | |
114 | </td> | |
115 | </tr> | |
116 | <tr> | |
117 | <td class="function_type"> | |
118 | <span class="returnvalue">void</span> | |
119 | </td> | |
120 | <td class="function_name"> | |
113 | 121 | <a class="link" href="XAppStatusIcon.html#xapp-status-icon-set-primary-menu" title="xapp_status_icon_set_primary_menu ()">xapp_status_icon_set_primary_menu</a> <span class="c_punctuation">()</span> |
114 | 122 | </td> |
115 | 123 | </tr> |
489 | 497 | <p> the current visibility state.</p> |
490 | 498 | </div> |
491 | 499 | <p class="since">Since: 1.8.5</p> |
500 | </div> | |
501 | <hr> | |
502 | <div class="refsect2"> | |
503 | <a name="xapp-status-icon-popup-menu"></a><h3>xapp_status_icon_popup_menu ()</h3> | |
504 | <pre class="programlisting"><span class="returnvalue">void</span> | |
505 | xapp_status_icon_popup_menu (<em class="parameter"><code><a class="link" href="XAppStatusIcon.html" title="XAppStatusIcon"><span class="type">XAppStatusIcon</span></a> *icon</code></em>, | |
506 | <em class="parameter"><code><a href="../gtk3/GtkMenu.html#GtkMenu-struct"><span class="type">GtkMenu</span></a> *menu</code></em>, | |
507 | <em class="parameter"><code><a href="../glib/glib-Basic-Types.html#gint"><span class="type">gint</span></a> x</code></em>, | |
508 | <em class="parameter"><code><a href="../glib/glib-Basic-Types.html#gint"><span class="type">gint</span></a> y</code></em>, | |
509 | <em class="parameter"><code><a href="../glib/glib-Basic-Types.html#guint"><span class="type">guint</span></a> button</code></em>, | |
510 | <em class="parameter"><code><a href="../glib/glib-Basic-Types.html#guint"><span class="type">guint</span></a> _time</code></em>, | |
511 | <em class="parameter"><code><a href="../glib/glib-Basic-Types.html#gint"><span class="type">gint</span></a> panel_position</code></em>);</pre> | |
512 | <p>Pop up <em class="parameter"><code>menu</code></em> | |
513 | using the positioning arguments. These arguments should be | |
514 | those provided by a <a class="link" href="XAppStatusIcon.html#XAppStatusIcon-button-release-event" title="The “button-release-event” signal"><span class="type">“button-release-event”</span></a>.</p> | |
515 | <div class="refsect3"> | |
516 | <a name="xapp-status-icon-popup-menu.parameters"></a><h4>Parameters</h4> | |
517 | <div class="informaltable"><table class="informaltable" width="100%" border="0"> | |
518 | <colgroup> | |
519 | <col width="150px" class="parameters_name"> | |
520 | <col class="parameters_description"> | |
521 | <col width="200px" class="parameters_annotations"> | |
522 | </colgroup> | |
523 | <tbody> | |
524 | <tr> | |
525 | <td class="parameter_name"><p>icon</p></td> | |
526 | <td class="parameter_description"><p>an <a class="link" href="XAppStatusIcon.html" title="XAppStatusIcon"><span class="type">XAppStatusIcon</span></a></p></td> | |
527 | <td class="parameter_annotations"> </td> | |
528 | </tr> | |
529 | <tr> | |
530 | <td class="parameter_name"><p>menu</p></td> | |
531 | <td class="parameter_description"><p>A <a href="../gtk3/GtkMenu.html#GtkMenu-struct"><span class="type">GtkMenu</span></a> to display when the primary mouse button is released. </p></td> | |
532 | <td class="parameter_annotations"><span class="annotation">[<acronym title="NULL may be passed as the value in, out, in-out; or as a return value."><span class="acronym">nullable</span></acronym>]</span></td> | |
533 | </tr> | |
534 | <tr> | |
535 | <td class="parameter_name"><p>x</p></td> | |
536 | <td class="parameter_description"><p>The x anchor position for the menu.</p></td> | |
537 | <td class="parameter_annotations"> </td> | |
538 | </tr> | |
539 | <tr> | |
540 | <td class="parameter_name"><p>y</p></td> | |
541 | <td class="parameter_description"><p>The y anchor position for the menu.</p></td> | |
542 | <td class="parameter_annotations"> </td> | |
543 | </tr> | |
544 | <tr> | |
545 | <td class="parameter_name"><p>button</p></td> | |
546 | <td class="parameter_description"><p>The button used to initiate this action (or 0)</p></td> | |
547 | <td class="parameter_annotations"> </td> | |
548 | </tr> | |
549 | <tr> | |
550 | <td class="parameter_name"><p>_time</p></td> | |
551 | <td class="parameter_description"><p>The event time (or 0)</p></td> | |
552 | <td class="parameter_annotations"> </td> | |
553 | </tr> | |
554 | <tr> | |
555 | <td class="parameter_name"><p>panel_position</p></td> | |
556 | <td class="parameter_description"><p>The <a href="../gtk3/gtk3-Standard-Enumerations.html#GtkPositionType"><span class="type">GtkPositionType</span></a> for the position of the icon.</p></td> | |
557 | <td class="parameter_annotations"> </td> | |
558 | </tr> | |
559 | </tbody> | |
560 | </table></div> | |
561 | </div> | |
562 | <p class="since">Since: 1.8.6</p> | |
492 | 563 | </div> |
493 | 564 | <hr> |
494 | 565 | <div class="refsect2"> |
630 | 630 | </dt> |
631 | 631 | <dd></dd> |
632 | 632 | <dt> |
633 | <a class="link" href="XAppStatusIcon.html#xapp-status-icon-popup-menu" title="xapp_status_icon_popup_menu ()">xapp_status_icon_popup_menu</a>, function in <a class="link" href="XAppStatusIcon.html" title="XAppStatusIcon">XAppStatusIcon</a> | |
634 | </dt> | |
635 | <dd></dd> | |
636 | <dt> | |
633 | 637 | <a class="link" href="XAppStatusIcon.html#xapp-status-icon-set-icon-name" title="xapp_status_icon_set_icon_name ()">xapp_status_icon_set_icon_name</a>, function in <a class="link" href="XAppStatusIcon.html" title="XAppStatusIcon">XAppStatusIcon</a> |
634 | 638 | </dt> |
635 | 639 | <dd></dd> |
14 | 14 | <div> |
15 | 15 | <div><table class="navigation" id="top" width="100%" cellpadding="2" cellspacing="0"><tr><th valign="middle"><p class="title">XApp Reference Manual</p></th></tr></table></div> |
16 | 16 | <div><p class="releaseinfo"> |
17 | xapp 1.8.5 | |
17 | xapp 1.8.6 | |
18 | 18 | </p></div> |
19 | 19 | </div> |
20 | 20 | <hr> |
111 | 111 | <keyword type="function" name="xapp_status_icon_set_label ()" link="XAppStatusIcon.html#xapp-status-icon-set-label" since="1.6"/> |
112 | 112 | <keyword type="function" name="xapp_status_icon_set_visible ()" link="XAppStatusIcon.html#xapp-status-icon-set-visible" since="1.6"/> |
113 | 113 | <keyword type="function" name="xapp_status_icon_get_visible ()" link="XAppStatusIcon.html#xapp-status-icon-get-visible" since="1.8.5"/> |
114 | <keyword type="function" name="xapp_status_icon_popup_menu ()" link="XAppStatusIcon.html#xapp-status-icon-popup-menu" since="1.8.6"/> | |
114 | 115 | <keyword type="function" name="xapp_status_icon_set_primary_menu ()" link="XAppStatusIcon.html#xapp-status-icon-set-primary-menu" since="1.6"/> |
115 | 116 | <keyword type="function" name="xapp_status_icon_get_primary_menu ()" link="XAppStatusIcon.html#xapp-status-icon-get-primary-menu" since="1.6"/> |
116 | 117 | <keyword type="function" name="xapp_status_icon_set_secondary_menu ()" link="XAppStatusIcon.html#xapp-status-icon-set-secondary-menu" since="1.6"/> |
27 | 27 | <property type='s' name='Label' access='read'/> |
28 | 28 | <property type='b' name='Visible' access='read'/> |
29 | 29 | <property type='i' name='IconSize' access='readwrite'/> |
30 | <property type='b' name='PrimaryMenuIsOpen' access='read'/> | |
31 | <property type='b' name='SecondaryMenuIsOpen' access='read'/> | |
32 | <property type='s' name='Metadata' access='read' /> | |
30 | 33 | </interface> |
31 | 34 | </node>⏎ |
83 | 83 | gchar *label; |
84 | 84 | gboolean visible; |
85 | 85 | gint icon_size; |
86 | gchar *metadata; | |
86 | 87 | |
87 | 88 | guint owner_id; |
88 | 89 | guint listener_id; |
254 | 255 | } |
255 | 256 | |
256 | 257 | static void |
258 | primary_menu_unmapped (GtkWidget *widget, | |
259 | gpointer user_data) | |
260 | { | |
261 | g_return_if_fail (XAPP_IS_STATUS_ICON (user_data)); | |
262 | XAppStatusIcon *icon = XAPP_STATUS_ICON (user_data); | |
263 | ||
264 | g_debug ("XAppStatusIcon: Primary menu unmapped"); | |
265 | ||
266 | if (icon->priv->state == XAPP_STATUS_ICON_STATE_NATIVE) | |
267 | { | |
268 | xapp_status_icon_interface_set_primary_menu_is_open (icon->priv->skeleton, FALSE); | |
269 | } | |
270 | ||
271 | g_signal_handlers_disconnect_by_func (widget, primary_menu_unmapped, icon); | |
272 | } | |
273 | ||
274 | static void | |
275 | secondary_menu_unmapped (GtkWidget *widget, | |
276 | gpointer user_data) | |
277 | { | |
278 | g_return_if_fail (XAPP_IS_STATUS_ICON (user_data)); | |
279 | XAppStatusIcon *icon = XAPP_STATUS_ICON (user_data); | |
280 | ||
281 | g_debug ("XAppStatusIcon: Secondary menu unmapped"); | |
282 | ||
283 | if (icon->priv->state == XAPP_STATUS_ICON_STATE_NATIVE) | |
284 | { | |
285 | xapp_status_icon_interface_set_secondary_menu_is_open (icon->priv->skeleton, FALSE); | |
286 | } | |
287 | ||
288 | g_signal_handlers_disconnect_by_func (widget, secondary_menu_unmapped, icon); | |
289 | } | |
290 | ||
291 | static void | |
257 | 292 | popup_menu (XAppStatusIcon *self, |
258 | 293 | GtkMenu *menu, |
259 | 294 | gint x, |
268 | 303 | GdkGravity rect_anchor, menu_anchor; |
269 | 304 | |
270 | 305 | g_debug ("XAppStatusIcon: Popup menu on behalf of application"); |
306 | ||
307 | if (!gtk_widget_get_realized (GTK_WIDGET (menu))) | |
308 | { | |
309 | GtkWidget *toplevel; | |
310 | GtkStyleContext *context; | |
311 | ||
312 | gtk_widget_realize (GTK_WIDGET (menu)); | |
313 | toplevel = gtk_widget_get_toplevel (GTK_WIDGET (menu)); | |
314 | context = gtk_widget_get_style_context (toplevel); | |
315 | ||
316 | /* GtkMenu uses a GtkWindow as its toplevel that is explicitly set to | |
317 | * be client-decorated, and applies shadows outside the visible part of | |
318 | * the menu. They interfere with clicks on the icon while the menu is open, | |
319 | * as the invisible part takes the events instead (and this ends up doing | |
320 | * nothing). It makes the menu a littly ugly, so here's a new class name we | |
321 | * can use for themes to restore things bit if we want. Just avoid shadows. */ | |
322 | gtk_style_context_remove_class (context, "csd"); | |
323 | gtk_style_context_add_class (context, "xapp-status-icon-menu-window"); | |
324 | } | |
325 | ||
326 | if (button == GDK_BUTTON_PRIMARY) | |
327 | { | |
328 | if (self->priv->state == XAPP_STATUS_ICON_STATE_NATIVE) | |
329 | { | |
330 | xapp_status_icon_interface_set_primary_menu_is_open (self->priv->skeleton, TRUE); | |
331 | } | |
332 | ||
333 | g_signal_connect (gtk_widget_get_toplevel (GTK_WIDGET (menu)), | |
334 | "unmap", | |
335 | G_CALLBACK (primary_menu_unmapped), | |
336 | self); | |
337 | } | |
338 | else | |
339 | if (button == GDK_BUTTON_SECONDARY) | |
340 | { | |
341 | if (self->priv->state == XAPP_STATUS_ICON_STATE_NATIVE) | |
342 | { | |
343 | xapp_status_icon_interface_set_secondary_menu_is_open (self->priv->skeleton, TRUE); | |
344 | } | |
345 | ||
346 | g_signal_connect (gtk_widget_get_toplevel (GTK_WIDGET (menu)), | |
347 | "unmap", | |
348 | G_CALLBACK (secondary_menu_unmapped), | |
349 | self); | |
350 | } | |
271 | 351 | |
272 | 352 | event = synthesize_event (self, |
273 | 353 | x, y, button, _time, panel_position, |
654 | 734 | "icon-name", priv->icon_name, |
655 | 735 | "tooltip-text", priv->tooltip_text, |
656 | 736 | "visible", priv->visible, |
737 | "metadata", priv->metadata, | |
657 | 738 | NULL); |
658 | 739 | |
659 | 740 | g_dbus_interface_skeleton_flush (G_DBUS_INTERFACE_SKELETON (priv->skeleton)); |
1723 | 1804 | } |
1724 | 1805 | |
1725 | 1806 | /** |
1807 | * xapp_status_icon_set_metadata: | |
1808 | * @icon: an #XAppStatusIcon | |
1809 | * @metadata: (nullable): A json-formatted string of key:values. | |
1810 | * | |
1811 | * Sets metadata to pass to the icon proxy for an applet's use. Right now this is only so | |
1812 | * xapp-sn-watcher can tell the applets when the icon is originating from appindicator so panel | |
1813 | * button 'highlighting' can behave correctly. | |
1814 | * | |
1815 | * Since: 1.8.7 | |
1816 | */ | |
1817 | void | |
1818 | xapp_status_icon_set_metadata (XAppStatusIcon *icon, | |
1819 | const gchar *metadata) | |
1820 | { | |
1821 | g_return_if_fail (XAPP_IS_STATUS_ICON (icon)); | |
1822 | gchar *old_meta; | |
1823 | ||
1824 | g_debug ("XAppStatusIcon set_metadata: '%s'", metadata); | |
1825 | ||
1826 | if (g_strcmp0 (metadata, icon->priv->metadata) == 0) | |
1827 | { | |
1828 | return; | |
1829 | } | |
1830 | ||
1831 | old_meta = icon->priv->metadata; | |
1832 | icon->priv->metadata = g_strdup (metadata); | |
1833 | g_free (old_meta); | |
1834 | ||
1835 | if (icon->priv->skeleton) | |
1836 | { | |
1837 | xapp_status_icon_interface_set_metadata (icon->priv->skeleton, metadata); | |
1838 | } | |
1839 | } | |
1840 | ||
1841 | /** | |
1726 | 1842 | * xapp_status_icon_any_monitors: |
1727 | 1843 | * |
1728 | 1844 | * Looks for the existence of any active #XAppStatusIconMonitors on the bus. |
65 | 65 | void xapp_status_icon_set_secondary_menu (XAppStatusIcon *icon, GtkMenu *menu); |
66 | 66 | GtkWidget *xapp_status_icon_get_secondary_menu (XAppStatusIcon *icon); |
67 | 67 | XAppStatusIconState xapp_status_icon_get_state (XAppStatusIcon *icon); |
68 | void xapp_status_icon_set_metadata (XAppStatusIcon *icon, | |
69 | const gchar *metadata); | |
68 | 70 | |
69 | 71 | /* static */ |
70 | 72 | gboolean xapp_status_icon_any_monitors (void); |
0 | 0 | project('xapp', |
1 | 1 | 'c', |
2 | version : '1.8.6' | |
2 | version : '1.8.7' | |
3 | 3 | ) |
4 | 4 | |
5 | 5 | gnome = import('gnome') |
1 | 1 | |
2 | 2 | import locale |
3 | 3 | import gettext |
4 | import json | |
4 | 5 | import os |
5 | 6 | import sys |
6 | 7 | import setproctitle |
55 | 56 | |
56 | 57 | class StatusWidget(Gtk.ToggleButton): |
57 | 58 | def __init__(self, icon, orientation, size): |
58 | super(Gtk.Button, self).__init__() | |
59 | super(Gtk.ToggleButton, self).__init__() | |
59 | 60 | self.theme = Gtk.IconTheme.get_default() |
60 | 61 | self.orientation = orientation |
61 | 62 | self.size = size |
92 | 93 | self.proxy.bind_property("tooltip-text", self, "tooltip-markup", flags) |
93 | 94 | self.proxy.bind_property("visible", self, "visible", flags) |
94 | 95 | |
96 | self.proxy.connect("notify::primary-menu-is-open", self.menu_state_changed) | |
97 | self.proxy.connect("notify::secondary-menu-is-open", self.menu_state_changed) | |
98 | ||
99 | self.highlight_both_menus = False | |
100 | ||
101 | if self.proxy.props.metadata not in ("", None): | |
102 | try: | |
103 | meta = json.loads(self.proxy.props.metadata) | |
104 | if meta["highlight-both-menus"]: | |
105 | self.highlight_both_menus = True | |
106 | except json.JSONDecodeError as e: | |
107 | print("Could not read metadata: %s" % e) | |
108 | ||
95 | 109 | self.proxy.connect("notify::icon-name", self._on_icon_name_changed) |
96 | 110 | |
97 | 111 | self.in_widget = False |
98 | 112 | self.plain_surface = None |
99 | 113 | self.saturated_surface = None |
114 | ||
115 | self.menu_opened = False | |
100 | 116 | |
101 | 117 | self.connect("button-press-event", self.on_button_press) |
102 | 118 | self.connect("button-release-event", self.on_button_release) |
174 | 190 | self.image.set_pixel_size(self.size - ICON_SIZE_REDUCTION) |
175 | 191 | self.image.set_from_icon_name("image-missing", Gtk.IconSize.MENU) |
176 | 192 | |
193 | def menu_state_changed(self, proxy, pspec, data=None): | |
194 | if pspec.name == "primary-menu-is-open": | |
195 | prop = proxy.props.primary_menu_is_open | |
196 | else: | |
197 | prop = proxy.props.secondary_menu_is_open | |
198 | ||
199 | if not self.menu_opened or prop == False: | |
200 | self.set_active(False) | |
201 | return | |
202 | ||
203 | self.set_active(prop) | |
204 | self.menu_opened = False | |
205 | ||
177 | 206 | # TODO? |
178 | 207 | def on_enter_notify(self, widget, event): |
179 | 208 | self.in_widget = True |
186 | 215 | return Gdk.EVENT_PROPAGATE |
187 | 216 | # /TODO |
188 | 217 | |
189 | def after_release_idle(self, data=None): | |
190 | self.set_active(False) | |
191 | ||
192 | return GLib.SOURCE_REMOVE | |
193 | ||
194 | 218 | def on_button_press(self, widget, event): |
219 | self.menu_opened = False | |
220 | ||
195 | 221 | # If the user does ctrl->right-click, open the applet's about menu |
196 | 222 | # instead of sending to the app. |
197 | 223 | if event.state & Gdk.ModifierType.CONTROL_MASK and event.button == Gdk.BUTTON_SECONDARY: |
202 | 228 | x, y = self.calc_menu_origin(widget, orientation) |
203 | 229 | self.proxy.call_button_press(x, y, event.button, event.time, orientation, None, None) |
204 | 230 | |
205 | if event.button != Gdk.BUTTON_PRIMARY: | |
206 | self.set_active(True) | |
207 | ||
208 | 231 | if event.button in (Gdk.BUTTON_MIDDLE, Gdk.BUTTON_SECONDARY): |
209 | 232 | # Block the 'remove from panel' menu, and the middle-click drag. |
210 | 233 | # They can still accomplish these things along the edges of the applet |
211 | 234 | return Gdk.EVENT_STOP |
212 | 235 | |
213 | return Gdk.EVENT_PROPAGATE | |
236 | return Gdk.EVENT_STOP | |
214 | 237 | |
215 | 238 | def on_button_release(self, widget, event): |
216 | 239 | orientation = translate_applet_orientation_to_xapp(self.orientation) |
217 | 240 | |
241 | if event.button == Gdk.BUTTON_PRIMARY: | |
242 | self.menu_opened = True | |
243 | elif event.button == Gdk.BUTTON_SECONDARY and self.highlight_both_menus: | |
244 | self.menu_opened = True | |
245 | ||
218 | 246 | x, y = self.calc_menu_origin(widget, orientation) |
219 | 247 | self.proxy.call_button_release(x, y, event.button, event.time, orientation, None, None) |
220 | ||
221 | GObject.timeout_add(200, self.after_release_idle) | |
222 | 248 | |
223 | 249 | return Gdk.EVENT_PROPAGATE |
224 | 250 |
4 | 4 | from gi.repository import Gio, GLib, GObject, Gtk, XApp, Gdk |
5 | 5 | import os |
6 | 6 | import sys |
7 | import json | |
7 | 8 | |
8 | 9 | DBUS_NAME = "org.x.StatusIcon" |
9 | 10 | DBUS_PATH = "/org/x/StatusIcon" |
10 | 11 | |
11 | class StatusWidget(Gtk.Button): | |
12 | class StatusWidget(Gtk.ToggleButton): | |
12 | 13 | |
13 | 14 | def __init__(self, icon): |
14 | super(Gtk.Button, self).__init__() | |
15 | super(Gtk.ToggleButton, self).__init__() | |
15 | 16 | |
16 | 17 | self.proxy = icon |
17 | 18 | self.name = self.proxy.get_name() |
35 | 36 | self.proxy.bind_property("label", self.label, "label", flags) |
36 | 37 | self.proxy.bind_property("tooltip-text", self, "tooltip-markup", flags) |
37 | 38 | self.proxy.bind_property("visible", self, "visible", flags) |
39 | ||
40 | self.proxy.bind_property("primary-menu-is-open", self, "active", flags) | |
41 | self.proxy.bind_property("secondary-menu-is-open", self, "active", flags) | |
38 | 42 | |
39 | 43 | self.proxy.connect("notify::icon-name", self.on_icon_name_changed) |
40 | 44 |
21 | 21 | self.status_icon.set_tooltip_text("Testing primary and secondary menus") |
22 | 22 | self.status_icon.set_label("label 1") |
23 | 23 | self.status_icon.set_visible(True) |
24 | self.status_icon.set_metadata(' { "highlight-both-menus": true } ') | |
25 | ||
24 | 26 | self.status_icon.connect("scroll-event", self.handle_scroll_event) |
25 | 27 | |
26 | 28 | self.counter = 1 |
587 | 587 | { |
588 | 588 | g_autoptr(GVariant) tt_var; |
589 | 589 | |
590 | if (item->is_ai) | |
591 | { | |
592 | gchar *text; | |
593 | ||
594 | text = get_string_property (item, "XAyatanaLabel"); | |
595 | ||
596 | if (text) | |
597 | { | |
598 | xapp_status_icon_set_tooltip_text (item->status_icon, text); | |
599 | g_debug ("Tooltip text from XAyatanaLabel: %s", text); | |
600 | ||
601 | g_free (text); | |
602 | return; | |
603 | } | |
604 | } | |
605 | ||
606 | 590 | tt_var = get_property (item, "ToolTip"); |
607 | 591 | |
608 | 592 | if (tt_var) |
724 | 708 | update_menu (item); |
725 | 709 | } |
726 | 710 | else |
727 | if (g_strcmp0 (signal_name, "XAyatanaNewLabel") || | |
728 | g_strcmp0 (signal_name, "NewToolTip") || | |
711 | if (g_strcmp0 (signal_name, "NewToolTip") || | |
729 | 712 | g_strcmp0 (signal_name, "NewTitle")) |
730 | 713 | { |
731 | 714 | update_tooltip (item); |
855 | 838 | { |
856 | 839 | SnItem *item = SN_ITEM (user_data); |
857 | 840 | GError *error = NULL; |
841 | gchar *json = NULL; | |
858 | 842 | |
859 | 843 | item->prop_proxy = g_dbus_proxy_new_finish (res, &error); |
860 | 844 | |
871 | 855 | item); |
872 | 856 | |
873 | 857 | item->status_icon = xapp_status_icon_new (); |
858 | ||
859 | json = g_strdup_printf ("{ 'highlight-both-menus': %s }", item->is_ai ? "true" : "false"); | |
860 | xapp_status_icon_set_metadata (item->status_icon, json); | |
861 | g_free (json); | |
874 | 862 | |
875 | 863 | g_signal_connect (item->status_icon, "activate", G_CALLBACK (xapp_icon_activated), item); |
876 | 864 | g_signal_connect (item->status_icon, "button-press-event", G_CALLBACK (xapp_icon_button_press), item); |
70 | 70 | <!-- These are commented out because GDBusProxy would otherwise require them, |
71 | 71 | but they are not available for KDE indicators |
72 | 72 | --> |
73 | <signal name="XAyatanaNewLabel"> | |
73 | <!-- <signal name="XAyatanaNewLabel"> | |
74 | 74 | <arg type="s" name="label" direction="out" /> |
75 | 75 | <arg type="s" name="guide" direction="out" /> |
76 | 76 | </signal> |
77 | 77 | <property name="XAyatanaLabel" type="s" access="read" /> |
78 | 78 | <property name="XAyatanaLabelGuide" type="s" access="read" /> |
79 | 79 | |
80 | ||
80 | --> | |
81 | 81 | </interface> |
82 | 82 | </node> |
506 | 506 | watcher->name_listener_id = 0; |
507 | 507 | } |
508 | 508 | |
509 | update_published_items (watcher); | |
509 | 510 | g_clear_pointer (&watcher->items, g_hash_table_unref); |
510 | 511 | |
511 | 512 | sn_watcher_interface_set_is_status_notifier_host_registered (watcher->skeleton, |
512 | 513 | FALSE); |
513 | 514 | g_dbus_interface_skeleton_flush (G_DBUS_INTERFACE_SKELETON (watcher->skeleton)); |
514 | 515 | sn_watcher_interface_emit_status_notifier_host_registered (watcher->skeleton); |
515 | ||
516 | update_published_items (watcher); | |
517 | 516 | |
518 | 517 | if (watcher->owner_id > 0) |
519 | 518 | { |