diff options
-rw-r--r-- | meson.build | 11 | ||||
-rw-r--r-- | sway/input/cursor.c | 2 | ||||
-rw-r--r-- | sway/ipc-server.c | 13 | ||||
-rw-r--r-- | sway/tree/container.c | 13 |
4 files changed, 24 insertions, 15 deletions
diff --git a/meson.build b/meson.build index 253a4e96..76eaff20 100644 --- a/meson.build +++ b/meson.build | |||
@@ -22,6 +22,10 @@ datadir = get_option('datadir') | |||
22 | sysconfdir = get_option('sysconfdir') | 22 | sysconfdir = get_option('sysconfdir') |
23 | prefix = get_option('prefix') | 23 | prefix = get_option('prefix') |
24 | 24 | ||
25 | if is_freebsd | ||
26 | add_project_arguments('-D_C11_SOURCE', language: 'c') | ||
27 | endif | ||
28 | |||
25 | swayidle_deps = [] | 29 | swayidle_deps = [] |
26 | 30 | ||
27 | jsonc = dependency('json-c', version: '>=0.13') | 31 | jsonc = dependency('json-c', version: '>=0.13') |
@@ -40,7 +44,7 @@ gdk_pixbuf = dependency('gdk-pixbuf-2.0', required: false) | |||
40 | pixman = dependency('pixman-1') | 44 | pixman = dependency('pixman-1') |
41 | libcap = dependency('libcap', required: false) | 45 | libcap = dependency('libcap', required: false) |
42 | libinput = dependency('libinput', version: '>=1.6.0') | 46 | libinput = dependency('libinput', version: '>=1.6.0') |
43 | libpam = cc.find_library('pam') | 47 | libpam = cc.find_library('pam', required: false) |
44 | systemd = dependency('libsystemd', required: false) | 48 | systemd = dependency('libsystemd', required: false) |
45 | elogind = dependency('libelogind', required: false) | 49 | elogind = dependency('libelogind', required: false) |
46 | math = cc.find_library('m') | 50 | math = cc.find_library('m') |
@@ -133,10 +137,13 @@ subdir('swaymsg') | |||
133 | subdir('client') | 137 | subdir('client') |
134 | subdir('swaybg') | 138 | subdir('swaybg') |
135 | subdir('swaybar') | 139 | subdir('swaybar') |
136 | subdir('swaylock') | ||
137 | subdir('swayidle') | 140 | subdir('swayidle') |
138 | subdir('swaynag') | 141 | subdir('swaynag') |
139 | 142 | ||
143 | if libpam.found() | ||
144 | subdir('swaylock') | ||
145 | endif | ||
146 | |||
140 | config = configuration_data() | 147 | config = configuration_data() |
141 | config.set('sysconfdir', join_paths(prefix, sysconfdir)) | 148 | config.set('sysconfdir', join_paths(prefix, sysconfdir)) |
142 | config.set('datadir', join_paths(prefix, datadir)) | 149 | config.set('datadir', join_paths(prefix, datadir)) |
diff --git a/sway/input/cursor.c b/sway/input/cursor.c index 5111e8e5..aa0e07f5 100644 --- a/sway/input/cursor.c +++ b/sway/input/cursor.c | |||
@@ -897,7 +897,7 @@ void dispatch_cursor_button(struct sway_cursor *cursor, | |||
897 | 897 | ||
898 | // Handle moving a tiling container | 898 | // Handle moving a tiling container |
899 | if (config->tiling_drag && mod_pressed && state == WLR_BUTTON_PRESSED && | 899 | if (config->tiling_drag && mod_pressed && state == WLR_BUTTON_PRESSED && |
900 | !is_floating_or_child && !cont->is_fullscreen) { | 900 | !is_floating_or_child && cont && !cont->is_fullscreen) { |
901 | seat_pointer_notify_button(seat, time_msec, button, state); | 901 | seat_pointer_notify_button(seat, time_msec, button, state); |
902 | seat_begin_move_tiling(seat, cont, button); | 902 | seat_begin_move_tiling(seat, cont, button); |
903 | return; | 903 | return; |
diff --git a/sway/ipc-server.c b/sway/ipc-server.c index 99959c97..2d915502 100644 --- a/sway/ipc-server.c +++ b/sway/ipc-server.c | |||
@@ -1,8 +1,5 @@ | |||
1 | // See https://i3wm.org/docs/ipc.html for protocol information | 1 | // See https://i3wm.org/docs/ipc.html for protocol information |
2 | #ifndef __FreeBSD__ | 2 | #define _POSIX_C_SOURCE 200112L |
3 | // Any value will hide SOCK_CLOEXEC on FreeBSD (__BSD_VISIBLE=0) | ||
4 | #define _XOPEN_SOURCE 700 | ||
5 | #endif | ||
6 | #ifdef __linux__ | 3 | #ifdef __linux__ |
7 | #include <linux/input-event-codes.h> | 4 | #include <linux/input-event-codes.h> |
8 | #elif __FreeBSD__ | 5 | #elif __FreeBSD__ |
@@ -89,10 +86,16 @@ static void handle_display_destroy(struct wl_listener *listener, void *data) { | |||
89 | } | 86 | } |
90 | 87 | ||
91 | void ipc_init(struct sway_server *server) { | 88 | void ipc_init(struct sway_server *server) { |
92 | ipc_socket = socket(AF_UNIX, SOCK_STREAM | SOCK_NONBLOCK | SOCK_CLOEXEC, 0); | 89 | ipc_socket = socket(AF_UNIX, SOCK_STREAM, 0); |
93 | if (ipc_socket == -1) { | 90 | if (ipc_socket == -1) { |
94 | sway_abort("Unable to create IPC socket"); | 91 | sway_abort("Unable to create IPC socket"); |
95 | } | 92 | } |
93 | if (fcntl(ipc_socket, F_SETFD, FD_CLOEXEC) == -1) { | ||
94 | sway_abort("Unable to set CLOEXEC on IPC socket"); | ||
95 | } | ||
96 | if (fcntl(ipc_socket, F_SETFL, O_NONBLOCK) == -1) { | ||
97 | sway_abort("Unable to set NONBLOCK on IPC socket"); | ||
98 | } | ||
96 | 99 | ||
97 | ipc_sockaddr = ipc_user_sockaddr(); | 100 | ipc_sockaddr = ipc_user_sockaddr(); |
98 | 101 | ||
diff --git a/sway/tree/container.c b/sway/tree/container.c index 53b127b7..baaa82fd 100644 --- a/sway/tree/container.c +++ b/sway/tree/container.c | |||
@@ -67,12 +67,10 @@ void container_destroy(struct sway_container *con) { | |||
67 | list_free(con->outputs); | 67 | list_free(con->outputs); |
68 | 68 | ||
69 | if (con->view) { | 69 | if (con->view) { |
70 | struct sway_view *view = con->view; | 70 | if (con->view->container == con) { |
71 | view->container = NULL; | 71 | con->view->container = NULL; |
72 | free(view->title_format); | 72 | } |
73 | view->title_format = NULL; | 73 | if (con->view->destroying) { |
74 | |||
75 | if (view->destroying) { | ||
76 | view_destroy(con->view); | 74 | view_destroy(con->view); |
77 | } | 75 | } |
78 | } | 76 | } |
@@ -985,7 +983,8 @@ void container_discover_outputs(struct sway_container *con) { | |||
985 | } | 983 | } |
986 | } | 984 | } |
987 | struct sway_output *new_output = container_get_effective_output(con); | 985 | struct sway_output *new_output = container_get_effective_output(con); |
988 | double old_scale = old_output ? old_output->wlr_output->scale : -1; | 986 | double old_scale = old_output && old_output->enabled ? |
987 | old_output->wlr_output->scale : -1; | ||
989 | double new_scale = new_output ? new_output->wlr_output->scale : -1; | 988 | double new_scale = new_output ? new_output->wlr_output->scale : -1; |
990 | if (old_scale != new_scale) { | 989 | if (old_scale != new_scale) { |
991 | container_update_title_textures(con); | 990 | container_update_title_textures(con); |