[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#770969: unblock: gnome-tweak-tool/3.14.2-1 (pre-approval)



Package: release.debian.org
Severity: normal
User: release.debian.org@packages.debian.org
Usertags: unblock

Dear Release Team,

I would like to see gnome-tweak-tool 3.14.2-1 accepted into Jessie
because it contains fixes for two bugs that I think are important:

* It now uses the correct gsettings key for window buttons. With the new
  key it does not override user's XSettings, and also works with both
  client-side and server-side decorations. See
  https://bugzilla.gnome.org/show_bug.cgi?id=737533.

* The window is now 20px wider that previously, avoiding the ugly
  scrollbar. See https://bugzilla.gnome.org/show_bug.cgi?id=736340.

The source package is in SVN, ready for upload.

The diff of source part (excluding translations and auto-generated parts)
is attached.

Thanks in advance,

--
Dmitry Shachnev
--- a/gtweak/tweaks/tweak_group_startup.py
+++ b/gtweak/tweaks/tweak_group_startup.py
@@ -50,9 +50,9 @@ class _AppChooser(Gtk.Dialog):
                         a,
                         _("running") if running else "")
                 if w:
-                    lb.add(w)
                     self._all[w] = a
                     self._running[w] = running
+                    lb.add(w)
 
         sw = Gtk.ScrolledWindow()
         sw.props.hscrollbar_policy = Gtk.PolicyType.NEVER
@@ -69,9 +69,23 @@ class _AppChooser(Gtk.Dialog):
         self.listbox = lb
 
     def _sort_apps(self, a, b, user_data):
-        if self._running.get(a) and not self._running.get(b):
+        arun = self._running.get(a)
+        brun = self._running.get(b)
+
+        if arun and not brun:
             return -1
-        return 1
+        elif not arun and brun:
+            return 1
+        else:
+            aname = self._all.get(a).get_name()
+            bname = self._all.get(b).get_name()
+
+            if aname < bname:
+                return -1
+            elif aname > bname:
+                return 1
+            else:
+                return 0
 
     def _build_widget(self, a, extra):
         row = Gtk.ListBoxRow()
@@ -135,8 +149,8 @@ class _StartupTweak(Gtk.ListBoxRow, Tweak):
 
         self.add(grid)
 
-        self.props.margin_left = 1
-        self.props.margin_right = 1
+        self.props.margin_start = 1
+        self.props.margin_end = 1
         self.get_style_context().add_class('tweak-startup')
 
         self.btn = btn
@@ -148,12 +162,10 @@ class AddStartupTweak(Gtk.ListBoxRow, Tweak):
                        _("Add a new application to be run at startup"),
                        **options)
 
-        self.btn = Gtk.Button(label="")
-        self.btn.get_style_context().remove_class("button")
         img = Gtk.Image()
         img.set_from_icon_name("list-add-symbolic", Gtk.IconSize.BUTTON)
-        self.btn.set_image(img)
-        self.btn.props.always_show_image = True
+        self.btn = Gtk.Button(label="", image=img, always_show_image=True)
+        self.btn.get_style_context().remove_class("button")
         self.add(self.btn)
         self.get_style_context().add_class('tweak-startup')
 
@@ -207,7 +219,7 @@ class AutostartListBoxTweakGroup(ListBoxTweakGroup):
         exes = []
         cmd = subprocess.Popen([
                     'ps','-e','-w','-w','-U',
-                    os.getlogin(),'-o','cmd'],
+                    str(os.getuid()),'-o','cmd'],
                     stdout=subprocess.PIPE)
         out = cmd.communicate()[0]
         for l in out.split('\n'):
--- a/gtweak/tweaks/tweak_group_windows.py
+++ b/gtweak/tweaks/tweak_group_windows.py
@@ -30,7 +30,6 @@ class ShowWindowButtons(GSettingsSwitchTweakValue):
 
     def __init__(self, name, value, **options):
         self.value = value
