~rbalint/update-manager/no-apt-lock

« back to all changes in this revision

Viewing changes to UpdateManager/UpdateManager.py

  • Committer: Mathieu Trudel-Lapierre
  • Date: 2018-05-28 14:03:50 UTC
  • Revision ID: mathieu.trudel-lapierre@canonical.com-20180528140350-5a2az99zuqs3rzj5
Block style context changed signal while enforcing the main window's
constant size. Thanks to Thomas Waldmann and Sebastien Bacher for the
initial analysis of  this bug. (LP: #1637180)

Show diffs side-by-side

added added

removed removed

Lines of Context:
26
26
from gi.repository import Gdk, GdkX11
27
27
from gi.repository import Gio
28
28
from gi.repository import GLib
 
29
from gi.repository import GObject
29
30
 
30
31
GdkX11  # pyflakes
31
32
 
94
95
 
95
96
        # Keep window at a constant size
96
97
        ctx = self.get_style_context()
97
 
        ctx.connect("changed", lambda ctx: self.resize_to_standard_width())
 
98
        self.style_changed = ctx.connect("changed",
 
99
                                         lambda ctx:
 
100
                                             self.resize_to_standard_width())
98
101
 
99
102
        # Signals
100
103
        self.connect("delete-event", self._on_close)
135
138
        if dpi <= 0:
136
139
            dpi = 96
137
140
        ctx = self.get_style_context()
 
141
        GObject.signal_handler_block(ctx, self.signal_changed)
138
142
        size = ctx.get_property("font-size", Gtk.StateFlags.NORMAL)
139
143
        width = dpi / 72 * size * num_em
140
144
        self.set_size_request(width, -1)
 
145
        GObject.signal_handler_unblock(ctx, self.signal_changed)
141
146
 
142
147
    def on_initial_focus_in(self, widget, event):
143
148
        """callback run on initial focus-in (if started unmapped)"""