]> Pileus Git - ~andy/gtk/commitdiff
[broadway] Make the toplevel mode a url parameter
authorAlexander Larsson <alexl@redhat.com>
Fri, 8 Apr 2011 13:36:07 +0000 (15:36 +0200)
committerAlexander Larsson <alexl@redhat.com>
Sun, 10 Apr 2011 18:16:13 +0000 (20:16 +0200)
gdk/broadway/broadway.js
gdk/broadway/gdkdisplay-broadway.c

index f9b59498a92edcc8cb502b48bf0cc4e2f7f2fde4..8cefb061c420dfbd0dc88edc651290777ebd1b1a 100644 (file)
@@ -1078,6 +1078,13 @@ function setupDocument(document)
 
 function connect()
 {
+    var url = window.location.toString();
+    var query_string = url.split("?");
+    if (query_string.length > 1) {
+       var params = query_string[1].split("&");
+       if (params[0].indexOf("toplevel") != -1)
+           useToplevelWindows = true;
+    }
     var xhr = createXHR();
     if (xhr) {
        if (typeof xhr.multipart == 'undefined') {
index ff1180e98217a619325a035db1b875486ddfff9b..75a639fc8c497fbf50039ad97a02a8d7e93b8cc6 100644 (file)
@@ -750,7 +750,7 @@ send_data (HttpRequest *request,
 static void
 got_request (HttpRequest *request)
 {
-  char *start, *escaped, *tmp, *version;
+  char *start, *escaped, *tmp, *version, *query;
 
   if (!g_str_has_prefix (request->request->str, "GET "))
     {
@@ -777,6 +777,10 @@ got_request (HttpRequest *request)
       version = g_strndup (start, tmp - start);
     }
 
+  query = strchr (escaped, '?');
+  if (query)
+    *query = 0;
+
   if (strcmp (escaped, "/client.html") == 0 || strcmp (escaped, "/") == 0)
     send_data (request, "text/html", client_html, G_N_ELEMENTS(client_html) - 1);
   else if (strcmp (escaped, "/broadway.js") == 0)