[gtk+] [broadway] Track transient_for
- From: Alexander Larsson <alexl src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] [broadway] Track transient_for
- Date: Thu, 7 Apr 2011 19:19:55 +0000 (UTC)
commit 9c5c4223e3ee671ff7c76d632ab877095e33fd81
Author: Alexander Larsson <alexl redhat com>
Date: Tue Apr 5 12:02:46 2011 +0200
[broadway] Track transient_for
gdk/broadway/broadway.c | 19 +++++++++++++++++++
gdk/broadway/broadway.h | 3 +++
gdk/broadway/broadway.js | 8 ++++++++
gdk/broadway/gdkwindow-broadway.c | 22 ++++++++++++++++++++++
gdk/broadway/gdkwindow-broadway.h | 2 ++
5 files changed, 54 insertions(+), 0 deletions(-)
---
diff --git a/gdk/broadway/broadway.c b/gdk/broadway/broadway.c
index 0ddefde..bada96e 100644
--- a/gdk/broadway/broadway.c
+++ b/gdk/broadway/broadway.c
@@ -779,6 +779,25 @@ broadway_output_resize_surface(BroadwayOutput *output, int id, int w, int h)
}
void
+broadway_output_set_transient_for (BroadwayOutput *output,
+ int id,
+ int parent_id)
+{
+ char buf[HEADER_LEN + 6];
+ int p;
+
+ p = write_header (output, buf, 'p');
+
+ append_uint16 (id, buf, &p);
+ append_uint16 (parent_id, buf, &p);
+
+ assert (p == sizeof (buf));
+
+ broadway_output_write (output, buf, sizeof (buf));
+}
+
+
+void
broadway_output_put_rgb (BroadwayOutput *output, int id, int x, int y,
int w, int h, int byte_stride, void *data)
{
diff --git a/gdk/broadway/broadway.h b/gdk/broadway/broadway.h
index ab8eae6..2f93d27 100644
--- a/gdk/broadway/broadway.h
+++ b/gdk/broadway/broadway.h
@@ -33,6 +33,9 @@ void broadway_output_resize_surface (BroadwayOutput *output,
int id,
int w,
int h);
+void broadway_output_set_transient_for (BroadwayOutput *output,
+ int id,
+ int parent_id);
void broadway_output_put_rgb (BroadwayOutput *output,
int id,
int x,
diff --git a/gdk/broadway/broadway.js b/gdk/broadway/broadway.js
index 4b1cb32..3f34a2a 100644
--- a/gdk/broadway/broadway.js
+++ b/gdk/broadway/broadway.js
@@ -103,6 +103,7 @@ function initContext(canvas, x, y, id)
context.globalCompositeOperation = "source-over";
document.body.appendChild(canvas);
context.drawQueue = [];
+ context.transientParent = 0;
return context;
}
@@ -240,6 +241,13 @@ function handleCommands(cmdObj)
surfaces[id].canvas.style["display"] = "none";
break;
+ case 'p': // Set transient parent
+ var id = base64_16(cmd, i);
+ i = i + 3;
+ var parentId = base64_16(cmd, i);
+ i = i + 3;
+ surfaces[id].transientParent = parentId;
+
case 'd': // Delete surface
var id = base64_16(cmd, i);
i = i + 3;
diff --git a/gdk/broadway/gdkwindow-broadway.c b/gdk/broadway/gdkwindow-broadway.c
index 3518d40..24c4bb2 100644
--- a/gdk/broadway/gdkwindow-broadway.c
+++ b/gdk/broadway/gdkwindow-broadway.c
@@ -231,6 +231,10 @@ _gdk_broadway_resync_windows (void)
broadway_output_show_surface (display->output, impl->id);
window_data_send (display->output, impl);
}
+ if (impl->transient_for)
+ {
+ broadway_output_set_transient_for (display->output, impl->id, impl->transient_for);
+ }
}
gdk_display_flush (GDK_DISPLAY (display));
@@ -764,6 +768,24 @@ static void
gdk_broadway_window_set_transient_for (GdkWindow *window,
GdkWindow *parent)
{
+ GdkBroadwayDisplay *display;
+ GdkWindowImplBroadway *impl;
+ int parent_id;
+
+ impl = GDK_WINDOW_IMPL_BROADWAY (window->impl);
+
+ parent_id = 0;
+ if (parent)
+ parent_id = GDK_WINDOW_IMPL_BROADWAY (parent->impl)->id;
+
+ impl->transient_for = parent_id;
+
+ display = GDK_BROADWAY_DISPLAY (gdk_window_get_display (impl->wrapper));
+ if (display->output)
+ {
+ broadway_output_set_transient_for (display->output, impl->id, impl->transient_for);
+ gdk_display_flush (GDK_DISPLAY (display));
+ }
}
static void
diff --git a/gdk/broadway/gdkwindow-broadway.h b/gdk/broadway/gdkwindow-broadway.h
index bed2c82..0b3c857 100644
--- a/gdk/broadway/gdkwindow-broadway.h
+++ b/gdk/broadway/gdkwindow-broadway.h
@@ -60,6 +60,8 @@ struct _GdkWindowImplBroadway
int id;
+ int transient_for;
+
gint8 toplevel_window_type;
gboolean dirty;
gboolean last_synced;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]