text: Rename de/activate to enter/leave
Also add a surface argument to the enter event.
This commit is contained in:
committed by
Kristian Høgsberg
parent
64988feb13
commit
680275fbf1
+10
-6
@@ -346,19 +346,23 @@ text_model_locale(void *data,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
text_model_activated(void *data,
|
text_model_enter(void *data,
|
||||||
struct text_model *text_model)
|
struct text_model *text_model,
|
||||||
|
struct wl_surface *surface)
|
||||||
{
|
{
|
||||||
struct text_entry *entry = data;
|
struct text_entry *entry = data;
|
||||||
|
|
||||||
|
if (surface != window_get_wl_surface(entry->window))
|
||||||
|
return;
|
||||||
|
|
||||||
entry->active = 1;
|
entry->active = 1;
|
||||||
|
|
||||||
widget_schedule_redraw(entry->widget);
|
widget_schedule_redraw(entry->widget);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
text_model_deactivated(void *data,
|
text_model_leave(void *data,
|
||||||
struct text_model *text_model)
|
struct text_model *text_model)
|
||||||
{
|
{
|
||||||
struct text_entry *entry = data;
|
struct text_entry *entry = data;
|
||||||
|
|
||||||
@@ -376,8 +380,8 @@ static const struct text_model_listener text_model_listener = {
|
|||||||
text_model_selection_replacement,
|
text_model_selection_replacement,
|
||||||
text_model_direction,
|
text_model_direction,
|
||||||
text_model_locale,
|
text_model_locale,
|
||||||
text_model_activated,
|
text_model_enter,
|
||||||
text_model_deactivated
|
text_model_leave
|
||||||
};
|
};
|
||||||
|
|
||||||
static struct text_entry*
|
static struct text_entry*
|
||||||
|
|||||||
+5
-4
@@ -127,14 +127,15 @@
|
|||||||
<event name="selection_replacement"/>
|
<event name="selection_replacement"/>
|
||||||
<event name="direction"/>
|
<event name="direction"/>
|
||||||
<event name="locale"/>
|
<event name="locale"/>
|
||||||
<event name="activated">
|
<event name="enter">
|
||||||
<description summary="activated event">
|
<description summary="enter event">
|
||||||
Notify the model when it is activated. Typically in response to an
|
Notify the model when it is activated. Typically in response to an
|
||||||
activate request.
|
activate request.
|
||||||
</description>
|
</description>
|
||||||
|
<arg name="surface" type="object" interface="wl_surface"/>
|
||||||
</event>
|
</event>
|
||||||
<event name="deactivated">
|
<event name="leave">
|
||||||
<description summary="deactivated event">
|
<description summary="leave event">
|
||||||
Notify the model when it is deactivated. Either in response to a
|
Notify the model when it is deactivated. Either in response to a
|
||||||
deactivate request or when the assigned surface lost focus or was
|
deactivate request or when the assigned surface lost focus or was
|
||||||
destroyed.
|
destroyed.
|
||||||
|
|||||||
+2
-2
@@ -90,7 +90,7 @@ deactivate_text_model(struct text_model *text_model,
|
|||||||
input_method->model = NULL;
|
input_method->model = NULL;
|
||||||
input_method->context = NULL;
|
input_method->context = NULL;
|
||||||
wl_signal_emit(&ec->hide_input_panel_signal, ec);
|
wl_signal_emit(&ec->hide_input_panel_signal, ec);
|
||||||
text_model_send_deactivated(&text_model->resource);
|
text_model_send_leave(&text_model->resource);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -157,7 +157,7 @@ text_model_activate(struct wl_client *client,
|
|||||||
|
|
||||||
wl_signal_emit(&ec->show_input_panel_signal, ec);
|
wl_signal_emit(&ec->show_input_panel_signal, ec);
|
||||||
|
|
||||||
text_model_send_activated(&text_model->resource);
|
text_model_send_enter(&text_model->resource, &text_model->surface->resource);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|||||||
Reference in New Issue
Block a user