Merge lp:~gary-lasker/software-center/fix-crash-lp1021308 into lp:software-center

Proposed by Gary Lasker
Status: Merged
Merged at revision: 3219
Proposed branch: lp:~gary-lasker/software-center/fix-crash-lp1021308
Merge into: lp:software-center
Diff against target: 103 lines (+16/-0)
8 files modified
softwarecenter/ui/gtk3/app.py (+2/-0)
softwarecenter/ui/gtk3/views/appdetailsview.py (+2/-0)
softwarecenter/ui/gtk3/widgets/apptreeview.py (+2/-0)
softwarecenter/ui/gtk3/widgets/buttons.py (+2/-0)
softwarecenter/ui/gtk3/widgets/containers.py (+2/-0)
softwarecenter/ui/gtk3/widgets/description.py (+2/-0)
softwarecenter/ui/gtk3/widgets/separators.py (+2/-0)
softwarecenter/ui/gtk3/widgets/stars.py (+2/-0)
To merge this branch: bzr merge lp:~gary-lasker/software-center/fix-crash-lp1021308
Reviewer Review Type Date Requested Status
Gary Lasker (community) Needs Resubmitting
Review via email: mp+127898@code.launchpad.net

Description of the change

A branch to fix the crash in bug 1021308. Note that I am unable to reproduce the conditions that cause this crash, but the fix I've implemented should take care of it in a straightforward way for all children of the StatusBar class, and it has no discernable ill effects in my testing.

This one is currently #13 in the list of Quantal's top crashers at errors.ubuntu.com.

Many thanks for your review!

To post a comment you must log in.
3214. By Gary Lasker on 2012-10-03

tweak comment

Michael Vogt (mvo) wrote :

Thanks for your branch.

I was able to reproduce the error using the instructions given in https://bugs.launchpad.net/ubuntu/+source/software-center/+bug/1021308/comments/3 (actually it was enough to run software-center from the kubuntu live-cd in a VM to trigger it). I also put instructions how to reproduce on a normal ubuntu here: https://bugs.launchpad.net/ubuntu/+source/software-center/+bug/1021308/comments/10

While this fixes the crash at hand there is another crash in the description widget plus the UI is in general in a pretty bad shape as the signal is needed in various other places as well, most noticeable in the applistview. So I think we need to fix all places where a "style-updated" signal is expected not just this one place.

Its probably easiest to simply do something like:
         self.connect("style-updated", self.on_style_updated)
+ # workaround broken engines (LP: #1021308)
+ self.emit("style-updated")

after each connect("style-updated"). Or to fix the engine, but given that lubuntu seems to have a similar problem
I suspect that there are various broken theme engines.

3215. By Gary Lasker on 2012-10-05

add mvo's workaround for broken theme engines to every instance of connecting for a style-updated signal

3216. By Gary Lasker on 2012-10-05

pep8 fix

Gary Lasker (gary-lasker) wrote :

