[PATCH weston 3/3] xwm: send input focus only for top-level windows

Tiago Vignatti tiago.vignatti at intel.com
Fri May 25 07:50:06 PDT 2012


Signed-off-by: Tiago Vignatti <tiago.vignatti at intel.com>
---
 src/xwayland/window-manager.c |    9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/src/xwayland/window-manager.c b/src/xwayland/window-manager.c
index 3cc0a50..62f5f07 100644
--- a/src/xwayland/window-manager.c
+++ b/src/xwayland/window-manager.c
@@ -306,6 +306,8 @@ weston_wm_window_read_properties(struct weston_wm_window *window)
 			break;
 		case XCB_ATOM_ATOM:
 			atom = xcb_get_property_value(reply);
+			if (*atom & wm->atom.net_wm_window_type)
+				window->type = *atom;
 			*(xcb_atom_t *) p = *atom;
 			break;
 		case TYPE_WM_PROTOCOLS:
@@ -438,6 +440,12 @@ weston_wm_window_activate(struct wl_listener *listener, void *data)
 	xcb_client_message_event_t client_message;
 
 	if (window) {
+		/* send the focus only for top-level windows. We might want to
+		 * improve the logic better here to satisfy this:
+		 * http://tronche.com/gui/x/icccm/sec-4.html#s-4.1.7 */
+		if (window->type != wm->atom.net_wm_window_type_normal)
+			return;
+
 		client_message.response_type = XCB_CLIENT_MESSAGE;
 		client_message.format = 32;
 		client_message.window = window->id;
@@ -714,6 +722,7 @@ weston_wm_handle_create_notify(struct weston_wm *wm, xcb_generic_event_t *event)
 	window->id = create_notify->window;
 	window->properties_dirty = 1;
 	window->decorate = 1;
+	window->type = 0;
 
 	window->width = create_notify->width;
 	window->height = create_notify->height;
-- 
1.7.9.5



More information about the wayland-devel mailing list