summaryrefslogtreecommitdiff
path: root/clients
diff options
context:
space:
mode:
Diffstat (limited to 'clients')
-rw-r--r--clients/desktop-shell.c8
-rw-r--r--clients/dnd.c6
-rw-r--r--clients/window.c12
-rw-r--r--clients/window.h9
4 files changed, 26 insertions, 9 deletions
diff --git a/clients/desktop-shell.c b/clients/desktop-shell.c
index 043ea50..92b5f20 100644
--- a/clients/desktop-shell.c
+++ b/clients/desktop-shell.c
@@ -229,11 +229,13 @@ panel_redraw_handler(struct window *window, void *data)
window_flush(window);
}
-static void
+static int
panel_launcher_enter_handler(struct widget *widget, struct input *input,
uint32_t time, int32_t x, int32_t y, void *data)
{
widget_schedule_redraw(widget);
+
+ return POINTER_LEFT_PTR;
}
static void
@@ -454,12 +456,14 @@ unlock_dialog_keyboard_focus_handler(struct window *window,
window_schedule_redraw(window);
}
-static void
+static int
unlock_dialog_widget_enter_handler(struct widget *widget,
struct input *input, uint32_t time,
int32_t x, int32_t y, void *data)
{
widget_schedule_redraw(widget);
+
+ return POINTER_LEFT_PTR;
}
static void
diff --git a/clients/dnd.c b/clients/dnd.c
index f8cd7ef..febb1cc 100644
--- a/clients/dnd.c
+++ b/clients/dnd.c
@@ -432,11 +432,15 @@ lookup_cursor(struct dnd *dnd, int x, int y)
return POINTER_LEFT_PTR;
}
-static void
+static int
dnd_enter_handler(struct widget *widget,
struct input *input, uint32_t time,
int32_t x, int32_t y, void *data)
{
+ struct window *window = data;
+ struct dnd *dnd = window_get_user_data(window);
+
+ return lookup_cursor(dnd, x, y);
}
static int
diff --git a/clients/window.c b/clients/window.c
index 70642a4..7ca1e1d 100644
--- a/clients/window.c
+++ b/clients/window.c
@@ -1267,6 +1267,7 @@ window_set_focus_widget(struct window *window, struct widget *focus,
struct input *input, uint32_t time, int32_t x, int32_t y)
{
struct widget *old;
+ int pointer = POINTER_LEFT_PTR;
if (focus == window->focus_widget)
return;
@@ -1280,9 +1281,12 @@ window_set_focus_widget(struct window *window, struct widget *focus,
if (focus) {
if (focus->enter_handler)
- focus->enter_handler(focus, input, time,
- x, y, focus->user_data);
+ pointer = focus->enter_handler(focus, input, time,
+ x, y, focus->user_data);
window->focus_widget = focus;
+
+ pointer = input_get_pointer_image_for_location(input, pointer);
+ input_set_pointer_image(input, time, pointer);
}
}
@@ -2221,7 +2225,7 @@ menu_motion_handler(struct widget *widget,
return menu_set_item(menu, y);
}
-static void
+static int
menu_enter_handler(struct widget *widget,
struct input *input, uint32_t time,
int32_t x, int32_t y, void *data)
@@ -2230,6 +2234,8 @@ menu_enter_handler(struct widget *widget,
struct menu *menu = window_get_user_data(window);
menu_set_item(menu, y);
+
+ return POINTER_LEFT_PTR;
}
static void
diff --git a/clients/window.h b/clients/window.h
index 97a1c6a..c50c0da 100644
--- a/clients/window.h
+++ b/clients/window.h
@@ -180,9 +180,9 @@ typedef void (*window_drop_handler_t)(struct window *window,
typedef void (*window_close_handler_t)(struct window *window, void *data);
-typedef void (*widget_enter_handler_t)(struct widget *widget,
- struct input *input, uint32_t time,
- int32_t x, int32_t y, void *data);
+typedef int (*widget_enter_handler_t)(struct widget *widget,
+ struct input *input, uint32_t time,
+ int32_t x, int32_t y, void *data);
typedef void (*widget_leave_handler_t)(struct widget *widget,
struct input *input, void *data);
typedef int (*widget_motion_handler_t)(struct widget *widget,
@@ -191,6 +191,9 @@ typedef int (*widget_motion_handler_t)(struct widget *widget,
typedef void (*widget_button_handler_t)(struct widget *widget,
struct input *input, uint32_t time,
int button, int state, void *data);
+typedef void (*widget_resize_handler_t)(struct widget *widget,
+ int32_t width, int32_t height,
+ void *data);
struct window *
window_create(struct display *display, int32_t width, int32_t height);