mirror of
https://github.com/swaywm/sway.git
synced 2026-04-26 06:46:26 -04:00
Merge remote-tracking branch 'upstream/master' into master
This commit is contained in:
commit
886494ed55
2 changed files with 14 additions and 2 deletions
|
|
@ -722,6 +722,8 @@ static void seat_configure_pointer(struct sway_seat *seat,
|
|||
wlr_cursor_attach_input_device(seat->cursor->cursor,
|
||||
sway_device->input_device->wlr_device);
|
||||
seat_apply_input_config(seat, sway_device);
|
||||
wl_event_source_timer_update(
|
||||
seat->cursor->hide_source, cursor_get_timeout(seat->cursor));
|
||||
}
|
||||
|
||||
static void seat_configure_keyboard(struct sway_seat *seat,
|
||||
|
|
|
|||
|
|
@ -1,7 +1,8 @@
|
|||
#define _POSIX_C_SOURCE 200112L
|
||||
#define _POSIX_C_SOURCE 200809L
|
||||
#include <assert.h>
|
||||
#include <stdbool.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <wayland-server-core.h>
|
||||
#include <wlr/backend.h>
|
||||
#include <wlr/backend/headless.h>
|
||||
|
|
@ -151,7 +152,16 @@ bool server_init(struct sway_server *server) {
|
|||
wlr_primary_selection_v1_device_manager_create(server->wl_display);
|
||||
wlr_viewporter_create(server->wl_display);
|
||||
|
||||
server->socket = wl_display_add_socket_auto(server->wl_display);
|
||||
// Avoid using "wayland-0" as display socket
|
||||
char name_candidate[16];
|
||||
for (int i = 1; i <= 32; ++i) {
|
||||
sprintf(name_candidate, "wayland-%d", i);
|
||||
if (wl_display_add_socket(server->wl_display, name_candidate) >= 0) {
|
||||
server->socket = strdup(name_candidate);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (!server->socket) {
|
||||
sway_log(SWAY_ERROR, "Unable to open wayland socket");
|
||||
wlr_backend_destroy(server->backend);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue