diff options
-rw-r--r-- | backend/drm/renderer.c | 2 | ||||
-rw-r--r-- | backend/session/direct-freebsd.c | 6 | ||||
-rw-r--r-- | backend/session/direct.c | 6 | ||||
-rw-r--r-- | backend/wayland/os-compatibility.c | 3 | ||||
-rwxr-xr-x | glgen.sh | 72 | ||||
-rw-r--r-- | meson.build | 1 | ||||
-rw-r--r-- | render/egl.c | 2 | ||||
-rw-r--r-- | render/gles2/renderer.c | 2 | ||||
-rw-r--r-- | render/meson.build | 17 | ||||
-rw-r--r-- | rootston/keyboard.c | 5 | ||||
-rw-r--r-- | rootston/rootston.ini.example | 1 | ||||
-rw-r--r-- | types/wlr_output.c | 4 | ||||
-rw-r--r-- | xwayland/sockets.c | 10 |
13 files changed, 67 insertions, 64 deletions
diff --git a/backend/drm/renderer.c b/backend/drm/renderer.c index d53acaa8..87064914 100644 --- a/backend/drm/renderer.c +++ b/backend/drm/renderer.c @@ -14,7 +14,7 @@ #include <wlr/render/gles2.h> #include <wlr/render.h> #include "backend/drm/drm.h" -#include "render/glapi.h" +#include "glapi.h" bool wlr_drm_renderer_init(struct wlr_drm_backend *drm, struct wlr_drm_renderer *renderer) { 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> @@ -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/egl.c b/render/egl.c index 08612125..22d58df2 100644 --- a/render/egl.c +++ b/render/egl.c @@ -4,7 +4,7 @@ #include <stdlib.h> #include <wlr/util/log.h> #include <wlr/render/egl.h> -#include "render/glapi.h" +#include "glapi.h" // Extension documentation // https://www.khronos.org/registry/EGL/extensions/KHR/EGL_KHR_image_base.txt. diff --git a/render/gles2/renderer.c b/render/gles2/renderer.c index 646d69ec..89cc4ffb 100644 --- a/render/gles2/renderer.c +++ b/render/gles2/renderer.c @@ -12,7 +12,7 @@ #include <wlr/render/matrix.h> #include <wlr/util/log.h> #include "render/gles2.h" -#include "render/glapi.h" +#include "glapi.h" struct shaders shaders; 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 6ad99077..85033613 100644 --- a/rootston/keyboard.c +++ b/rootston/keyboard.c @@ -112,6 +112,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/types/wlr_output.c b/types/wlr_output.c index 1d98d376..21d94cfb 100644 --- a/types/wlr_output.c +++ b/types/wlr_output.c @@ -455,6 +455,10 @@ bool wlr_output_cursor_set_image(struct wlr_output_cursor *cursor, if (cursor->output->hardware_cursor == NULL && cursor->output->impl->set_cursor) { + if (cursor->output->impl->move_cursor) { + cursor->output->impl->move_cursor(cursor->output, + (int)cursor->x, (int)cursor->y); + } int ok = cursor->output->impl->set_cursor(cursor->output, pixels, stride, width, height, hotspot_x, hotspot_y, true); if (ok) { 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); } |