Skip to content

Commit 8a2e398

Browse files
authored
Clicking: don't handle x11 primary paste (#258)
1 parent f1c351a commit 8a2e398

1 file changed

Lines changed: 4 additions & 39 deletions

File tree

src/Views/Clicking.vala

Lines changed: 4 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,6 @@
1818
*/
1919

2020
public class MouseTouchpad.ClickingView : Switchboard.SettingsPage {
21-
private GLib.Settings? xsettings;
22-
private GLib.Settings interface_settings;
23-
2421
public ClickingView () {
2522
Object (
2623
header: _("Behavior"),
@@ -160,17 +157,13 @@ public class MouseTouchpad.ClickingView : Switchboard.SettingsPage {
160157

161158
child = content_area;
162159

163-
var xsettings_schema = SettingsSchemaSource.get_default ().lookup (
164-
"org.gnome.settings-daemon.plugins.xsettings",
165-
true
166-
);
167-
if (xsettings_schema != null) {
168-
xsettings = new GLib.Settings ("org.gnome.settings-daemon.plugins.xsettings");
169-
}
160+
var action_group = new SimpleActionGroup ();
161+
action_group.add_action (new GLib.Settings ("org.gnome.desktop.interface").create_action ("gtk-enable-primary-paste"));
170162

171-
interface_settings = new GLib.Settings ("org.gnome.desktop.interface");
163+
insert_action_group ("clicking", action_group);
172164

173165
var primary_paste_switch = new Gtk.Switch () {
166+
action_name = "clicking.gtk-enable-primary-paste",
174167
halign = Gtk.Align.END,
175168
valign = Gtk.Align.CENTER
176169
};
@@ -183,21 +176,6 @@ public class MouseTouchpad.ClickingView : Switchboard.SettingsPage {
183176
content_area.attach (primary_paste_header, 0, 8);
184177
content_area.attach (primary_paste_switch, 1, 8);
185178

186-
primary_paste_switch.notify["active"].connect (() => {
187-
on_primary_paste_switch_changed (primary_paste_switch);
188-
});
189-
190-
var current_x_value = false;
191-
if (xsettings != null) {
192-
var value = xsettings.get_value ("overrides").lookup_value ("Gtk/EnablePrimaryPaste", VariantType.INT32);
193-
if (value != null) {
194-
current_x_value = value.get_int32 () == 1;
195-
}
196-
}
197-
198-
var current_wayland_value = interface_settings.get_boolean ("gtk-enable-primary-paste");
199-
primary_paste_switch.active = current_wayland_value || current_x_value;
200-
201179
var a11y_mouse_settings = new GLib.Settings ("org.gnome.desktop.a11y.mouse");
202180
a11y_mouse_settings.bind (
203181
"secondary-click-enabled",
@@ -251,17 +229,4 @@ public class MouseTouchpad.ClickingView : Switchboard.SettingsPage {
251229
return true;
252230
});
253231
}
254-
255-
private void on_primary_paste_switch_changed (Gtk.Switch switch) {
256-
if (xsettings != null) {
257-
var overrides = xsettings.get_value ("overrides");
258-
var dict = new VariantDict (overrides);
259-
dict.insert_value ("Gtk/EnablePrimaryPaste", new Variant.int32 (switch.active ? 1 : 0));
260-
261-
overrides = dict.end ();
262-
xsettings.set_value ("overrides", overrides);
263-
}
264-
265-
interface_settings.set_boolean ("gtk-enable-primary-paste", switch.active);
266-
}
267232
}

0 commit comments

Comments
 (0)