summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--meson.build11
-rw-r--r--sway/input/cursor.c2
-rw-r--r--sway/ipc-server.c13
-rw-r--r--sway/tree/container.c13
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')
22sysconfdir = get_option('sysconfdir') 22sysconfdir = get_option('sysconfdir')
23prefix = get_option('prefix') 23prefix = get_option('prefix')
24 24
25if is_freebsd
26 add_project_arguments('-D_C11_SOURCE', language: 'c')
27endif
28
25swayidle_deps = [] 29swayidle_deps = []
26 30
27jsonc = dependency('json-c', version: '>=0.13') 31jsonc = dependency('json-c', version: '>=0.13')
@@ -40,7 +44,7 @@ gdk_pixbuf = dependency('gdk-pixbuf-2.0', required: false)
40pixman = dependency('pixman-1') 44pixman = dependency('pixman-1')
41libcap = dependency('libcap', required: false) 45libcap = dependency('libcap', required: false)
42libinput = dependency('libinput', version: '>=1.6.0') 46libinput = dependency('libinput', version: '>=1.6.0')
43libpam = cc.find_library('pam') 47libpam = cc.find_library('pam', required: false)
44systemd = dependency('libsystemd', required: false) 48systemd = dependency('libsystemd', required: false)
45elogind = dependency('libelogind', required: false) 49elogind = dependency('libelogind', required: false)
46math = cc.find_library('m') 50math = cc.find_library('m')
@@ -133,10 +137,13 @@ subdir('swaymsg')
133subdir('client') 137subdir('client')
134subdir('swaybg') 138subdir('swaybg')
135subdir('swaybar') 139subdir('swaybar')
136subdir('swaylock')
137subdir('swayidle') 140subdir('swayidle')
138subdir('swaynag') 141subdir('swaynag')
139 142
143if libpam.found()
144 subdir('swaylock')
145endif
146
140config = configuration_data() 147config = configuration_data()
141config.set('sysconfdir', join_paths(prefix, sysconfdir)) 148config.set('sysconfdir', join_paths(prefix, sysconfdir))
142config.set('datadir', join_paths(prefix, datadir)) 149config.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
91void ipc_init(struct sway_server *server) { 88void 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);