Hi Michael, thank you for the info and for conditions to reproduce, that is extremely helpful. With the oxygen theme I see the crash now (btw, USC is quite unusable using this theme due to the text colors, but that's a separate bug).

I added a self.emit("style-updated") after every instance of "connect('style-updated', ...", per your suggestion. Things seem to be working for me now, but I'd appreciate it if you could look this over.

It's pretty nasty that the theme engines have this issue!

Gary Lasker (gary-lasker) :
review: Needs Resubmitting

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'softwarecenter/ui/gtk3/app.py'
2--- softwarecenter/ui/gtk3/app.py 2012-09-20 01:26:42 +0000
3+++ softwarecenter/ui/gtk3/app.py 2012-10-05 03:37:22 +0000
4@@ -361,6 +361,8 @@
5 init_sc_css_provider,
6 settings,
7 Gdk.Screen.get_default())
8+ # workaround broken engines (LP: #1021308)
9+ self.window_main.emit("style-updated")
10
11 # register view manager and create view panes/widgets
12 self.view_manager = ViewManager(self.notebook_view, options)
13
14=== modified file 'softwarecenter/ui/gtk3/views/appdetailsview.py'
15--- softwarecenter/ui/gtk3/views/appdetailsview.py 2012-10-01 14:23:31 +0000
16+++ softwarecenter/ui/gtk3/views/appdetailsview.py 2012-10-05 03:37:22 +0000
17@@ -101,6 +101,8 @@
18 self._bg = [1, 1, 1, 0.3]
19
20 self.connect("style-updated", self.on_style_updated)
21+ # workaround broken engines (LP: #1021308)
22+ self.emit("style-updated")
23
24 def on_style_updated(self, widget):
25 context = self.get_style_context()
26
27=== modified file 'softwarecenter/ui/gtk3/widgets/apptreeview.py'
28--- softwarecenter/ui/gtk3/widgets/apptreeview.py 2012-09-18 20:14:56 +0000
29+++ softwarecenter/ui/gtk3/widgets/apptreeview.py 2012-10-05 03:37:22 +0000
30@@ -104,6 +104,8 @@
31 self._cursor_hand = Gdk.Cursor.new(Gdk.CursorType.HAND2)
32
33 self.connect("style-updated", self._on_style_updated, self._renderer)
34+ # workaround broken engines (LP: #1021308)
35+ self.emit("style-updated")
36 # button and motion are "special"
37 self.connect("button-press-event", self._on_button_press_event,
38 self._renderer)
39
40=== modified file 'softwarecenter/ui/gtk3/widgets/buttons.py'
41--- softwarecenter/ui/gtk3/widgets/buttons.py 2012-09-18 20:14:56 +0000
42+++ softwarecenter/ui/gtk3/widgets/buttons.py 2012-10-05 03:37:22 +0000
43@@ -467,6 +467,8 @@
44
45 self.connect('size-allocate', self.on_size_allocate)
46 self.connect('style-updated', self.on_style_updated)
47+ # workaround broken engines (LP: #1021308)
48+ self.emit("style-updated")
49
50 def on_size_allocate(self, *args):
51 alloc = self.get_allocation()
52
53=== modified file 'softwarecenter/ui/gtk3/widgets/containers.py'
54--- softwarecenter/ui/gtk3/widgets/containers.py 2012-09-17 09:04:43 +0000
55+++ softwarecenter/ui/gtk3/widgets/containers.py 2012-10-05 03:37:22 +0000
56@@ -248,6 +248,8 @@
57 self._allocation = Gdk.Rectangle()
58 self.connect("size-allocate", self.on_size_allocate)
59 self.connect("style-updated", self.on_style_updated)
60+ # workaround broken engines (LP: #1021308)
61+ self.emit("style-updated")
62
63 def on_style_updated(self, widget):
64 self._frame_surface_cache = None
65
66=== modified file 'softwarecenter/ui/gtk3/widgets/description.py'
67--- softwarecenter/ui/gtk3/widgets/description.py 2012-09-12 14:08:18 +0000
68+++ softwarecenter/ui/gtk3/widgets/description.py 2012-10-05 03:37:22 +0000
69@@ -448,6 +448,8 @@
70
71 self.connect("size-allocate", self.on_size_allocate)
72 self.connect('style-updated', self._on_style_updated)
73+ # workaround broken engines (LP: #1021308)
74+ self.emit("style-updated")
75
76 def on_size_allocate(self, *args):
77 allocation = self.get_allocation()
78
79=== modified file 'softwarecenter/ui/gtk3/widgets/separators.py'
80--- softwarecenter/ui/gtk3/widgets/separators.py 2012-09-12 14:08:18 +0000
81+++ softwarecenter/ui/gtk3/widgets/separators.py 2012-10-05 03:37:22 +0000
82@@ -8,6 +8,8 @@
83 context = self.get_style_context()
84 context.add_class("item-view-separator")
85 self.connect("style-updated", self.on_style_updated)
86+ # workaround broken engines (LP: #1021308)
87+ self.emit("style-updated")
88 return
89
90 def on_style_updated(self, widget):
91
92=== modified file 'softwarecenter/ui/gtk3/widgets/stars.py'
93--- softwarecenter/ui/gtk3/widgets/stars.py 2012-05-30 18:39:55 +0000
94+++ softwarecenter/ui/gtk3/widgets/stars.py 2012-10-05 03:37:22 +0000
95@@ -303,6 +303,8 @@
96 self.set_visible_window(False)
97 self.connect("draw", self.on_draw)
98 self.connect("style-updated", self.on_style_updated)
99+ # workaround broken engines (LP: #1021308)
100+ self.emit("style-updated")
101
102 def do_get_preferred_width(self):
103 context = self.get_style_context()

Subscribers

People subscribed via source and target branches