Merge lp:~wingpanel-devs/wingpanel/fix_empty_popover into lp:~wingpanel-devs/wingpanel/trunk

Proposed by Djax
Status: Rejected
Rejected by: David Hewitt
Proposed branch: lp:~wingpanel-devs/wingpanel/fix_empty_popover
Merge into: lp:~wingpanel-devs/wingpanel/trunk
Diff against target: 61 lines (+13/-6)
2 files modified
src/Widgets/IndicatorEntry.vala (+9/-5)
src/Widgets/Panel.vala (+4/-1)
To merge this branch: bzr merge lp:~wingpanel-devs/wingpanel/fix_empty_popover
Reviewer Review Type Date Requested Status
David Hewitt Needs Information
Review via email: mp+305748@code.launchpad.net

Description of the change

Attempt to prevent empty popovers.

To post a comment you must log in.
153. By Djax

prevent empty popovers

Revision history for this message
David Hewitt (davidmhewitt) wrote :

Can you confirm whether this branch fixes it instead? It's a much simpler merge that hopefully fixes the root cause rather than trying to detect when it's happened and block it.

https://code.launchpad.net/~davidmhewitt/wingpanel/fix-empty-indicator/+merge/319754

review: Needs Information
Revision history for this message
David Hewitt (davidmhewitt) wrote :

An alternative fix for this has now been merged. Closing.

Unmerged revisions

153. By Djax

prevent empty popovers

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/Widgets/IndicatorEntry.vala'
2--- src/Widgets/IndicatorEntry.vala 2016-07-05 20:15:55 +0000
3+++ src/Widgets/IndicatorEntry.vala 2016-09-14 19:50:52 +0000
4@@ -27,16 +27,18 @@
5 public Indicator base_indicator;
6 public IndicatorMenuBar? menu_bar;
7
8- public IndicatorEntry (Indicator base_indicator, Services.PopoverManager popover_manager) {
9+ public IndicatorEntry (Indicator base_indicator) {
10 this.base_indicator = base_indicator;
11 this.halign = Gtk.Align.START;
12 this.get_style_context ().add_class (StyleClass.COMPOSITED_INDICATOR);
13 this.name = base_indicator.code_name + "/entry";
14+ }
15
16+ public bool init (Services.PopoverManager popover_manager) {
17 display_widget = base_indicator.get_display_widget ();
18
19- if (display_widget == null) {
20- return;
21+ if (display_widget == null || display_widget.get_parent () != null) {
22+ return false;
23 }
24
25 display_widget.margin_start = 4;
26@@ -57,7 +59,7 @@
27 });
28 set_reveal (base_indicator.visible);
29
30- return;
31+ return true;
32 }
33
34 popover = new IndicatorPopover (base_indicator.code_name, indicator_widget);
35@@ -136,7 +138,9 @@
36 });
37
38 set_reveal (base_indicator.visible);
39- }
40+
41+ return true;
42+ }
43
44 public void set_transition_type (Gtk.RevealerTransitionType transition_type) {
45 revealer.set_transition_type (transition_type);
46
47=== modified file 'src/Widgets/Panel.vala'
48--- src/Widgets/Panel.vala 2016-07-23 12:15:08 +0000
49+++ src/Widgets/Panel.vala 2016-09-14 19:50:52 +0000
50@@ -64,7 +64,10 @@
51 }
52
53 private void add_indicator (Indicator indicator) {
54- var indicator_entry = new IndicatorEntry (indicator, popover_manager);
55+ var indicator_entry = new IndicatorEntry (indicator);
56+ if (!indicator_entry.init (popover_manager)) {
57+ return;
58+ }
59
60 switch (indicator.code_name) {
61 case Indicator.APP_LAUNCHER:

Subscribers

People subscribed via source and target branches