wlroots0.16: xdg_shell stuff, input device stuff, ...
I did most of the rest of the wlroots 0.16 patching here; oops
This commit is contained in:
parent
4b11cd3df1
commit
f6750904dc
|
@ -5,7 +5,6 @@
|
|||
#include <wayland-util.h>
|
||||
#include <xkbcommon/xkbcommon.h>
|
||||
|
||||
#include <wlr/types/wlr_input_device.h>
|
||||
#include <wlr/types/wlr_keyboard.h>
|
||||
|
||||
#include <hikari/binding_group.h>
|
||||
|
@ -13,7 +12,7 @@
|
|||
|
||||
struct hikari_keyboard {
|
||||
struct wl_list server_keyboards;
|
||||
struct wlr_input_device *device;
|
||||
struct wlr_keyboard *wlr_keyboard;
|
||||
|
||||
struct wl_listener modifiers;
|
||||
struct wl_listener key;
|
||||
|
@ -26,7 +25,7 @@ struct hikari_keyboard {
|
|||
|
||||
void
|
||||
hikari_keyboard_init(
|
||||
struct hikari_keyboard *keyboard, struct wlr_input_device *device);
|
||||
struct hikari_keyboard *keyboard, struct wlr_keyboard *wlr_keyboard);
|
||||
|
||||
void
|
||||
hikari_keyboard_fini(struct hikari_keyboard *keyboard);
|
||||
|
@ -52,14 +51,14 @@ hikari_keyboard_get_codepoint(
|
|||
struct hikari_keyboard *keyboard, uint32_t keycode)
|
||||
{
|
||||
return xkb_state_key_get_utf32(
|
||||
keyboard->device->keyboard->xkb_state, keycode);
|
||||
keyboard->wlr_keyboard->xkb_state, keycode);
|
||||
}
|
||||
|
||||
static inline bool
|
||||
hikari_keyboard_check_modifier(
|
||||
struct hikari_keyboard *keyboard, uint32_t modifier)
|
||||
{
|
||||
uint32_t modifiers = wlr_keyboard_get_modifiers(keyboard->device->keyboard);
|
||||
uint32_t modifiers = wlr_keyboard_get_modifiers(keyboard->wlr_keyboard);
|
||||
|
||||
return modifiers == modifier;
|
||||
}
|
||||
|
|
|
@ -1,21 +1,21 @@
|
|||
#if !defined(HIKARI_POINTER_H)
|
||||
#define HIKARI_POINTER_H
|
||||
|
||||
#include <wlr/types/wlr_input_device.h>
|
||||
#include <wlr/types/wlr_pointer.h>
|
||||
|
||||
struct hikari_pointer_config;
|
||||
|
||||
struct hikari_pointer {
|
||||
struct wl_list server_pointers;
|
||||
|
||||
struct wlr_input_device *device;
|
||||
struct wlr_pointer *wlr_pointer;
|
||||
|
||||
struct wl_listener destroy;
|
||||
};
|
||||
|
||||
void
|
||||
hikari_pointer_init(
|
||||
struct hikari_pointer *pointer, struct wlr_input_device *device);
|
||||
struct hikari_pointer *pointer, struct wlr_pointer *wlr_pointer);
|
||||
|
||||
void
|
||||
hikari_pointer_fini(struct hikari_pointer *pointer);
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
#if !defined(HIKARI_SWITCH_H)
|
||||
#define HIKARI_SWITCH_H
|
||||
|
||||
#include <wlr/types/wlr_input_device.h>
|
||||
#include <wlr/types/wlr_switch.h>
|
||||
|
||||
struct hikari_action;
|
||||
|
@ -10,7 +9,7 @@ struct hikari_switch_config;
|
|||
struct hikari_switch {
|
||||
struct wl_list server_switches;
|
||||
|
||||
struct wlr_input_device *device;
|
||||
struct wlr_switch *wlr_switch;
|
||||
|
||||
enum wlr_switch_state state;
|
||||
|
||||
|
@ -22,7 +21,7 @@ struct hikari_switch {
|
|||
|
||||
void
|
||||
hikari_switch_init(
|
||||
struct hikari_switch *swtch, struct wlr_input_device *device);
|
||||
struct hikari_switch *swtch, struct wlr_switch *wlr_switch);
|
||||
|
||||
void
|
||||
hikari_switch_fini(struct hikari_switch *swtch);
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
#include <wayland-server-core.h>
|
||||
#include <wayland-util.h>
|
||||
|
||||
#include <wlr/types/wlr_surface.h>
|
||||
#include <wlr/types/wlr_compositor.h>
|
||||
#include <wlr/util/box.h>
|
||||
|
||||
#include <hikari/node.h>
|
||||
|
|
|
@ -1727,7 +1727,7 @@ hikari_configuration_reload(char *config_path)
|
|||
wl_list_for_each (pointer, &hikari_server.pointers, server_pointers) {
|
||||
struct hikari_pointer_config *pointer_config =
|
||||
hikari_configuration_resolve_pointer_config(
|
||||
hikari_configuration, pointer->device->name);
|
||||
hikari_configuration, pointer->wlr_pointer->base.name);
|
||||
|
||||
if (pointer_config != NULL) {
|
||||
hikari_pointer_configure(pointer, pointer_config);
|
||||
|
@ -1741,7 +1741,7 @@ hikari_configuration_reload(char *config_path)
|
|||
wl_list_for_each (keyboard, &hikari_server.keyboards, server_keyboards) {
|
||||
struct hikari_keyboard_config *keyboard_config =
|
||||
hikari_configuration_resolve_keyboard_config(
|
||||
hikari_configuration, keyboard->device->name);
|
||||
hikari_configuration, keyboard->wlr_keyboard->base.name);
|
||||
|
||||
assert(keyboard_config != NULL);
|
||||
hikari_keyboard_configure(keyboard, keyboard_config);
|
||||
|
@ -1784,7 +1784,7 @@ hikari_configuration_reload(char *config_path)
|
|||
wl_list_for_each (swtch, &hikari_server.switches, server_switches) {
|
||||
struct hikari_switch_config *switch_config =
|
||||
hikari_configuration_resolve_switch_config(
|
||||
hikari_configuration, swtch->device->name);
|
||||
hikari_configuration, swtch->wlr_switch->base.name);
|
||||
|
||||
if (switch_config != NULL) {
|
||||
hikari_switch_configure(swtch, switch_config);
|
||||
|
|
|
@ -221,7 +221,7 @@ motion_absolute_handler(struct wl_listener *listener, void *data)
|
|||
struct wlr_pointer_motion_absolute_event *event = data;
|
||||
|
||||
wlr_cursor_warp_absolute(
|
||||
cursor->wlr_cursor, event->device, event->x, event->y);
|
||||
cursor->wlr_cursor, &event->pointer->base, event->x, event->y);
|
||||
|
||||
hikari_server.mode->cursor_move(event->time_msec);
|
||||
}
|
||||
|
@ -244,7 +244,7 @@ motion_handler(struct wl_listener *listener, void *data)
|
|||
struct wlr_pointer_motion_event *event = data;
|
||||
|
||||
wlr_cursor_move(
|
||||
cursor->wlr_cursor, event->device, event->delta_x, event->delta_y);
|
||||
cursor->wlr_cursor, &event->pointer->base, event->delta_x, event->delta_y);
|
||||
|
||||
hikari_server.mode->cursor_move(event->time_msec);
|
||||
}
|
||||
|
|
|
@ -3,7 +3,6 @@
|
|||
#include <assert.h>
|
||||
|
||||
#include <wlr/types/wlr_cursor.h>
|
||||
#include <wlr/types/wlr_input_device.h>
|
||||
#include <wlr/types/wlr_seat.h>
|
||||
|
||||
#include <hikari/action.h>
|
||||
|
@ -23,7 +22,7 @@ static void
|
|||
modifiers_handler(struct hikari_keyboard *keyboard)
|
||||
{
|
||||
wlr_seat_keyboard_notify_modifiers(
|
||||
hikari_server.seat, &keyboard->device->keyboard->modifiers);
|
||||
hikari_server.seat, &keyboard->wlr_keyboard->modifiers);
|
||||
}
|
||||
|
||||
static bool
|
||||
|
@ -62,7 +61,7 @@ key_handler(
|
|||
}
|
||||
}
|
||||
|
||||
wlr_seat_set_keyboard(hikari_server.seat, keyboard->device);
|
||||
wlr_seat_set_keyboard(hikari_server.seat, keyboard->wlr_keyboard);
|
||||
wlr_seat_keyboard_notify_key(
|
||||
hikari_server.seat, event->time_msec, event->keycode, event->state);
|
||||
}
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
#include <hikari/keyboard.h>
|
||||
|
||||
#include <wlr/types/wlr_input_device.h>
|
||||
#include <wlr/types/wlr_keyboard.h>
|
||||
#include <wlr/types/wlr_seat.h>
|
||||
|
||||
|
@ -15,7 +14,7 @@ static void
|
|||
update_mod_state(struct hikari_keyboard *keyboard)
|
||||
{
|
||||
uint32_t modifier_keys =
|
||||
wlr_keyboard_get_modifiers(keyboard->device->keyboard);
|
||||
wlr_keyboard_get_modifiers(keyboard->wlr_keyboard);
|
||||
|
||||
bool was_pressed = hikari_server.keyboard_state.mod_pressed;
|
||||
bool is_pressed = modifier_keys & WLR_MODIFIER_LOGO;
|
||||
|
@ -135,21 +134,21 @@ configure_bindings(struct hikari_keyboard *keyboard, struct wl_list *bindings)
|
|||
|
||||
void
|
||||
hikari_keyboard_init(
|
||||
struct hikari_keyboard *keyboard, struct wlr_input_device *device)
|
||||
struct hikari_keyboard *keyboard, struct wlr_keyboard *wlr_keyboard)
|
||||
{
|
||||
keyboard->device = device;
|
||||
keyboard->wlr_keyboard = wlr_keyboard;
|
||||
keyboard->keymap = NULL;
|
||||
|
||||
keyboard->modifiers.notify = modifiers_handler;
|
||||
wl_signal_add(&device->keyboard->events.modifiers, &keyboard->modifiers);
|
||||
wl_signal_add(&wlr_keyboard->events.modifiers, &keyboard->modifiers);
|
||||
|
||||
keyboard->key.notify = key_handler;
|
||||
wl_signal_add(&device->keyboard->events.key, &keyboard->key);
|
||||
wl_signal_add(&wlr_keyboard->events.key, &keyboard->key);
|
||||
|
||||
keyboard->destroy.notify = destroy_handler;
|
||||
wl_signal_add(&device->keyboard->events.destroy, &keyboard->destroy);
|
||||
wl_signal_add(&wlr_keyboard->base.events.destroy, &keyboard->destroy);
|
||||
|
||||
wlr_seat_set_keyboard(hikari_server.seat, device);
|
||||
wlr_seat_set_keyboard(hikari_server.seat, wlr_keyboard);
|
||||
|
||||
wl_list_insert(&hikari_server.keyboards, &keyboard->server_keyboards);
|
||||
|
||||
|
@ -191,13 +190,13 @@ hikari_keyboard_configure(struct hikari_keyboard *keyboard,
|
|||
{
|
||||
keyboard->keymap = load_keymap(keyboard_config);
|
||||
assert(keyboard->keymap != NULL);
|
||||
wlr_keyboard_set_keymap(keyboard->device->keyboard, keyboard->keymap);
|
||||
wlr_keyboard_set_keymap(keyboard->wlr_keyboard, keyboard->keymap);
|
||||
|
||||
int repeat_rate = hikari_keyboard_config_get_repeat_rate(keyboard_config);
|
||||
int repeat_delay = hikari_keyboard_config_get_repeat_delay(keyboard_config);
|
||||
|
||||
wlr_keyboard_set_repeat_info(
|
||||
keyboard->device->keyboard, repeat_rate, repeat_delay);
|
||||
keyboard->wlr_keyboard, repeat_rate, repeat_delay);
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -217,7 +216,7 @@ hikari_keyboard_for_keysym(struct hikari_keyboard *keyboard,
|
|||
{
|
||||
const xkb_keysym_t *syms;
|
||||
int nsyms = xkb_state_key_get_syms(
|
||||
keyboard->device->keyboard->xkb_state, keycode, &syms);
|
||||
keyboard->wlr_keyboard->xkb_state, keycode, &syms);
|
||||
|
||||
for (int i = 0; i < nsyms; i++) {
|
||||
iter(keyboard, keycode, syms[i]);
|
||||
|
|
|
@ -309,8 +309,8 @@ damage_popup(struct hikari_layer_popup *layer_popup, bool whole)
|
|||
struct wlr_xdg_popup *popup = layer_popup->popup;
|
||||
struct wlr_surface *surface = popup->base->surface;
|
||||
|
||||
int popup_sx = popup->geometry.x - popup->base->current.geometry.x;
|
||||
int popup_sy = popup->geometry.y - popup->base->current.geometry.y;
|
||||
int popup_sx = popup->current.geometry.x - popup->base->current.geometry.x;
|
||||
int popup_sy = popup->current.geometry.y - popup->base->current.geometry.y;
|
||||
int ox = popup_sx, oy = popup_sy;
|
||||
|
||||
struct hikari_layer *layer;
|
||||
|
@ -325,8 +325,8 @@ damage_popup(struct hikari_layer_popup *layer_popup, bool whole)
|
|||
|
||||
case HIKARI_LAYER_NODE_TYPE_POPUP:
|
||||
current = current->parent.node.popup;
|
||||
ox += current->popup->geometry.x;
|
||||
oy += current->popup->geometry.y;
|
||||
ox += current->popup->current.geometry.x;
|
||||
oy += current->popup->current.geometry.y;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
|
||||
#include <stdbool.h>
|
||||
|
||||
#include <wlr/types/wlr_input_device.h>
|
||||
#include <wlr/types/wlr_keyboard.h>
|
||||
|
||||
#include <hikari/configuration.h>
|
||||
|
|
|
@ -183,7 +183,7 @@ key_handler(
|
|||
uint32_t codepoint;
|
||||
|
||||
int nsyms = xkb_state_key_get_syms(
|
||||
keyboard->device->keyboard->xkb_state, keycode, &syms);
|
||||
keyboard->wlr_keyboard->xkb_state, keycode, &syms);
|
||||
|
||||
enable_outputs();
|
||||
|
||||
|
|
|
@ -151,7 +151,7 @@ dump_debug(struct hikari_server *server)
|
|||
static void
|
||||
modifiers_handler(struct hikari_keyboard *keyboard)
|
||||
{
|
||||
wlr_seat_set_keyboard(hikari_server.seat, keyboard->device);
|
||||
wlr_seat_set_keyboard(hikari_server.seat, keyboard->wlr_keyboard);
|
||||
struct hikari_view *focus_view = hikari_server.workspace->focus_view;
|
||||
|
||||
if (hikari_server.keyboard_state.mod_released) {
|
||||
|
@ -176,7 +176,7 @@ modifiers_handler(struct hikari_keyboard *keyboard)
|
|||
}
|
||||
|
||||
wlr_seat_keyboard_notify_modifiers(
|
||||
hikari_server.seat, &keyboard->device->keyboard->modifiers);
|
||||
hikari_server.seat, &keyboard->wlr_keyboard->modifiers);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -328,7 +328,7 @@ key_handler(
|
|||
}
|
||||
}
|
||||
|
||||
wlr_seat_set_keyboard(hikari_server.seat, keyboard->device);
|
||||
wlr_seat_set_keyboard(hikari_server.seat, keyboard->wlr_keyboard);
|
||||
wlr_seat_keyboard_notify_key(
|
||||
hikari_server.seat, event->time_msec, event->keycode, event->state);
|
||||
}
|
||||
|
|
|
@ -17,14 +17,14 @@ destroy_handler(struct wl_listener *listener, void *data)
|
|||
|
||||
void
|
||||
hikari_pointer_init(
|
||||
struct hikari_pointer *pointer, struct wlr_input_device *device)
|
||||
struct hikari_pointer *pointer, struct wlr_pointer *wlr_pointer)
|
||||
{
|
||||
pointer->device = device;
|
||||
pointer->wlr_pointer = wlr_pointer;
|
||||
|
||||
wl_list_insert(&hikari_server.pointers, &pointer->server_pointers);
|
||||
|
||||
pointer->destroy.notify = destroy_handler;
|
||||
wl_signal_add(&device->events.destroy, &pointer->destroy);
|
||||
wl_signal_add(&wlr_pointer->base.events.destroy, &pointer->destroy);
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -39,7 +39,7 @@ hikari_pointer_configure(struct hikari_pointer *pointer,
|
|||
struct hikari_pointer_config *pointer_config)
|
||||
{
|
||||
struct libinput_device *libinput_device =
|
||||
wlr_libinput_get_device_handle(pointer->device);
|
||||
wlr_libinput_get_device_handle(&pointer->wlr_pointer->base);
|
||||
|
||||
if (libinput_device != NULL) {
|
||||
if (hikari_pointer_config_has_accel(pointer_config)) {
|
||||
|
|
41
src/server.c
41
src/server.c
|
@ -20,6 +20,7 @@
|
|||
#include <wlr/types/wlr_primary_selection.h>
|
||||
#include <wlr/types/wlr_primary_selection_v1.h>
|
||||
#include <wlr/types/wlr_seat.h>
|
||||
#include <wlr/types/wlr_subcompositor.h>
|
||||
#include <wlr/types/wlr_server_decoration.h>
|
||||
#include <wlr/types/wlr_xdg_output_v1.h>
|
||||
#include <wlr/types/wlr_xdg_shell.h>
|
||||
|
@ -62,35 +63,37 @@
|
|||
#include <hikari/xwayland_view.h>
|
||||
#endif
|
||||
|
||||
#define HIKARI_XDG_SHELL_VERSION 2
|
||||
|
||||
static void
|
||||
add_pointer(struct hikari_server *server, struct wlr_input_device *device)
|
||||
add_pointer(struct hikari_server *server, struct wlr_pointer *wlr_pointer)
|
||||
{
|
||||
struct hikari_pointer *pointer = hikari_malloc(sizeof(struct hikari_pointer));
|
||||
hikari_pointer_init(pointer, device);
|
||||
hikari_pointer_init(pointer, wlr_pointer);
|
||||
|
||||
struct hikari_pointer_config *pointer_config =
|
||||
hikari_configuration_resolve_pointer_config(
|
||||
hikari_configuration, device->name);
|
||||
hikari_configuration, wlr_pointer->base.name);
|
||||
|
||||
if (pointer_config != NULL) {
|
||||
hikari_pointer_configure(pointer, pointer_config);
|
||||
}
|
||||
|
||||
wlr_cursor_attach_input_device(server->cursor.wlr_cursor, device);
|
||||
wlr_cursor_map_input_to_output(server->cursor.wlr_cursor, device, NULL);
|
||||
wlr_cursor_attach_input_device(server->cursor.wlr_cursor, &wlr_pointer->base);
|
||||
wlr_cursor_map_input_to_output(server->cursor.wlr_cursor, &wlr_pointer->base, NULL);
|
||||
}
|
||||
|
||||
static void
|
||||
add_keyboard(struct hikari_server *server, struct wlr_input_device *device)
|
||||
add_keyboard(struct hikari_server *server, struct wlr_keyboard *wlr_keyboard)
|
||||
{
|
||||
struct hikari_keyboard *keyboard =
|
||||
hikari_malloc(sizeof(struct hikari_keyboard));
|
||||
|
||||
hikari_keyboard_init(keyboard, device);
|
||||
hikari_keyboard_init(keyboard, wlr_keyboard);
|
||||
|
||||
struct hikari_keyboard_config *keyboard_config =
|
||||
hikari_configuration_resolve_keyboard_config(
|
||||
hikari_configuration, device->name);
|
||||
hikari_configuration, wlr_keyboard->base.name);
|
||||
|
||||
assert(keyboard_config != NULL);
|
||||
hikari_keyboard_configure(keyboard, keyboard_config);
|
||||
|
@ -100,15 +103,15 @@ add_keyboard(struct hikari_server *server, struct wlr_input_device *device)
|
|||
}
|
||||
|
||||
static void
|
||||
add_switch(struct hikari_server *server, struct wlr_input_device *device)
|
||||
add_switch(struct hikari_server *server, struct wlr_switch *wlr_switch)
|
||||
{
|
||||
struct hikari_switch *swtch = hikari_malloc(sizeof(struct hikari_switch));
|
||||
|
||||
hikari_switch_init(swtch, device);
|
||||
hikari_switch_init(swtch, wlr_switch);
|
||||
|
||||
struct hikari_switch_config *switch_config =
|
||||
hikari_configuration_resolve_switch_config(
|
||||
hikari_configuration, device->name);
|
||||
hikari_configuration, wlr_switch->base.name);
|
||||
|
||||
if (switch_config != NULL) {
|
||||
hikari_switch_configure(swtch, switch_config);
|
||||
|
@ -121,15 +124,15 @@ add_input(struct hikari_server *server, struct wlr_input_device *device)
|
|||
|
||||
switch (device->type) {
|
||||
case WLR_INPUT_DEVICE_KEYBOARD:
|
||||
add_keyboard(server, device);
|
||||
add_keyboard(server, wlr_keyboard_from_input_device(device));
|
||||
break;
|
||||
|
||||
case WLR_INPUT_DEVICE_POINTER:
|
||||
add_pointer(server, device);
|
||||
add_pointer(server, wlr_pointer_from_input_device(device));
|
||||
break;
|
||||
|
||||
case WLR_INPUT_DEVICE_SWITCH:
|
||||
add_switch(server, device);
|
||||
add_switch(server, wlr_switch_from_input_device(device));
|
||||
break;
|
||||
|
||||
default:
|
||||
|
@ -163,9 +166,9 @@ new_virtual_keyboard_handler(struct wl_listener *listener, void *data)
|
|||
struct hikari_server *server =
|
||||
wl_container_of(listener, server, new_virtual_keyboard);
|
||||
struct wlr_virtual_keyboard_v1 *keyboard = data;
|
||||
struct wlr_input_device *device = &keyboard->input_device;
|
||||
struct wlr_keyboard *wlr_keyboard = &keyboard->keyboard;
|
||||
|
||||
add_input(server, device);
|
||||
add_keyboard(server, wlr_keyboard);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -185,9 +188,9 @@ new_virtual_pointer_handler(struct wl_listener *listener, void *data)
|
|||
wl_container_of(listener, server, new_virtual_pointer);
|
||||
struct wlr_virtual_pointer_v1_new_pointer_event *event = data;
|
||||
struct wlr_virtual_pointer_v1 *pointer = event->new_pointer;
|
||||
struct wlr_input_device *device = &pointer->input_device;
|
||||
struct wlr_pointer *wlr_pointer= &pointer->pointer;
|
||||
|
||||
add_input(server, device);
|
||||
add_pointer(server, wlr_pointer);
|
||||
|
||||
if (event->suggested_output) {
|
||||
wlr_cursor_map_to_output(
|
||||
|
@ -654,7 +657,7 @@ new_xdg_surface_handler(struct wl_listener *listener, void *data)
|
|||
static void
|
||||
setup_xdg_shell(struct hikari_server *server)
|
||||
{
|
||||
server->xdg_shell = wlr_xdg_shell_create(server->display);
|
||||
server->xdg_shell = wlr_xdg_shell_create(server->display, HIKARI_XDG_SHELL_VERSION);
|
||||
|
||||
server->new_xdg_surface.notify = new_xdg_surface_handler;
|
||||
wl_signal_add(
|
||||
|
|
10
src/switch.c
10
src/switch.c
|
@ -50,14 +50,14 @@ toggle_handler(struct wl_listener *listener, void *data)
|
|||
}
|
||||
|
||||
void
|
||||
hikari_switch_init(struct hikari_switch *swtch, struct wlr_input_device *device)
|
||||
hikari_switch_init(struct hikari_switch *swtch, struct wlr_switch *wlr_switch)
|
||||
{
|
||||
swtch->device = device;
|
||||
swtch->wlr_switch= wlr_switch;
|
||||
swtch->state = WLR_SWITCH_STATE_OFF;
|
||||
swtch->action = NULL;
|
||||
|
||||
swtch->destroy.notify = destroy_handler;
|
||||
wl_signal_add(&device->events.destroy, &swtch->destroy);
|
||||
wl_signal_add(&wlr_switch->base.events.destroy, &swtch->destroy);
|
||||
|
||||
wl_list_init(&swtch->toggle.link);
|
||||
|
||||
|
@ -76,13 +76,13 @@ void
|
|||
hikari_switch_configure(
|
||||
struct hikari_switch *swtch, struct hikari_switch_config *switch_config)
|
||||
{
|
||||
struct wlr_input_device *device = swtch->device;
|
||||
struct wlr_switch *wlr_switch= swtch->wlr_switch;
|
||||
|
||||
swtch->action = &switch_config->action;
|
||||
|
||||
wl_list_remove(&swtch->toggle.link);
|
||||
swtch->toggle.notify = toggle_handler;
|
||||
wl_signal_add(&device->switch_device->events.toggle, &swtch->toggle);
|
||||
wl_signal_add(&wlr_switch->events.toggle, &swtch->toggle);
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
@ -4,6 +4,7 @@
|
|||
#include <string.h>
|
||||
|
||||
#include <wlr/types/wlr_cursor.h>
|
||||
#include <wlr/types/wlr_subcompositor.h>
|
||||
|
||||
#include <hikari/color.h>
|
||||
#include <hikari/configuration.h>
|
||||
|
|
|
@ -8,6 +8,8 @@
|
|||
#include <wlr/types/wlr_output_damage.h>
|
||||
#include <wlr/xwayland.h>
|
||||
|
||||
#include <xcb/xcb_icccm.h>
|
||||
|
||||
#include <hikari/configuration.h>
|
||||
#include <hikari/geometry.h>
|
||||
#include <hikari/output.h>
|
||||
|
@ -364,15 +366,13 @@ constraints(struct hikari_view *view,
|
|||
struct hikari_output *output = view->output;
|
||||
struct wlr_xwayland_surface *surface = xwayland_view->surface;
|
||||
|
||||
struct wlr_xwayland_surface_size_hints *size_hints = surface->size_hints;
|
||||
xcb_size_hints_t *size_hints = surface->size_hints;
|
||||
|
||||
if (size_hints != NULL) {
|
||||
*min_width = size_hints->min_width > 0 ? size_hints->min_width : 0;
|
||||
*max_width = size_hints->max_width > 0 ? size_hints->max_width
|
||||
: output->geometry.width;
|
||||
*max_width = size_hints->max_width > 0 ? size_hints->max_width : output->geometry.width;
|
||||
*min_height = size_hints->min_height > 0 ? size_hints->min_height : 0;
|
||||
*max_height = size_hints->max_height > 0 ? size_hints->max_height
|
||||
: output->geometry.height;
|
||||
*max_height = size_hints->max_height > 0 ? size_hints->max_height : output->geometry.height;
|
||||
} else {
|
||||
*min_width = 0;
|
||||
*max_width = output->geometry.width;
|
||||
|
|
Loading…
Reference in New Issue