aboutsummaryrefslogtreecommitdiffstats
path: root/sway/config
diff options
context:
space:
mode:
authorLibravatar Tony Crisci <tony@dubstepdish.com>2018-01-17 09:49:02 -0500
committerLibravatar Tony Crisci <tony@dubstepdish.com>2018-01-17 09:49:02 -0500
commit9f54cd89359119897fed2747c373879c09ae8706 (patch)
tree024ecf284c38c5017068b82902d66ec4342f8291 /sway/config
parentMerge pull request #1566 from acrisci/render-loop (diff)
downloadsway-9f54cd89359119897fed2747c373879c09ae8706.tar.gz
sway-9f54cd89359119897fed2747c373879c09ae8706.tar.zst
sway-9f54cd89359119897fed2747c373879c09ae8706.zip
copy config references for input and seat
Diffstat (limited to 'sway/config')
-rw-r--r--sway/config/input.c10
-rw-r--r--sway/config/seat.c11
2 files changed, 21 insertions, 0 deletions
diff --git a/sway/config/input.c b/sway/config/input.c
index 96181302..c4f6211d 100644
--- a/sway/config/input.c
+++ b/sway/config/input.c
@@ -90,6 +90,16 @@ void merge_input_config(struct input_config *dst, struct input_config *src) {
90 } 90 }
91} 91}
92 92
93struct input_config *copy_input_config(struct input_config *ic) {
94 struct input_config *copy = calloc(1, sizeof(struct input_config));
95 if (copy == NULL) {
96 wlr_log(L_ERROR, "could not allocate input config");
97 return NULL;
98 }
99 merge_input_config(copy, ic);
100 return copy;
101}
102
93void free_input_config(struct input_config *ic) { 103void free_input_config(struct input_config *ic) {
94 if (!ic) { 104 if (!ic) {
95 return; 105 return;
diff --git a/sway/config/seat.c b/sway/config/seat.c
index 03cc6d4e..bd8b45c8 100644
--- a/sway/config/seat.c
+++ b/sway/config/seat.c
@@ -99,6 +99,17 @@ void merge_seat_config(struct seat_config *dest, struct seat_config *source) {
99 } 99 }
100} 100}
101 101
102struct seat_config *copy_seat_config(struct seat_config *seat) {
103 struct seat_config *copy = new_seat_config(seat->name);
104 if (copy == NULL) {
105 return NULL;
106 }
107
108 merge_seat_config(copy, seat);
109
110 return copy;
111}
112
102void free_seat_config(struct seat_config *seat) { 113void free_seat_config(struct seat_config *seat) {
103 if (!seat) { 114 if (!seat) {
104 return; 115 return;