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

tweak comment

Revision history for this message
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

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

3216. By Gary Lasker

pep8 fix

Revision history for this message
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!

Revision history for this message
Gary Lasker (gary-lasker) :
review: Needs Resubmitting

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'softwarecenter/ui/gtk3/app.py'
--- softwarecenter/ui/gtk3/app.py 2012-09-20 01:26:42 +0000
+++ softwarecenter/ui/gtk3/app.py 2012-10-05 03:37:22 +0000
@@ -361,6 +361,8 @@
361 init_sc_css_provider,361 init_sc_css_provider,
362 settings,362 settings,
363 Gdk.Screen.get_default())363 Gdk.Screen.get_default())
364 # workaround broken engines (LP: #1021308)
365 self.window_main.emit("style-updated")
364366
365 # register view manager and create view panes/widgets367 # register view manager and create view panes/widgets
366 self.view_manager = ViewManager(self.notebook_view, options)368 self.view_manager = ViewManager(self.notebook_view, options)
367369
=== modified file 'softwarecenter/ui/gtk3/views/appdetailsview.py'
--- softwarecenter/ui/gtk3/views/appdetailsview.py 2012-10-01 14:23:31 +0000
+++ softwarecenter/ui/gtk3/views/appdetailsview.py 2012-10-05 03:37:22 +0000
@@ -101,6 +101,8 @@
101 self._bg = [1, 1, 1, 0.3]101 self._bg = [1, 1, 1, 0.3]
102102
103 self.connect("style-updated", self.on_style_updated)103 self.connect("style-updated", self.on_style_updated)
104 # workaround broken engines (LP: #1021308)
105 self.emit("style-updated")
104106
105 def on_style_updated(self, widget):107 def on_style_updated(self, widget):
106 context = self.get_style_context()108 context = self.get_style_context()
107109
=== modified file 'softwarecenter/ui/gtk3/widgets/apptreeview.py'
--- softwarecenter/ui/gtk3/widgets/apptreeview.py 2012-09-18 20:14:56 +0000
+++ softwarecenter/ui/gtk3/widgets/apptreeview.py 2012-10-05 03:37:22 +0000
@@ -104,6 +104,8 @@
104 self._cursor_hand = Gdk.Cursor.new(Gdk.CursorType.HAND2)104 self._cursor_hand = Gdk.Cursor.new(Gdk.CursorType.HAND2)
105105
106 self.connect("style-updated", self._on_style_updated, self._renderer)106 self.connect("style-updated", self._on_style_updated, self._renderer)
107 # workaround broken engines (LP: #1021308)
108 self.emit("style-updated")
107 # button and motion are "special"109 # button and motion are "special"
108 self.connect("button-press-event", self._on_button_press_event,110 self.connect("button-press-event", self._on_button_press_event,
109 self._renderer)111 self._renderer)
110112
=== modified file 'softwarecenter/ui/gtk3/widgets/buttons.py'
--- softwarecenter/ui/gtk3/widgets/buttons.py 2012-09-18 20:14:56 +0000
+++ softwarecenter/ui/gtk3/widgets/buttons.py 2012-10-05 03:37:22 +0000
@@ -467,6 +467,8 @@
467467
468 self.connect('size-allocate', self.on_size_allocate)468 self.connect('size-allocate', self.on_size_allocate)
469 self.connect('style-updated', self.on_style_updated)469 self.connect('style-updated', self.on_style_updated)
470 # workaround broken engines (LP: #1021308)
471 self.emit("style-updated")
470472
471 def on_size_allocate(self, *args):473 def on_size_allocate(self, *args):
472 alloc = self.get_allocation()474 alloc = self.get_allocation()
473475
=== modified file 'softwarecenter/ui/gtk3/widgets/containers.py'
--- softwarecenter/ui/gtk3/widgets/containers.py 2012-09-17 09:04:43 +0000
+++ softwarecenter/ui/gtk3/widgets/containers.py 2012-10-05 03:37:22 +0000
@@ -248,6 +248,8 @@
248 self._allocation = Gdk.Rectangle()248 self._allocation = Gdk.Rectangle()
249 self.connect("size-allocate", self.on_size_allocate)249 self.connect("size-allocate", self.on_size_allocate)
250 self.connect("style-updated", self.on_style_updated)250 self.connect("style-updated", self.on_style_updated)
251 # workaround broken engines (LP: #1021308)
252 self.emit("style-updated")
251253
252 def on_style_updated(self, widget):254 def on_style_updated(self, widget):
253 self._frame_surface_cache = None255 self._frame_surface_cache = None
254256
=== modified file 'softwarecenter/ui/gtk3/widgets/description.py'
--- softwarecenter/ui/gtk3/widgets/description.py 2012-09-12 14:08:18 +0000
+++ softwarecenter/ui/gtk3/widgets/description.py 2012-10-05 03:37:22 +0000
@@ -448,6 +448,8 @@
448448
449 self.connect("size-allocate", self.on_size_allocate)449 self.connect("size-allocate", self.on_size_allocate)
450 self.connect('style-updated', self._on_style_updated)450 self.connect('style-updated', self._on_style_updated)
451 # workaround broken engines (LP: #1021308)
452 self.emit("style-updated")
451453
452 def on_size_allocate(self, *args):454 def on_size_allocate(self, *args):
453 allocation = self.get_allocation()455 allocation = self.get_allocation()
454456
=== modified file 'softwarecenter/ui/gtk3/widgets/separators.py'
--- softwarecenter/ui/gtk3/widgets/separators.py 2012-09-12 14:08:18 +0000
+++ softwarecenter/ui/gtk3/widgets/separators.py 2012-10-05 03:37:22 +0000
@@ -8,6 +8,8 @@
8 context = self.get_style_context()8 context = self.get_style_context()
9 context.add_class("item-view-separator")9 context.add_class("item-view-separator")
10 self.connect("style-updated", self.on_style_updated)10 self.connect("style-updated", self.on_style_updated)
11 # workaround broken engines (LP: #1021308)
12 self.emit("style-updated")
11 return13 return
1214
13 def on_style_updated(self, widget):15 def on_style_updated(self, widget):
1416
=== modified file 'softwarecenter/ui/gtk3/widgets/stars.py'
--- softwarecenter/ui/gtk3/widgets/stars.py 2012-05-30 18:39:55 +0000
+++ softwarecenter/ui/gtk3/widgets/stars.py 2012-10-05 03:37:22 +0000
@@ -303,6 +303,8 @@
303 self.set_visible_window(False)303 self.set_visible_window(False)
304 self.connect("draw", self.on_draw)304 self.connect("draw", self.on_draw)
305 self.connect("style-updated", self.on_style_updated)305 self.connect("style-updated", self.on_style_updated)
306 # workaround broken engines (LP: #1021308)
307 self.emit("style-updated")
306308
307 def do_get_preferred_width(self):309 def do_get_preferred_width(self):
308 context = self.get_style_context()310 context = self.get_style_context()

Subscribers

People subscribed via source and target branches