-        self._xsettings = XSettingsOverrides()
         GSettingsSwitchTweakValue.__init__(self,
                                            name,
                                            "org.gnome.desktop.wm.preferences",
@@ -51,7 +50,6 @@ class ShowWindowButtons(GSettingsSwitchTweakValue):
             val = val.replace(self.value+",", "")
 
         self.settings.set_string(self.key_name, val)
-        self._xsettings.set_window_buttons(val.replace(":", "menu:"))
 
 class WindowScalingFactorTweak(Gtk.Box, Tweak):
     def __init__(self, **options):
--- a/gtweak/tweakview.py
+++ b/gtweak/tweakview.py
@@ -32,7 +32,7 @@ class Window(Gtk.ApplicationWindow):
                                        application=app,
                                        show_menubar=False)
         
-        self.set_size_request(950, 680)
+        self.set_size_request(950, 700)
         self.set_position(Gtk.WindowPosition.CENTER)
         self.set_icon_name("gnome-tweak-tool")
         
@@ -55,6 +55,9 @@ class Window(Gtk.ApplicationWindow):
         self._model.load_tweaks(self)
         self.load_model_data()
 
+        Gtk.Settings.get_default().connect("notify::gtk-decoration-layout",
+                                          self._update_decorations);
+
         self.connect("key-press-event", self._on_key_press)
         self.add(main_box)
     
@@ -67,16 +70,15 @@ class Window(Gtk.ApplicationWindow):
         right_header = Gtk.HeaderBar()
         right_header.props.show_close_button = True
 
+        self._left_header = left_header;
+        self._right_header = right_header;
+
         left_header.get_style_context().add_class("titlebar")
         left_header.get_style_context().add_class("tweak-titlebar-left")
         right_header.get_style_context().add_class("titlebar")
         right_header.get_style_context().add_class("tweak-titlebar-right")
 
-        layout_desc = Gtk.Settings.get_default().props.gtk_decoration_layout;
-        tokens = layout_desc.split(":", 2)
-        if tokens != None:
-                right_header.props.decoration_layout = ":" + tokens[1]
-                left_header.props.decoration_layout = tokens[0]
+        self._update_decorations (Gtk.Settings.get_default(), None)
 
         self.title = Gtk.Label(label="")
         self.title.get_style_context().add_class("title")
@@ -187,6 +189,13 @@ class Window(Gtk.ApplicationWindow):
         if before and not row.get_header():
             row.set_header (Gtk.Separator(orientation=Gtk.Orientation.HORIZONTAL))
 
+    def _update_decorations(self, settings, pspec):
+        layout_desc = settings.props.gtk_decoration_layout;
+        tokens = layout_desc.split(":", 2)
+        if tokens != None:
+                self._right_header.props.decoration_layout = ":" + tokens[1]
+                self._left_header.props.decoration_layout = tokens[0]
+
     def _on_key_press(self, widget, event):
         keyname = Gdk.keyval_name(event.keyval)
         if keyname == 'Escape':
--- a/gtweak/utils.py
+++ b/gtweak/utils.py
@@ -235,7 +235,6 @@ class XSettingsOverrides:
     VARIANT_TYPES = {
         'Gtk/ShellShowsAppMenu': GLib.Variant.new_int32,
         'Gtk/EnablePrimaryPaste': GLib.Variant.new_int32,
-        'Gtk/DecorationLayout': GLib.Variant.new_string,
         'Gdk/WindowScalingFactor': GLib.Variant.new_int32,
     }
 
@@ -281,8 +280,6 @@ class XSettingsOverrides:
         self._set_override('Gtk/EnablePrimaryPaste', int(v))
     def get_enable_primary_paste(self):
         return self._get_override('Gtk/EnablePrimaryPaste', True)
-    def set_window_buttons(self, v):
-        self._set_override('Gtk/DecorationLayout', v)
     def set_window_scaling_factor(self, v):
         self._set_override('Gdk/WindowScalingFactor', int(v))
     def get_window_scaling_factor(self):

Attachment: signature.asc
Description: OpenPGP digital signature


Reply to: