Compare commits
6 Commits
main
...
wlroots-0.
Author | SHA1 | Date |
---|---|---|
yosh | f6750904dc | |
yosh | 4b11cd3df1 | |
yosh | 40d934d317 | |
yosh | c0632cbe95 | |
yosh | 7e19035666 | |
yosh | c7776b084b |
|
@ -1,7 +1,7 @@
|
|||
#if !defined(HIKARI_INDICATOR_BAR_H)
|
||||
#define HIKARI_INDICATOR_BAR_H
|
||||
|
||||
#include <wlr/types/wlr_surface.h>
|
||||
#include <wlr/types/wlr_compositor.h>
|
||||
|
||||
struct hikari_indicator;
|
||||
struct hikari_renderer;
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -10,12 +10,12 @@ struct hikari_cursor;
|
|||
|
||||
struct hikari_mode {
|
||||
void (*key_handler)(
|
||||
struct hikari_keyboard *keyboard, struct wlr_event_keyboard_key *event);
|
||||
struct hikari_keyboard *keyboard, struct wlr_keyboard_key_event *event);
|
||||
|
||||
void (*modifiers_handler)(struct hikari_keyboard *keyboard);
|
||||
|
||||
void (*button_handler)(
|
||||
struct hikari_cursor *cursor, struct wlr_event_pointer_button *event);
|
||||
struct hikari_cursor *cursor, struct wlr_pointer_button_event *event);
|
||||
|
||||
void (*cursor_move)(uint32_t time_msec);
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
|
||||
#include <assert.h>
|
||||
|
||||
#include <wlr/types/wlr_surface.h>
|
||||
#include <wlr/types/wlr_compositor.h>
|
||||
|
||||
struct hikari_node {
|
||||
struct wlr_surface *(*surface_at)(
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
#include <wayland-util.h>
|
||||
|
||||
#include <wlr/types/wlr_output_damage.h>
|
||||
#include <wlr/types/wlr_surface.h>
|
||||
#include <wlr/types/wlr_compositor.h>
|
||||
|
||||
#include <hikari/output_config.h>
|
||||
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -88,6 +88,7 @@ struct hikari_server {
|
|||
#endif
|
||||
|
||||
struct wlr_compositor *compositor;
|
||||
struct wlr_subcompositor *subcompositor;
|
||||
struct wlr_server_decoration_manager *decoration_manager;
|
||||
struct wlr_xdg_decoration_manager_v1 *xdg_decoration_manager;
|
||||
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
|
||||
#include <wayland-util.h>
|
||||
#include <wlr/types/wlr_output_damage.h>
|
||||
#include <wlr/types/wlr_surface.h>
|
||||
#include <wlr/types/wlr_compositor.h>
|
||||
#include <wlr/util/box.h>
|
||||
|
||||
#include <hikari/border.h>
|
||||
|
|
|
@ -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);
|
||||
|
|
12
src/cursor.c
12
src/cursor.c
|
@ -218,10 +218,10 @@ motion_absolute_handler(struct wl_listener *listener, void *data)
|
|||
|
||||
assert(!hikari_server_in_lock_mode());
|
||||
|
||||
struct wlr_event_pointer_motion_absolute *event = 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);
|
||||
}
|
||||
|
@ -241,10 +241,10 @@ motion_handler(struct wl_listener *listener, void *data)
|
|||
|
||||
assert(!hikari_server_in_lock_mode());
|
||||
|
||||
struct wlr_event_pointer_motion *event = 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);
|
||||
}
|
||||
|
@ -255,7 +255,7 @@ button_handler(struct wl_listener *listener, void *data)
|
|||
assert(!hikari_server_in_lock_mode());
|
||||
|
||||
struct hikari_cursor *cursor = wl_container_of(listener, cursor, button);
|
||||
struct wlr_event_pointer_button *event = data;
|
||||
struct wlr_pointer_button_event *event = data;
|
||||
|
||||
hikari_server.mode->button_handler(cursor, event);
|
||||
}
|
||||
|
@ -265,7 +265,7 @@ axis_handler(struct wl_listener *listener, void *data)
|
|||
{
|
||||
assert(!hikari_server_in_lock_mode());
|
||||
|
||||
struct wlr_event_pointer_axis *event = data;
|
||||
struct wlr_pointer_axis_event *event = data;
|
||||
|
||||
wlr_seat_pointer_notify_axis(hikari_server.seat,
|
||||
event->time_msec,
|
||||
|
|
|
@ -20,7 +20,7 @@ cancel(void)
|
|||
|
||||
static void
|
||||
key_handler(
|
||||
struct hikari_keyboard *keyboard, struct wlr_event_keyboard_key *event)
|
||||
struct hikari_keyboard *keyboard, struct wlr_keyboard_key_event *event)
|
||||
{
|
||||
if (event->state == WL_KEYBOARD_KEY_STATE_RELEASED) {
|
||||
hikari_server_enter_normal_mode(NULL);
|
||||
|
@ -55,7 +55,7 @@ cursor_move(uint32_t time_msec)
|
|||
|
||||
static void
|
||||
button_handler(
|
||||
struct hikari_cursor *cursor, struct wlr_event_pointer_button *event)
|
||||
struct hikari_cursor *cursor, struct wlr_pointer_button_event *event)
|
||||
{
|
||||
wlr_seat_pointer_notify_button(
|
||||
hikari_server.seat, event->time_msec, event->button, event->state);
|
||||
|
|
|
@ -251,7 +251,7 @@ done:
|
|||
|
||||
static void
|
||||
key_handler(
|
||||
struct hikari_keyboard *keyboard, struct wlr_event_keyboard_key *event)
|
||||
struct hikari_keyboard *keyboard, struct wlr_keyboard_key_event *event)
|
||||
{
|
||||
if (event->state == WL_KEYBOARD_KEY_STATE_PRESSED) {
|
||||
uint32_t keycode = event->keycode + 8;
|
||||
|
@ -296,7 +296,7 @@ cancel(void)
|
|||
|
||||
static void
|
||||
button_handler(
|
||||
struct hikari_cursor *cursor, struct wlr_event_pointer_button *event)
|
||||
struct hikari_cursor *cursor, struct wlr_pointer_button_event *event)
|
||||
{}
|
||||
|
||||
static void
|
||||
|
|
|
@ -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
|
||||
|
@ -47,7 +46,7 @@ handle_input(struct hikari_binding_group *map, uint32_t code)
|
|||
|
||||
static void
|
||||
key_handler(
|
||||
struct hikari_keyboard *keyboard, struct wlr_event_keyboard_key *event)
|
||||
struct hikari_keyboard *keyboard, struct wlr_keyboard_key_event *event)
|
||||
{
|
||||
struct hikari_workspace *workspace = hikari_server.workspace;
|
||||
if (event->state == WL_KEYBOARD_KEY_STATE_PRESSED) {
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -73,7 +72,7 @@ cancel(void)
|
|||
|
||||
static void
|
||||
button_handler(
|
||||
struct hikari_cursor *cursor, struct wlr_event_pointer_button *event)
|
||||
struct hikari_cursor *cursor, struct wlr_pointer_button_event *event)
|
||||
{
|
||||
wlr_seat_pointer_notify_button(
|
||||
hikari_server.seat, event->time_msec, event->button, 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;
|
||||
|
@ -30,7 +29,7 @@ static void
|
|||
key_handler(struct wl_listener *listener, void *data)
|
||||
{
|
||||
struct hikari_keyboard *keyboard = wl_container_of(listener, keyboard, key);
|
||||
struct wlr_event_keyboard_key *event = data;
|
||||
struct wlr_keyboard_key_event *event = data;
|
||||
|
||||
hikari_server.mode->key_handler(keyboard, event);
|
||||
}
|
||||
|
@ -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>
|
||||
|
@ -18,7 +17,7 @@
|
|||
|
||||
static struct hikari_split *
|
||||
lookup_layout(struct hikari_configuration *configuration,
|
||||
struct wlr_event_keyboard_key *event,
|
||||
struct wlr_keyboard_key_event *event,
|
||||
struct hikari_keyboard *keyboard)
|
||||
{
|
||||
uint32_t keycode = event->keycode + 8;
|
||||
|
@ -41,7 +40,7 @@ lookup_layout(struct hikari_configuration *configuration,
|
|||
|
||||
static void
|
||||
apply_layout(struct hikari_configuration *configuration,
|
||||
struct wlr_event_keyboard_key *event,
|
||||
struct wlr_keyboard_key_event *event,
|
||||
struct hikari_keyboard *keyboard)
|
||||
{
|
||||
struct hikari_split *split = lookup_layout(configuration, event, keyboard);
|
||||
|
@ -57,7 +56,7 @@ apply_layout(struct hikari_configuration *configuration,
|
|||
|
||||
static void
|
||||
key_handler(
|
||||
struct hikari_keyboard *keyboard, struct wlr_event_keyboard_key *event)
|
||||
struct hikari_keyboard *keyboard, struct wlr_keyboard_key_event *event)
|
||||
{
|
||||
if (event->state == WL_KEYBOARD_KEY_STATE_PRESSED) {
|
||||
apply_layout(hikari_configuration, event, keyboard);
|
||||
|
@ -70,7 +69,7 @@ modifiers_handler(struct hikari_keyboard *keyboard)
|
|||
|
||||
static void
|
||||
button_handler(
|
||||
struct hikari_cursor *cursor, struct wlr_event_pointer_button *event)
|
||||
struct hikari_cursor *cursor, struct wlr_pointer_button_event *event)
|
||||
{}
|
||||
|
||||
static void
|
||||
|
|
|
@ -173,7 +173,7 @@ enable_outputs(void)
|
|||
|
||||
static void
|
||||
key_handler(
|
||||
struct hikari_keyboard *keyboard, struct wlr_event_keyboard_key *event)
|
||||
struct hikari_keyboard *keyboard, struct wlr_keyboard_key_event *event)
|
||||
{
|
||||
struct hikari_lock_mode *mode = get_mode();
|
||||
|
||||
|
@ -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();
|
||||
|
||||
|
@ -241,7 +241,7 @@ modifiers_handler(struct hikari_keyboard *keyboard)
|
|||
|
||||
static void
|
||||
button_handler(
|
||||
struct hikari_cursor *cursor, struct wlr_event_pointer_button *event)
|
||||
struct hikari_cursor *cursor, struct wlr_pointer_button_event *event)
|
||||
{}
|
||||
|
||||
static void
|
||||
|
|
|
@ -148,7 +148,7 @@ handle_keysym(
|
|||
|
||||
static void
|
||||
assign_mark(
|
||||
struct wlr_event_keyboard_key *event, struct hikari_keyboard *keyboard)
|
||||
struct wlr_keyboard_key_event *event, struct hikari_keyboard *keyboard)
|
||||
{
|
||||
assert(hikari_server.workspace->focus_view != NULL);
|
||||
|
||||
|
@ -159,7 +159,7 @@ assign_mark(
|
|||
|
||||
static void
|
||||
key_handler(
|
||||
struct hikari_keyboard *keyboard, struct wlr_event_keyboard_key *event)
|
||||
struct hikari_keyboard *keyboard, struct wlr_keyboard_key_event *event)
|
||||
{
|
||||
if (event->state == WL_KEYBOARD_KEY_STATE_PRESSED) {
|
||||
assign_mark(event, keyboard);
|
||||
|
@ -201,7 +201,7 @@ cancel(void)
|
|||
|
||||
static void
|
||||
button_handler(
|
||||
struct hikari_cursor *cursor, struct wlr_event_pointer_button *event)
|
||||
struct hikari_cursor *cursor, struct wlr_pointer_button_event *event)
|
||||
{}
|
||||
|
||||
static void
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
|
||||
static void
|
||||
mark_select(struct hikari_workspace *workspace,
|
||||
struct wlr_event_keyboard_key *event,
|
||||
struct wlr_keyboard_key_event *event,
|
||||
struct hikari_keyboard *keyboard)
|
||||
{
|
||||
uint32_t keycode = event->keycode + 8;
|
||||
|
@ -33,7 +33,7 @@ mark_select(struct hikari_workspace *workspace,
|
|||
|
||||
static void
|
||||
key_handler(
|
||||
struct hikari_keyboard *keyboard, struct wlr_event_keyboard_key *event)
|
||||
struct hikari_keyboard *keyboard, struct wlr_keyboard_key_event *event)
|
||||
{
|
||||
struct hikari_workspace *workspace = hikari_server.workspace;
|
||||
|
||||
|
@ -52,7 +52,7 @@ cancel(void)
|
|||
|
||||
static void
|
||||
button_handler(
|
||||
struct hikari_cursor *cursor, struct wlr_event_pointer_button *event)
|
||||
struct hikari_cursor *cursor, struct wlr_pointer_button_event *event)
|
||||
{}
|
||||
|
||||
static void
|
||||
|
|
|
@ -30,7 +30,7 @@ cancel(void)
|
|||
|
||||
static void
|
||||
key_handler(
|
||||
struct hikari_keyboard *keyboard, struct wlr_event_keyboard_key *event)
|
||||
struct hikari_keyboard *keyboard, struct wlr_keyboard_key_event *event)
|
||||
{
|
||||
if (event->state == WL_KEYBOARD_KEY_STATE_RELEASED) {
|
||||
hikari_server_enter_normal_mode(NULL);
|
||||
|
@ -71,7 +71,7 @@ cursor_move(uint32_t time_msec)
|
|||
|
||||
static void
|
||||
button_handler(
|
||||
struct hikari_cursor *cursor, struct wlr_event_pointer_button *event)
|
||||
struct hikari_cursor *cursor, struct wlr_pointer_button_event *event)
|
||||
{
|
||||
if (event->state == WLR_BUTTON_RELEASED) {
|
||||
hikari_server_enter_normal_mode(NULL);
|
||||
|
|
|
@ -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
|
||||
|
@ -241,7 +241,7 @@ cursor_move(uint32_t time)
|
|||
}
|
||||
|
||||
static inline void
|
||||
start_cursor_down_handling(struct wlr_event_pointer_button *event)
|
||||
start_cursor_down_handling(struct wlr_pointer_button_event *event)
|
||||
{
|
||||
double lx = hikari_server.cursor.wlr_cursor->x;
|
||||
double ly = hikari_server.cursor.wlr_cursor->y;
|
||||
|
@ -267,7 +267,7 @@ start_cursor_down_handling(struct wlr_event_pointer_button *event)
|
|||
}
|
||||
|
||||
static inline void
|
||||
stop_cursor_down_handling(struct wlr_event_pointer_button *event)
|
||||
stop_cursor_down_handling(struct wlr_pointer_button_event *event)
|
||||
{
|
||||
hikari_server.normal_mode.mode.cursor_move = cursor_move;
|
||||
|
||||
|
@ -285,7 +285,7 @@ is_cursor_down(void)
|
|||
|
||||
static void
|
||||
button_handler(
|
||||
struct hikari_cursor *cursor, struct wlr_event_pointer_button *event)
|
||||
struct hikari_cursor *cursor, struct wlr_pointer_button_event *event)
|
||||
{
|
||||
if (handle_pending_action()) {
|
||||
if (event->state == WLR_BUTTON_RELEASED && is_cursor_down()) {
|
||||
|
@ -313,7 +313,7 @@ button_handler(
|
|||
|
||||
static void
|
||||
key_handler(
|
||||
struct hikari_keyboard *keyboard, struct wlr_event_keyboard_key *event)
|
||||
struct hikari_keyboard *keyboard, struct wlr_keyboard_key_event *event)
|
||||
{
|
||||
if (handle_pending_action()) {
|
||||
return;
|
||||
|
@ -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);
|
||||
}
|
||||
|
|
14
src/output.c
14
src/output.c
|
@ -152,16 +152,16 @@ hikari_output_enable(struct hikari_output *output)
|
|||
static void
|
||||
output_geometry(struct hikari_output *output)
|
||||
{
|
||||
struct wlr_box *output_box = wlr_output_layout_get_box(
|
||||
hikari_server.output_layout, output->wlr_output);
|
||||
struct wlr_box output_box;
|
||||
wlr_output_layout_get_box(hikari_server.output_layout, output->wlr_output, &output_box);
|
||||
|
||||
output->geometry.x = output_box->x;
|
||||
output->geometry.y = output_box->y;
|
||||
output->geometry.width = output_box->width;
|
||||
output->geometry.height = output_box->height;
|
||||
output->geometry.x = output_box.x;
|
||||
output->geometry.y = output_box.y;
|
||||
output->geometry.width = output_box.width;
|
||||
output->geometry.height = output_box.height;
|
||||
|
||||
output->usable_area = (struct wlr_box){
|
||||
.x = 0, .y = 0, .width = output_box->width, .height = output_box->height
|
||||
.x = 0, .y = 0, .width = output_box.width, .height = output_box.height
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
@ -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)) {
|
||||
|
|
|
@ -30,7 +30,7 @@ cancel(void)
|
|||
|
||||
static void
|
||||
key_handler(
|
||||
struct hikari_keyboard *keyboard, struct wlr_event_keyboard_key *event)
|
||||
struct hikari_keyboard *keyboard, struct wlr_keyboard_key_event *event)
|
||||
{
|
||||
if (event->state == WL_KEYBOARD_KEY_STATE_RELEASED) {
|
||||
hikari_server_enter_normal_mode(NULL);
|
||||
|
@ -65,7 +65,7 @@ cursor_move(uint32_t time_msec)
|
|||
|
||||
static void
|
||||
button_handler(
|
||||
struct hikari_cursor *cursor, struct wlr_event_pointer_button *event)
|
||||
struct hikari_cursor *cursor, struct wlr_pointer_button_event *event)
|
||||
{
|
||||
if (event->state == WLR_BUTTON_RELEASED) {
|
||||
hikari_server_enter_normal_mode(NULL);
|
||||
|
|
65
src/server.c
65
src/server.c
|
@ -2,6 +2,7 @@
|
|||
|
||||
#include <errno.h>
|
||||
#include <libinput.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include <wlr/backend.h>
|
||||
|
@ -19,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>
|
||||
|
@ -61,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);
|
||||
|
@ -99,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);
|
||||
|
@ -120,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:
|
||||
|
@ -162,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
|
||||
|
@ -184,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(
|
||||
|
@ -653,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(
|
||||
|
@ -693,13 +697,13 @@ output_layout_change_handler(struct wl_listener *listener, void *data)
|
|||
struct hikari_output *output;
|
||||
wl_list_for_each (output, &server->outputs, server_outputs) {
|
||||
struct wlr_output *wlr_output = output->wlr_output;
|
||||
struct wlr_box *output_box =
|
||||
wlr_output_layout_get_box(hikari_server.output_layout, wlr_output);
|
||||
struct wlr_box output_box;
|
||||
wlr_output_layout_get_box(hikari_server.output_layout, wlr_output, &output_box);
|
||||
|
||||
output->geometry.x = output_box->x;
|
||||
output->geometry.y = output_box->y;
|
||||
output->geometry.width = output_box->width;
|
||||
output->geometry.height = output_box->height;
|
||||
output->geometry.x = output_box.x;
|
||||
output->geometry.y = output_box.y;
|
||||
output->geometry.width = output_box.width;
|
||||
output->geometry.height = output_box.height;
|
||||
|
||||
struct hikari_output_config *output_config =
|
||||
hikari_configuration_resolve_output_config(
|
||||
|
@ -839,7 +843,15 @@ server_init(struct hikari_server *server, char *config_path)
|
|||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
server->socket = wl_display_add_socket_auto(server->display);
|
||||
// avoid using wayland-0 as socket
|
||||
char name_candidate[16];
|
||||
for (int i = 1; i <= 32; i++) {
|
||||
sprintf(name_candidate, "wayland-%d", i);
|
||||
if (wl_display_add_socket(server->display, name_candidate) >= 0) {
|
||||
server->socket = strdup(name_candidate);
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (server->socket == NULL) {
|
||||
wl_display_destroy(server->display);
|
||||
exit(EXIT_FAILURE);
|
||||
|
@ -848,6 +860,7 @@ server_init(struct hikari_server *server, char *config_path)
|
|||
setenv("WAYLAND_DISPLAY", server->socket, true);
|
||||
|
||||
server->compositor = wlr_compositor_create(server->display, server->renderer);
|
||||
server->subcompositor = wlr_subcompositor_create(server->display);
|
||||
|
||||
server->data_device_manager = wlr_data_device_manager_create(server->display);
|
||||
|
||||
|
|
|
@ -164,7 +164,7 @@ done:
|
|||
|
||||
static void
|
||||
key_handler(
|
||||
struct hikari_keyboard *keyboard, struct wlr_event_keyboard_key *event)
|
||||
struct hikari_keyboard *keyboard, struct wlr_keyboard_key_event *event)
|
||||
{
|
||||
if (event->state == WL_KEYBOARD_KEY_STATE_PRESSED) {
|
||||
uint32_t keycode = event->keycode + 8;
|
||||
|
@ -199,7 +199,7 @@ cancel(void)
|
|||
|
||||
static void
|
||||
button_handler(
|
||||
struct hikari_cursor *cursor, struct wlr_event_pointer_button *event)
|
||||
struct hikari_cursor *cursor, struct wlr_pointer_button_event *event)
|
||||
{}
|
||||
|
||||
static void
|
||||
|
|
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>
|
||||
|
|
|
@ -9,8 +9,9 @@
|
|||
#include <wlr/types/wlr_cursor.h>
|
||||
#include <wlr/types/wlr_matrix.h>
|
||||
#include <wlr/types/wlr_output_layout.h>
|
||||
#include <wlr/types/wlr_surface.h>
|
||||
#include <wlr/types/wlr_compositor.h>
|
||||
#include <wlr/types/wlr_xdg_shell.h>
|
||||
#include <wlr/types/wlr_foreign_toplevel_management_v1.h>
|
||||
#include <wlr/util/edges.h>
|
||||
|
||||
#include <hikari/configuration.h>
|
||||
|
@ -60,13 +61,13 @@ commit_handler(struct wl_listener *listener, void *data)
|
|||
case HIKARI_OPERATION_TYPE_FULL_MAXIMIZE:
|
||||
case HIKARI_OPERATION_TYPE_VERTICAL_MAXIMIZE:
|
||||
case HIKARI_OPERATION_TYPE_HORIZONTAL_MAXIMIZE:
|
||||
wlr_xdg_toplevel_set_tiled(surface,
|
||||
wlr_xdg_toplevel_set_tiled(surface->toplevel,
|
||||
WLR_EDGE_LEFT | WLR_EDGE_RIGHT | WLR_EDGE_TOP | WLR_EDGE_BOTTOM);
|
||||
break;
|
||||
|
||||
case HIKARI_OPERATION_TYPE_RESET:
|
||||
case HIKARI_OPERATION_TYPE_UNMAXIMIZE:
|
||||
wlr_xdg_toplevel_set_tiled(surface, WLR_EDGE_NONE);
|
||||
wlr_xdg_toplevel_set_tiled(surface->toplevel, WLR_EDGE_NONE);
|
||||
break;
|
||||
|
||||
case HIKARI_OPERATION_TYPE_RESIZE:
|
||||
|
@ -233,7 +234,7 @@ activate(struct hikari_view *view, bool active)
|
|||
struct hikari_xdg_view *xdg_view = (struct hikari_xdg_view *)view;
|
||||
|
||||
if (xdg_view->surface->role == WLR_XDG_SURFACE_ROLE_TOPLEVEL) {
|
||||
wlr_xdg_toplevel_set_activated(xdg_view->surface, active);
|
||||
wlr_xdg_toplevel_set_activated(xdg_view->surface->toplevel, active);
|
||||
|
||||
hikari_view_damage_whole(view);
|
||||
}
|
||||
|
@ -245,7 +246,7 @@ resize(struct hikari_view *view, int width, int height)
|
|||
struct hikari_xdg_view *xdg_view = (struct hikari_xdg_view *)view;
|
||||
|
||||
if (xdg_view->surface->role == WLR_XDG_SURFACE_ROLE_TOPLEVEL) {
|
||||
return wlr_xdg_toplevel_set_size(xdg_view->surface, width, height);
|
||||
return wlr_xdg_toplevel_set_size(xdg_view->surface->toplevel, width, height);
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
@ -256,7 +257,7 @@ quit(struct hikari_view *view)
|
|||
{
|
||||
struct hikari_xdg_view *xdg_view = (struct hikari_xdg_view *)view;
|
||||
|
||||
wlr_xdg_toplevel_send_close(xdg_view->surface);
|
||||
wlr_xdg_toplevel_send_close(xdg_view->surface->toplevel);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -429,9 +430,9 @@ request_fullscreen_handler(struct wl_listener *listener, void *data)
|
|||
struct hikari_xdg_view *xdg_view =
|
||||
wl_container_of(listener, xdg_view, request_fullscreen);
|
||||
|
||||
struct wlr_xdg_toplevel_set_fullscreen_event *event = data;
|
||||
struct wlr_foreign_toplevel_handle_v1_fullscreen_event *event = data;
|
||||
|
||||
wlr_xdg_toplevel_set_fullscreen(xdg_view->surface, event->fullscreen);
|
||||
wlr_xdg_toplevel_set_fullscreen(xdg_view->surface->toplevel, event->fullscreen);
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
|
@ -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