Skip to content
This repository was archived by the owner on Nov 1, 2021. It is now read-only.

Commit 96e6ab0

Browse files
committed
small fixes to the example client
1 parent d070c5e commit 96e6ab0

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

examples/wlr-workspace.c

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -31,15 +31,15 @@ struct workspace_state {
3131

3232
static void copy_state(struct workspace_state *current,
3333
struct workspace_state *pending) {
34-
if (current->name && pending->name) {
35-
free(current->name);
36-
}
3734

3835
current->state = pending->state;
3936
wl_array_copy(&current->coordinates, &pending->coordinates);
4037

41-
current->name = pending->name;
42-
pending->name = NULL;
38+
if (pending->name) {
39+
free(current->name);
40+
current->name = pending->name;
41+
pending->name = NULL;
42+
}
4343
}
4444

4545
struct workspace_v1 {
@@ -309,8 +309,6 @@ int main(int argc, char **argv) {
309309
}
310310
wl_display_roundtrip(display); // load workspace groups
311311
wl_display_roundtrip(display); // load details
312-
wl_display_roundtrip(display); // load details
313-
wl_display_roundtrip(display); // load details
314312

315313
if (focus_name != NULL) {
316314
struct workspace_v1 *focus = workspace_by_name_or_bail(focus_name);
@@ -325,6 +323,7 @@ int main(int argc, char **argv) {
325323
}
326324
}
327325
zwlr_workspace_handle_v1_activate(focus->handle);
326+
zwlr_workspace_manager_v1_commit(workspace_manager);
328327
}
329328

330329
wl_display_flush(display);

0 commit comments

Comments
 (0)