[broadway] Wire up the delete event
This commit is contained in:
		| @ -275,15 +275,28 @@ function updateBrowserWindowGeometry(win) { | ||||
| 	    } | ||||
| 	} | ||||
|     } | ||||
|  | ||||
| } | ||||
|  | ||||
| function browserWindowClosed(win) { | ||||
|     var surface = win.surface; | ||||
|  | ||||
|     sendInput ("W", [surface.id]); | ||||
|     for (id in surfaces) { | ||||
| 	if (surfaces[id].transientToplevel != null && surfaces[id].transientToplevel == surface) { | ||||
| 	    var childSurface = surfaces[id]; | ||||
| 	    sendInput ("W", [childSurface.id]); | ||||
| 	} | ||||
|     } | ||||
| } | ||||
|  | ||||
|  | ||||
| function registerWindow(win) | ||||
| { | ||||
|     toplevelWindows.push(win); | ||||
|     win.onresize = function(ev) { updateBrowserWindowGeometry(ev.target); }; | ||||
|     if (!windowGeometryTimeout) | ||||
| 	windowGeometryTimeout = setInterval(function () { toplevelWindows.forEach(updateBrowserWindowGeometry); }, 2000); | ||||
|     win.onunload = function(ev) { browserWindowClosed(ev.target.defaultView); }; | ||||
| } | ||||
|  | ||||
| function unregisterWindow(win) | ||||
|  | ||||
| @ -258,7 +258,10 @@ parse_input_message (BroadwayInput *input, const char *message) | ||||
|     msg.configure_notify.width = strtol (p, &p, 10); | ||||
|     p++; /* Skip , */ | ||||
|     msg.configure_notify.height = strtol (p, &p, 10); | ||||
|     p++; /* Skip , */ | ||||
|     break; | ||||
|  | ||||
|   case 'W': | ||||
|     msg.delete_notify.id = strtol(p, &p, 10); | ||||
|     break; | ||||
|  | ||||
|   default: | ||||
|  | ||||
| @ -96,6 +96,11 @@ typedef struct { | ||||
|   int height; | ||||
| } BroadwayInputConfigureNotify; | ||||
|  | ||||
| typedef struct { | ||||
|   BroadwayInputBaseMsg base; | ||||
|   int id; | ||||
| } BroadwayInputDeleteNotify; | ||||
|  | ||||
| typedef union { | ||||
|   BroadwayInputBaseMsg base; | ||||
|   BroadwayInputPointerMsg pointer; | ||||
| @ -105,6 +110,7 @@ typedef union { | ||||
|   BroadwayInputKeyMsg key; | ||||
|   BroadwayInputGrabReply grab_reply; | ||||
|   BroadwayInputConfigureNotify configure_notify; | ||||
|   BroadwayInputDeleteNotify delete_notify; | ||||
| } BroadwayInputMsg; | ||||
|  | ||||
| struct _GdkBroadwayDisplay | ||||
|  | ||||
| @ -294,6 +294,18 @@ _gdk_broadway_events_got_input (GdkDisplay *display, | ||||
|       } | ||||
|     break; | ||||
|  | ||||
|   case 'W': | ||||
|     window = g_hash_table_lookup (display_broadway->id_ht, GINT_TO_POINTER (message->delete_notify.id)); | ||||
|     if (window) | ||||
|       { | ||||
| 	event = gdk_event_new (GDK_DELETE); | ||||
| 	event->any.window = g_object_ref (window); | ||||
|  | ||||
| 	node = _gdk_event_queue_append (display, event); | ||||
| 	_gdk_windowing_got_event (display, node, event, message->base.serial); | ||||
|       } | ||||
|     break; | ||||
|  | ||||
|   default: | ||||
|     g_printerr ("Unknown input command %c\n", message->base.type); | ||||
|     break; | ||||
|  | ||||
		Reference in New Issue
	
	Block a user
	 Alexander Larsson
					Alexander Larsson