}
static int
-dnd_motion_handler(struct window *window,
+dnd_motion_handler(struct widget *widget,
struct input *input, uint32_t time,
- int32_t x, int32_t y,
- int32_t sx, int32_t sy, void *data)
+ int32_t x, int32_t y, void *data)
{
- return lookup_cursor(data, sx, sy);
+ return lookup_cursor(data, x, y);
}
static void
window_set_keyboard_focus_handler(dnd->window,
keyboard_focus_handler);
window_set_button_handler(dnd->window, dnd_button_handler);
- window_set_motion_handler(dnd->window, dnd_motion_handler);
window_set_data_handler(dnd->window, dnd_data_handler);
window_set_drop_handler(dnd->window, dnd_drop_handler);
dnd->widget = window_add_widget(dnd->window, dnd);
widget_set_enter_handler(dnd->widget, dnd_enter_handler);
+ widget_set_motion_handler(dnd->widget, dnd_motion_handler);
width = 4 * (item_width + item_padding) + item_padding;
height = 4 * (item_height + item_padding) + item_padding;
window_flush(shell->lockscreen);
}
-static int
-lockscreen_motion_handler(struct window *window,
- struct input *input, uint32_t time,
- int32_t x, int32_t y,
- int32_t sx, int32_t sy, void *data)
-{
- return POINTER_LEFT_PTR;
-}
-
static void
lockscreen_button_handler(struct window *window,
struct input *input, uint32_t time,
window_set_custom(shell->lockscreen);
window_set_button_handler(shell->lockscreen,
lockscreen_button_handler);
- window_set_motion_handler(shell->lockscreen,
- lockscreen_motion_handler);
tablet_shell_set_lockscreen(shell->tablet_shell,
struct terminal {
struct window *window;
+ struct widget *widget;
struct display *display;
union utf8_char *data;
struct task io_task;
}
static int
-motion_handler(struct window *window,
+motion_handler(struct widget *widget,
struct input *input, uint32_t time,
- int32_t x, int32_t y,
- int32_t sx, int32_t sy, void *data)
+ int32_t x, int32_t y, void *data)
{
struct terminal *terminal = data;
input_get_position(input,
&terminal->selection_end_x,
&terminal->selection_end_y);
- window_schedule_redraw(window);
+ widget_schedule_redraw(widget);
}
return POINTER_IBEAM;
window_set_keyboard_focus_handler(terminal->window,
keyboard_focus_handler);
window_set_button_handler(terminal->window, button_handler);
- window_set_motion_handler(terminal->window, motion_handler);
+
+ terminal->widget = window_add_widget(terminal->window, terminal);
+ widget_set_motion_handler(terminal->widget, motion_handler);
surface = cairo_image_surface_create(CAIRO_FORMAT_ARGB32, 0, 0);
cr = cairo_create(surface);
}
static int
-menu_motion_handler(struct window *window,
+menu_motion_handler(struct widget *widget,
struct input *input, uint32_t time,
- int32_t x, int32_t y,
- int32_t sx, int32_t sy, void *data)
+ int32_t x, int32_t y, void *data)
{
struct menu *menu = data;
- return menu_set_item(menu->widget, menu, sy);
+ return menu_set_item(menu->widget, menu, y);
}
static void
window->parent->shell_surface,
window->x, window->y, 0);
- window_set_motion_handler(window, menu_motion_handler);
window_set_button_handler(window, menu_button_handler);
window_set_redraw_handler(window, menu_redraw_handler);
window_set_user_data(window, menu);
menu->widget = window_add_widget(window, menu);
widget_set_enter_handler(menu->widget, menu_enter_handler);
widget_set_leave_handler(menu->widget, menu_leave_handler);
+ widget_set_motion_handler(menu->widget, menu_motion_handler);
return window;
}