summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKristian Høgsberg <krh@bitplanet.net>2011-05-04 16:17:20 -0400
committerKristian Høgsberg <krh@bitplanet.net>2011-05-04 16:17:45 -0400
commit81e8c26176a0f17a10a66c8a8c18bbc2bb9e06fd (patch)
tree14c2396a8df225a9778185c1e73eba84aeadc59b
parent92fb0e9e3963dc0a2e697899c33f8ebf74c418c7 (diff)
meego-tablet-shell: Rename tablet_client.poke to activate and add a destructor
-rw-r--r--compositor/meego-tablet-shell.c33
-rw-r--r--protocol/meego-tablet.xml3
2 files changed, 25 insertions, 11 deletions
diff --git a/compositor/meego-tablet-shell.c b/compositor/meego-tablet-shell.c
index 3c3eec6..db96eaf 100644
--- a/compositor/meego-tablet-shell.c
+++ b/compositor/meego-tablet-shell.c
@@ -343,26 +343,39 @@ destroy_tablet_client(struct wl_resource *resource, struct wl_client *client)
}
static void
-tablet_client_poke(struct wl_client *client,
- struct meego_tablet_client *tablet_client)
+tablet_client_destroy(struct wl_client *client,
+ struct meego_tablet_client *tablet_client)
+{
+}
+
+static void
+tablet_client_activate(struct wl_client *client,
+ struct meego_tablet_client *tablet_client)
{
struct wlsc_compositor *compositor = tablet_client->shell->compositor;
struct meego_tablet_shell *shell = tablet_client->shell;
struct wlsc_input_device *device =
(struct wlsc_input_device *) compositor->input_device;
- fprintf(stderr, "poke client %s\n", tablet_client->name);
+ fprintf(stderr, "activate client %s\n", tablet_client->name);
shell->current_client = tablet_client;
- if (tablet_client->surface) {
- wlsc_surface_activate(tablet_client->surface, device,
- wlsc_compositor_get_time());
- meego_tablet_shell_set_state(tablet_client->shell,
- STATE_TASK);
- }
+ if (!tablet_client->surface)
+ return;
+
+ wlsc_surface_activate(tablet_client->surface, device,
+ wlsc_compositor_get_time());
+
+ if (shell->state == STATE_SWITCHER) {
+ wl_list_remove(&shell->switcher_listener.link);
+ shell->switcher_surface = NULL;
+ };
+
+ meego_tablet_shell_set_state(tablet_client->shell, STATE_TASK);
}
static const struct meego_tablet_client_interface tablet_client_interface = {
- tablet_client_poke
+ tablet_client_destroy,
+ tablet_client_activate
};
static void
diff --git a/protocol/meego-tablet.xml b/protocol/meego-tablet.xml
index feceb6b..d3ead07 100644
--- a/protocol/meego-tablet.xml
+++ b/protocol/meego-tablet.xml
@@ -33,7 +33,8 @@
</interface>
<interface name="meego_tablet_client" version="1">
- <request name="poke"/>
+ <request name="destroy" type="destructor"/>
+ <request name="activate"/>
</interface>
</protocol>