aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--backend/session/direct-freebsd.c6
-rw-r--r--backend/session/direct.c6
-rw-r--r--backend/wayland/os-compatibility.c3
-rwxr-xr-xglgen.sh72
-rw-r--r--meson.build1
-rw-r--r--render/meson.build17
-rw-r--r--rootston/keyboard.c5
-rw-r--r--rootston/rootston.ini.example1
-rw-r--r--xwayland/sockets.c10
9 files changed, 60 insertions, 61 deletions
diff --git a/backend/session/direct-freebsd.c b/backend/session/direct-freebsd.c
index fc4bab04..c0621416 100644
--- a/backend/session/direct-freebsd.c
+++ b/backend/session/direct-freebsd.c
@@ -148,8 +148,8 @@ static bool setup_tty(struct direct_session *session, struct wl_display *display
struct vt_mode mode = {
.mode = VT_PROCESS,
- .relsig = SIGUSR1,
- .acqsig = SIGUSR1,
+ .relsig = SIGUSR2,
+ .acqsig = SIGUSR2,
.frsig = SIGIO, // has to be set
};
@@ -159,7 +159,7 @@ static bool setup_tty(struct direct_session *session, struct wl_display *display
}
struct wl_event_loop *loop = wl_display_get_event_loop(display);
- session->vt_source = wl_event_loop_add_signal(loop, SIGUSR1,
+ session->vt_source = wl_event_loop_add_signal(loop, SIGUSR2,
vt_handler, session);
if (!session->vt_source) {
goto error;
diff --git a/backend/session/direct.c b/backend/session/direct.c
index 942dc552..9d6cd36d 100644
--- a/backend/session/direct.c
+++ b/backend/session/direct.c
@@ -184,8 +184,8 @@ static bool setup_tty(struct direct_session *session, struct wl_display *display
struct vt_mode mode = {
.mode = VT_PROCESS,
- .relsig = SIGUSR1,
- .acqsig = SIGUSR1,
+ .relsig = SIGUSR2,
+ .acqsig = SIGUSR2,
};
if (ioctl(fd, VT_SETMODE, &mode) < 0) {
@@ -194,7 +194,7 @@ static bool setup_tty(struct direct_session *session, struct wl_display *display
}
struct wl_event_loop *loop = wl_display_get_event_loop(display);
- session->vt_source = wl_event_loop_add_signal(loop, SIGUSR1,
+ session->vt_source = wl_event_loop_add_signal(loop, SIGUSR2,
vt_handler, session);
if (!session->vt_source) {
goto error;
diff --git a/backend/wayland/os-compatibility.c b/backend/wayland/os-compatibility.c
index 14125793..cbd7988d 100644
--- a/backend/wayland/os-compatibility.c
+++ b/backend/wayland/os-compatibility.c
@@ -29,9 +29,6 @@
#include <unistd.h>
#include <fcntl.h>
#include <errno.h>
-#ifdef __linux__
-#include <sys/epoll.h>
-#endif
#include <string.h>
#include <stdlib.h>
diff --git a/glgen.sh b/glgen.sh
index 75d93c3b..5cb23225 100755
--- a/glgen.sh
+++ b/glgen.sh
@@ -7,15 +7,16 @@
# to fail if it can't load the function. You'll need to check if that function
# is NULL before using it.
-if [ $# -ne 2 ]; then
+if [ $# -ne 3 ]; then
exit 1
fi
SPEC=$1
-OUT=$2
+OUT_C=$2
+OUT_H=$3
BASE=$(basename "$SPEC" .txt)
-INCLUDE_GUARD=$(printf %s "$SPEC" | tr -c [:alnum:] _ | tr [:lower:] [:upper:])
+INCLUDE_GUARD=$(printf %s "$OUT_H" | tr -c [:alnum:] _ | tr [:lower:] [:upper:])
DECL=""
DEFN=""
@@ -57,46 +58,37 @@ while read -r COMMAND; do
fi
done < $SPEC
+cat > $OUT_H << EOF
+#ifndef $INCLUDE_GUARD
+#define $INCLUDE_GUARD
-case $OUT in
-*.h)
- cat > $OUT << EOF
- #ifndef $INCLUDE_GUARD
- #define $INCLUDE_GUARD
+#include <stdbool.h>
- #include <stdbool.h>
+#include <EGL/egl.h>
+#include <EGL/eglext.h>
+#include <EGL/eglmesaext.h>
+#include <GLES2/gl2.h>
+#include <GLES2/gl2ext.h>
- #include <EGL/egl.h>
- #include <EGL/eglext.h>
- #include <EGL/eglmesaext.h>
- #include <GLES2/gl2.h>
- #include <GLES2/gl2ext.h>
+bool load_$BASE(void);
+$DECL
- bool load_$BASE(void);
- $DECL
-
- #endif
+#endif
EOF
- ;;
-*.c)
- cat > $OUT << EOF
- #include <wlr/util/log.h>
- #include "$BASE.h"
- $DEFN
-
- bool load_$BASE(void) {
- static bool done = false;
- if (done) {
- return true;
- }
- $LOADER
-
- done = true;
- return true;
- }
+
+cat > $OUT_C << EOF
+#include <wlr/util/log.h>
+#include "$OUT_H"
+$DEFN
+
+bool load_$BASE(void) {
+ static bool done = false;
+ if (done) {
+ return true;
+ }
+$LOADER
+
+ done = true;
+ return true;
+}
EOF
- ;;
-*)
- exit 1
- ;;
-esac
diff --git a/meson.build b/meson.build
index 8ace085c..addea930 100644
--- a/meson.build
+++ b/meson.build
@@ -2,6 +2,7 @@ project(
'wlroots',
'c',
license: 'MIT',
+ meson_version: '>=0.43.0',
default_options: [
'c_std=c11',
'warning_level=2',
diff --git a/render/meson.build b/render/meson.build
index 749d1393..1eea9a83 100644
--- a/render/meson.build
+++ b/render/meson.build
@@ -1,14 +1,9 @@
glgen = find_program('../glgen.sh')
-glapi_c = custom_target('glapi.c',
+glapi = custom_target('glapi',
input: 'glapi.txt',
- output: '@BASENAME@.c',
- command: [glgen, '@INPUT@', '@OUTPUT@'],
-)
-glapi_h = custom_target('glapi.h',
- input: 'glapi.txt',
- output: '@BASENAME@.h',
- command: [glgen, '@INPUT@', '@OUTPUT@'],
+ output: ['@BASENAME@.c', '@BASENAME@.h'],
+ command: [glgen, '@INPUT@', '@OUTPUT0@', '@OUTPUT1@'],
)
lib_wlr_render = static_library(
@@ -24,13 +19,13 @@ lib_wlr_render = static_library(
'wlr_renderer.c',
'wlr_texture.c',
),
- glapi_c,
- glapi_h,
+ glapi[0],
+ glapi[1],
include_directories: wlr_inc,
dependencies: [glesv2, egl],
)
wlr_render = declare_dependency(
link_with: lib_wlr_render,
- sources: glapi_h,
+ sources: glapi[1],
)
diff --git a/rootston/keyboard.c b/rootston/keyboard.c
index f3fc9a85..0b7afcb3 100644
--- a/rootston/keyboard.c
+++ b/rootston/keyboard.c
@@ -106,6 +106,11 @@ static void keyboard_binding_execute(struct roots_keyboard *keyboard,
} else if (pid == 0) {
execl("/bin/sh", "/bin/sh", "-c", shell_cmd, (void *)NULL);
}
+ } else if (strcmp(command, "maximize") == 0) {
+ struct roots_view *focus = roots_seat_get_focus(seat);
+ if (focus != NULL) {
+ view_maximize(focus, !focus->maximized);
+ }
} else {
wlr_log(L_ERROR, "unknown binding command: %s", command);
}
diff --git a/rootston/rootston.ini.example b/rootston/rootston.ini.example
index 17467100..a2fabb6b 100644
--- a/rootston/rootston.ini.example
+++ b/rootston/rootston.ini.example
@@ -44,4 +44,5 @@ meta-key = Logo
[bindings]
Logo+Shift+e = exit
Logo+q = close
+Logo+m = maximize
Alt+Tab = next_window
diff --git a/xwayland/sockets.c b/xwayland/sockets.c
index dd732dd7..2119056d 100644
--- a/xwayland/sockets.c
+++ b/xwayland/sockets.c
@@ -21,6 +21,9 @@
static const char *lock_fmt = "/tmp/.X%d-lock";
static const char *socket_dir = "/tmp/.X11-unix";
static const char *socket_fmt = "/tmp/.X11-unix/X%d";
+#ifndef __linux__
+static const char *socket_fmt2 = "/tmp/.X11-unix/X%d_";
+#endif
static int open_socket(struct sockaddr_un *addr, size_t path_size) {
int fd, rc;
@@ -73,7 +76,7 @@ static bool open_sockets(int socks[2], int display) {
addr.sun_path[0] = 0;
path_size = snprintf(addr.sun_path + 1, sizeof(addr.sun_path) - 1, socket_fmt, display);
#else
- path_size = snprintf(addr.sun_path, sizeof(addr.sun_path), socket_fmt, display);
+ path_size = snprintf(addr.sun_path, sizeof(addr.sun_path), socket_fmt2, display);
#endif
socks[0] = open_socket(&addr, path_size);
if (socks[0] < 0) {
@@ -97,6 +100,11 @@ void unlink_display_sockets(int display) {
snprintf(sun_path, sizeof(sun_path), socket_fmt, display);
unlink(sun_path);
+#ifndef __linux__
+ snprintf(sun_path, sizeof(sun_path), socket_fmt2, display);
+ unlink(sun_path);
+#endif
+
snprintf(sun_path, sizeof(sun_path), lock_fmt, display);
unlink(sun_path);
}