summaryrefslogtreecommitdiff
path: root/gdk/broadway
diff options
context:
space:
mode:
authorAlexander Larsson <alexl@redhat.com>2013-11-13 12:10:29 +0100
committerAlexander Larsson <alexl@redhat.com>2013-11-13 12:23:06 +0100
commitca89f5ab93da6745fb7f5d3483ed2943fce6f94e (patch)
tree3db6769076f72769ee35d91ccf7a3a1b4a4e5a30 /gdk/broadway
parent6917746c8ea6e5e7a3b07d15f653afbacb441292 (diff)
downloadgtk+-ca89f5ab93da6745fb7f5d3483ed2943fce6f94e.tar.gz
broadway: Send focus out events
Diffstat (limited to 'gdk/broadway')
-rw-r--r--gdk/broadway/broadway-protocol.h3
-rw-r--r--gdk/broadway/broadway-server.c9
-rw-r--r--gdk/broadway/gdkeventsource.c12
3 files changed, 18 insertions, 6 deletions
diff --git a/gdk/broadway/broadway-protocol.h b/gdk/broadway/broadway-protocol.h
index bd486481d5..8447bd567a 100644
--- a/gdk/broadway/broadway-protocol.h
+++ b/gdk/broadway/broadway-protocol.h
@@ -122,7 +122,8 @@ typedef struct {
typedef struct {
BroadwayInputBaseMsg base;
- gint32 id;
+ gint32 new_id;
+ gint32 old_id;
} BroadwayInputFocusMsg;
typedef union {
diff --git a/gdk/broadway/broadway-server.c b/gdk/broadway/broadway-server.c
index 0c384d8832..6aedd37b55 100644
--- a/gdk/broadway/broadway-server.c
+++ b/gdk/broadway/broadway-server.c
@@ -1545,15 +1545,16 @@ broadway_server_focus_window (BroadwayServer *server,
if (server->focused_window_id == new_focused_window)
return;
- /* Keep track of the new focused window */
- server->focused_window_id = new_focused_window;
-
memset (&focus_msg, 0, sizeof (focus_msg));
focus_msg.base.type = BROADWAY_EVENT_FOCUS;
focus_msg.base.time = broadway_server_get_last_seen_time (server);
- focus_msg.focus.id = new_focused_window;
+ focus_msg.focus.old_id = server->focused_window_id;
+ focus_msg.focus.new_id = new_focused_window;
broadway_events_got_input (&focus_msg, -1);
+
+ /* Keep track of the new focused window */
+ server->focused_window_id = new_focused_window;
}
guint32
diff --git a/gdk/broadway/gdkeventsource.c b/gdk/broadway/gdkeventsource.c
index b5c9e1cb2a..bb2a19fe64 100644
--- a/gdk/broadway/gdkeventsource.c
+++ b/gdk/broadway/gdkeventsource.c
@@ -345,7 +345,17 @@ _gdk_broadway_events_got_input (BroadwayInputMsg *message)
break;
case BROADWAY_EVENT_FOCUS:
- window = g_hash_table_lookup (display_broadway->id_ht, GINT_TO_POINTER (message->focus.id));
+ window = g_hash_table_lookup (display_broadway->id_ht, GINT_TO_POINTER (message->focus.old_id));
+ if (window)
+ {
+ event = gdk_event_new (GDK_FOCUS_CHANGE);
+ event->focus_change.window = g_object_ref (window);
+ event->focus_change.in = FALSE;
+ gdk_event_set_device (event, display->core_pointer);
+ node = _gdk_event_queue_append (display, event);
+ _gdk_windowing_got_event (display, node, event, message->base.serial);
+ }
+ window = g_hash_table_lookup (display_broadway->id_ht, GINT_TO_POINTER (message->focus.new_id));
if (window)
{
event = gdk_event_new (GDK_FOCUS_CHANGE);