summaryrefslogtreecommitdiff
path: root/clients
diff options
context:
space:
mode:
authorJasper St. Pierre <jstpierre@mecheye.net>2014-05-06 08:44:29 -0400
committerKristian Høgsberg <krh@bitplanet.net>2014-05-12 23:34:05 -0700
commit973d7879e33e624f99f24fdd3dd0ddd8c9ca4dad (patch)
treef43a6435cbbfc4d1d048f8fc8330b0109c7f50ee /clients
parentde6809912e1a4639b05a4098a346872f91d8103b (diff)
xdg-shell: Turn "activated" into a state
This drops two events, and makes new window decorations race-free with an attach in-flight.
Diffstat (limited to 'clients')
-rw-r--r--clients/simple-egl.c12
-rw-r--r--clients/simple-shm.c12
-rw-r--r--clients/window.c20
3 files changed, 4 insertions, 40 deletions
diff --git a/clients/simple-egl.c b/clients/simple-egl.c
index 165ce10a..2097b4ca 100644
--- a/clients/simple-egl.c
+++ b/clients/simple-egl.c
@@ -304,16 +304,6 @@ handle_surface_configure(void *data, struct xdg_surface *surface,
}
static void
-handle_surface_activated(void *data, struct xdg_surface *xdg_surface)
-{
-}
-
-static void
-handle_surface_deactivated(void *data, struct xdg_surface *xdg_surface)
-{
-}
-
-static void
handle_surface_delete(void *data, struct xdg_surface *xdg_surface)
{
running = 0;
@@ -321,8 +311,6 @@ handle_surface_delete(void *data, struct xdg_surface *xdg_surface)
static const struct xdg_surface_listener xdg_surface_listener = {
handle_surface_configure,
- handle_surface_activated,
- handle_surface_deactivated,
handle_surface_delete,
};
diff --git a/clients/simple-shm.c b/clients/simple-shm.c
index d0cd7e39..29abb8bc 100644
--- a/clients/simple-shm.c
+++ b/clients/simple-shm.c
@@ -124,16 +124,6 @@ handle_configure(void *data, struct xdg_surface *surface,
}
static void
-handle_activated(void *data, struct xdg_surface *xdg_surface)
-{
-}
-
-static void
-handle_deactivated(void *data, struct xdg_surface *xdg_surface)
-{
-}
-
-static void
handle_delete(void *data, struct xdg_surface *xdg_surface)
{
running = 0;
@@ -141,8 +131,6 @@ handle_delete(void *data, struct xdg_surface *xdg_surface)
static const struct xdg_surface_listener xdg_surface_listener = {
handle_configure,
- handle_activated,
- handle_deactivated,
handle_delete,
};
diff --git a/clients/window.c b/clients/window.c
index c46cb722..7d883451 100644
--- a/clients/window.c
+++ b/clients/window.c
@@ -3868,6 +3868,7 @@ handle_surface_configure(void *data, struct xdg_surface *xdg_surface,
window->maximized = 0;
window->fullscreen = 0;
window->resizing = 0;
+ window->focused = 0;
wl_array_for_each(p, states) {
uint32_t state = *p;
@@ -3881,6 +3882,9 @@ handle_surface_configure(void *data, struct xdg_surface *xdg_surface,
case XDG_SURFACE_STATE_RESIZING:
window->resizing = 1;
break;
+ case XDG_SURFACE_STATE_ACTIVATED:
+ window->focused = 1;
+ break;
default:
/* Unknown state */
break;
@@ -3894,20 +3898,6 @@ handle_surface_configure(void *data, struct xdg_surface *xdg_surface,
}
static void
-handle_surface_activated(void *data, struct xdg_surface *xdg_surface)
-{
- struct window *window = data;
- window->focused = 1;
-}
-
-static void
-handle_surface_deactivated(void *data, struct xdg_surface *xdg_surface)
-{
- struct window *window = data;
- window->focused = 0;
-}
-
-static void
handle_surface_delete(void *data, struct xdg_surface *xdg_surface)
{
struct window *window = data;
@@ -3916,8 +3906,6 @@ handle_surface_delete(void *data, struct xdg_surface *xdg_surface)
static const struct xdg_surface_listener xdg_surface_listener = {
handle_surface_configure,
- handle_surface_activated,
- handle_surface_deactivated,
handle_surface_delete,
};