diff options
author | Kristian Høgsberg <krh@bitplanet.net> | 2012-01-09 08:42:24 -0500 |
---|---|---|
committer | Kristian Høgsberg <krh@bitplanet.net> | 2012-01-09 08:42:24 -0500 |
commit | ee143236d7fd0e2184638c9240782bf474187f7c (patch) | |
tree | 3ac75682e6dc8e8468271f49e0d9f1c2a31d10dc /clients/desktop-shell.c | |
parent | 21eabf60b0d99aad113f6d50f36c632889f80fac (diff) |
window: Replace widget focus handler with a enter/leave handler pair
Diffstat (limited to 'clients/desktop-shell.c')
-rw-r--r-- | clients/desktop-shell.c | 30 |
1 files changed, 25 insertions, 5 deletions
diff --git a/clients/desktop-shell.c b/clients/desktop-shell.c index febac78..9e46cc1 100644 --- a/clients/desktop-shell.c +++ b/clients/desktop-shell.c @@ -230,7 +230,15 @@ panel_redraw_handler(struct window *window, void *data) } static void -panel_widget_focus_handler(struct widget *widget, void *data) +panel_widget_enter_handler(struct widget *widget, struct input *input, + uint32_t time, int32_t x, int32_t y, void *data) +{ + widget_schedule_redraw(widget); +} + +static void +panel_widget_leave_handler(struct widget *widget, + struct input *input, void *data) { widget_schedule_redraw(widget); } @@ -300,7 +308,8 @@ panel_add_widget(struct panel *panel, const char *icon, const char *path) widget->panel = panel; widget->widget = window_add_widget(panel->window, widget); - widget_set_focus_handler(widget->widget, panel_widget_focus_handler); + widget_set_enter_handler(widget->widget, panel_widget_enter_handler); + widget_set_leave_handler(widget->widget, panel_widget_leave_handler); } static void @@ -438,7 +447,16 @@ unlock_dialog_keyboard_focus_handler(struct window *window, } static void -unlock_dialog_widget_focus_handler(struct widget *widget, void *data) +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); +} + +static void +unlock_dialog_widget_leave_handler(struct widget *widget, + struct input *input, void *data) { widget_schedule_redraw(widget); } @@ -464,8 +482,10 @@ unlock_dialog_create(struct desktop *desktop) unlock_dialog_keyboard_focus_handler); window_set_button_handler(dialog->window, unlock_dialog_button_handler); dialog->button = window_add_widget(dialog->window, NULL); - widget_set_focus_handler(dialog->button, - unlock_dialog_widget_focus_handler); + widget_set_enter_handler(dialog->button, + unlock_dialog_widget_enter_handler); + widget_set_leave_handler(dialog->button, + unlock_dialog_widget_leave_handler); desktop_shell_set_lock_surface(desktop->shell, window_get_wl_shell_surface(dialog->window)); |