From b8c90535c32f284ff1f6a6a6c6305338e3eb2a25 Mon Sep 17 00:00:00 2001 From: worldofpeace Date: Tue, 19 Nov 2019 14:34:33 -0500 Subject: [PATCH] pantheon.switchboard-plug-mouse-touchpad: 2.2.0 -> 2.3.0 Don't need pkgconfig override because of * https://github.com/elementary/switchboard-plug-mouse-touchpad/commit/e35153425f6be2e0ffb411ad411632cbd5a55f2b https://github.com/elementary/switchboard-plug-mouse-touchpad/releases/tag/2.3.0 --- .../mouse-touchpad/default.nix | 8 +- .../hardcode-settings-daemon-gsettings.patch | 81 +++++++++++-------- 2 files changed, 50 insertions(+), 39 deletions(-) diff --git a/pkgs/desktops/pantheon/apps/switchboard-plugs/mouse-touchpad/default.nix b/pkgs/desktops/pantheon/apps/switchboard-plugs/mouse-touchpad/default.nix index a8556bd54014..7578b7790589 100644 --- a/pkgs/desktops/pantheon/apps/switchboard-plugs/mouse-touchpad/default.nix +++ b/pkgs/desktops/pantheon/apps/switchboard-plugs/mouse-touchpad/default.nix @@ -15,13 +15,13 @@ stdenv.mkDerivation rec { pname = "switchboard-plug-mouse-touchpad"; - version = "2.2.0"; + version = "2.3.0"; src = fetchFromGitHub { owner = "elementary"; repo = pname; rev = version; - sha256 = "0mr25p7j5hl8zmvz5i3g30s4xbdhk6d22lw2akch3si40il9q5fv"; + sha256 = "1cg69nbdf4mcr16mi71aw9j8877lyj8yxjfk9bd3sml8f4fh7mmr"; }; patches = [ @@ -29,7 +29,7 @@ stdenv.mkDerivation rec { ]; postPatch = '' - substituteInPlace src/Views/General.vala \ + substituteInPlace src/Views/Clicking.vala \ --subst-var-by GSD_GSETTINGS ${glib.getSchemaPath elementary-settings-daemon} ''; @@ -54,8 +54,6 @@ stdenv.mkDerivation rec { switchboard ]; - PKG_CONFIG_SWITCHBOARD_2_0_PLUGSDIR = "${placeholder "out"}/lib/switchboard"; - meta = with stdenv.lib; { description = "Switchboard Mouse & Touchpad Plug"; homepage = https://github.com/elementary/switchboard-plug-mouse-touchpad; diff --git a/pkgs/desktops/pantheon/apps/switchboard-plugs/mouse-touchpad/hardcode-settings-daemon-gsettings.patch b/pkgs/desktops/pantheon/apps/switchboard-plugs/mouse-touchpad/hardcode-settings-daemon-gsettings.patch index b904fe153094..591ed9fc1525 100644 --- a/pkgs/desktops/pantheon/apps/switchboard-plugs/mouse-touchpad/hardcode-settings-daemon-gsettings.patch +++ b/pkgs/desktops/pantheon/apps/switchboard-plugs/mouse-touchpad/hardcode-settings-daemon-gsettings.patch @@ -1,63 +1,76 @@ -diff --git a/src/Views/General.vala b/src/Views/General.vala -index 4b19b73..dfa3d4d 100644 ---- a/src/Views/General.vala -+++ b/src/Views/General.vala -@@ -138,32 +138,34 @@ public class MouseTouchpad.GeneralView : Gtk.Grid { - attach (pointer_speed_scale, 3, 8); - attach (pointer_speed_help, 1, 9, 3); +diff --git a/src/Views/Clicking.vala b/src/Views/Clicking.vala +index cc4431b..d12ddfe 100644 +--- a/src/Views/Clicking.vala ++++ b/src/Views/Clicking.vala +@@ -123,42 +123,39 @@ public class MouseTouchpad.ClickingView : Granite.SimpleSettingsPage { + content_area.attach (hold_scale, 3, 3); + content_area. attach (hold_help, 1, 4, 3); -- var xsettings_schema = SettingsSchemaSource.get_default ().lookup ("org.gnome.settings-daemon.plugins.xsettings", false); +- var xsettings_schema = SettingsSchemaSource.get_default ().lookup ( +- "org.gnome.settings-daemon.plugins.xsettings", +- true +- ); +- - if (xsettings_schema != null) { - var primary_paste_switch = new Gtk.Switch (); - primary_paste_switch.halign = Gtk.Align.START; -- -- var primary_paste_help = new Gtk.Label (_("Middle or three-finger clicking on an input will paste any selected text")); ++ SettingsSchemaSource daemon_schema_source = new SettingsSchemaSource.from_directory ("@GSD_GSETTINGS@", null, true); ++ SettingsSchema xsettings_schema = daemon_schema_source.lookup ("org.gnome.settings-daemon.plugins.xsettings", false); + +- var primary_paste_help = new Gtk.Label ( +- _("Middle or three-finger clicking on an input will paste any selected text") +- ); - primary_paste_help.margin_bottom = 18; - primary_paste_help.wrap = true; - primary_paste_help.xalign = 0; - primary_paste_help.get_style_context ().add_class (Gtk.STYLE_CLASS_DIM_LABEL); - -- attach (new SettingLabel (_("Middle click paste:")), 0, 4); -- attach (primary_paste_switch, 1, 4); -- attach (primary_paste_help, 1, 5, 3); +- content_area.attach (new SettingLabel (_("Middle click paste:")), 0, 5); +- content_area.attach (primary_paste_switch, 1, 5); +- content_area.attach (primary_paste_help, 1, 6, 3); - - var xsettings = new GLib.Settings ("org.gnome.settings-daemon.plugins.xsettings"); -- primary_paste_switch.notify["active"].connect (() => on_primary_paste_switch_changed (primary_paste_switch, xsettings)); -- -- var current_value = xsettings.get_value ("overrides").lookup_value ("Gtk/EnablePrimaryPaste", VariantType.INT32); +- primary_paste_switch.notify["active"].connect (() => { +- on_primary_paste_switch_changed (primary_paste_switch, xsettings); +- }); ++ var primary_paste_switch = new Gtk.Switch (); ++ primary_paste_switch.halign = Gtk.Align.START; + +- var current_value = xsettings.get_value ("overrides").lookup_value ( +- "Gtk/EnablePrimaryPaste", +- VariantType.INT32 +- ); - if (current_value != null) { - primary_paste_switch.active = current_value.get_int32 () == 1; - } -+ var primary_paste_switch = new Gtk.Switch (); -+ primary_paste_switch.halign = Gtk.Align.START; -+ -+ var primary_paste_help = new Gtk.Label (_("Middle or three-finger clicking on an input will paste any selected text")); ++ var primary_paste_help = new Gtk.Label ( ++ _("Middle or three-finger clicking on an input will paste any selected text") ++ ); + primary_paste_help.margin_bottom = 18; + primary_paste_help.wrap = true; + primary_paste_help.xalign = 0; + primary_paste_help.get_style_context ().add_class (Gtk.STYLE_CLASS_DIM_LABEL); + -+ attach (new SettingLabel (_("Middle click paste:")), 0, 4); -+ attach (primary_paste_switch, 1, 4); -+ attach (primary_paste_help, 1, 5, 3); -+ -+ SettingsSchemaSource daemon_schema_source = new SettingsSchemaSource.from_directory ("@GSD_GSETTINGS@", null, true); -+ SettingsSchema xsettings_schema = daemon_schema_source.lookup ("org.gnome.settings-daemon.plugins.xsettings", false); ++ content_area.attach (new SettingLabel (_("Middle click paste:")), 0, 5); ++ content_area.attach (primary_paste_switch, 1, 5); ++ content_area.attach (primary_paste_help, 1, 6, 3); + + var xsettings = new GLib.Settings.full (xsettings_schema, null, null); -+ primary_paste_switch.notify["active"].connect (() => on_primary_paste_switch_changed (primary_paste_switch, xsettings)); ++ primary_paste_switch.notify["active"].connect (() => { ++ on_primary_paste_switch_changed (primary_paste_switch, xsettings); ++ }); + -+ var current_value = xsettings.get_value ("overrides").lookup_value ("Gtk/EnablePrimaryPaste", VariantType.INT32); ++ var current_value = xsettings.get_value ("overrides").lookup_value ( ++ "Gtk/EnablePrimaryPaste", ++ VariantType.INT32 ++ ); + if (current_value != null) { + primary_paste_switch.active = current_value.get_int32 () == 1; } - var daemon_settings = new GLib.Settings ("org.gnome.settings-daemon.peripherals.mouse"); -- daemon_settings.bind ("locate-pointer", reveal_pointer_switch, "active", GLib.SettingsBindFlags.DEFAULT); -+ SettingsSchema daemon_mouse_schema = daemon_schema_source.lookup ("org.gnome.settings-daemon.peripherals.mouse", false); -+ -+ var daemon_mouse_settings = new GLib.Settings.full (daemon_mouse_schema, null, null); -+ daemon_mouse_settings.bind ("locate-pointer", reveal_pointer_switch, "active", GLib.SettingsBindFlags.DEFAULT); ++ SettingsSchema daemon_schema = daemon_schema_source.lookup ("org.gnome.settings-daemon.peripherals.mouse", false); ++ var daemon_settings = new GLib.Settings.full (daemon_schema, null, null); + daemon_settings.bind ("double-click", double_click_speed_adjustment, "value", SettingsBindFlags.DEFAULT); var a11y_mouse_settings = new GLib.Settings ("org.gnome.desktop.a11y.mouse"); - a11y_mouse_settings.bind ("secondary-click-enabled", hold_switch, "active", GLib.SettingsBindFlags.DEFAULT);