mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-12-29 06:51:10 +00:00
[broadway] Track window type in browser
This commit is contained in:
parent
9c5c4223e3
commit
199cd1548f
@ -146,7 +146,7 @@ demo2 (BroadwayOutput *output)
|
||||
double da = 0;
|
||||
int i;
|
||||
|
||||
broadway_output_new_surface(output, 0, 100, 100, 800, 600);
|
||||
broadway_output_new_surface(output, 0, 100, 100, 800, 600, 0);
|
||||
|
||||
surface = cairo_image_surface_create (CAIRO_FORMAT_ARGB32,
|
||||
800, 600);
|
||||
|
@ -18,14 +18,12 @@
|
||||
static const char base64_alphabet[] =
|
||||
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
|
||||
|
||||
#if 0
|
||||
static void
|
||||
base64_uint8 (guint8 v, char *c)
|
||||
{
|
||||
c[0] = base64_alphabet[(v >> 0) & 0x3f];
|
||||
c[1] = base64_alphabet[(v >> 6) & 0x3];
|
||||
}
|
||||
#endif
|
||||
|
||||
static void
|
||||
base64_uint16 (guint32 v, char *c)
|
||||
@ -685,9 +683,11 @@ broadway_output_ungrab_pointer (BroadwayOutput *output)
|
||||
}
|
||||
|
||||
void
|
||||
broadway_output_new_surface(BroadwayOutput *output, int id, int x, int y, int w, int h)
|
||||
broadway_output_new_surface(BroadwayOutput *output,
|
||||
int id, int x, int y, int w, int h,
|
||||
gboolean is_temp)
|
||||
{
|
||||
char buf[HEADER_LEN + 15];
|
||||
char buf[HEADER_LEN + 16];
|
||||
int p;
|
||||
|
||||
p = write_header (output, buf, 's');
|
||||
@ -696,6 +696,7 @@ broadway_output_new_surface(BroadwayOutput *output, int id, int x, int y, int w
|
||||
append_uint16 (y, buf, &p);
|
||||
append_uint16 (w, buf, &p);
|
||||
append_uint16 (h, buf, &p);
|
||||
buf[p++] = is_temp ? '1' : '0';
|
||||
|
||||
assert (p == sizeof (buf));
|
||||
|
||||
|
@ -18,7 +18,8 @@ void broadway_output_new_surface (BroadwayOutput *output,
|
||||
int x,
|
||||
int y,
|
||||
int w,
|
||||
int h);
|
||||
int h,
|
||||
gboolean is_temp);
|
||||
void broadway_output_show_surface (BroadwayOutput *output,
|
||||
int id);
|
||||
void broadway_output_hide_surface (BroadwayOutput *output,
|
||||
|
@ -92,7 +92,7 @@ var surfaces = {};
|
||||
var outstandingCommands = new Array();
|
||||
var inputSocket = null;
|
||||
|
||||
function initContext(canvas, x, y, id)
|
||||
function initContext(canvas, x, y, id, isTemp)
|
||||
{
|
||||
canvas.surfaceId = id;
|
||||
canvas.style["position"] = "absolute";
|
||||
@ -103,6 +103,7 @@ function initContext(canvas, x, y, id)
|
||||
context.globalCompositeOperation = "source-over";
|
||||
document.body.appendChild(canvas);
|
||||
context.drawQueue = [];
|
||||
context.isTemp = isTemp;
|
||||
context.transientParent = 0;
|
||||
|
||||
return context;
|
||||
@ -223,10 +224,12 @@ function handleCommands(cmdObj)
|
||||
i = i + 3;
|
||||
var h = base64_16(cmd, i);
|
||||
i = i + 3;
|
||||
var isTemp = cmd[i] == '1';
|
||||
i = i + 1;
|
||||
var surface = document.createElement("canvas");
|
||||
surface.width = w;
|
||||
surface.height = h;
|
||||
surfaces[id] = initContext(surface, x, y, id);
|
||||
surfaces[id] = initContext(surface, x, y, id, isTemp);
|
||||
break;
|
||||
|
||||
case 'S': // Show a surface
|
||||
|
@ -225,7 +225,8 @@ _gdk_broadway_resync_windows (void)
|
||||
window->x,
|
||||
window->y,
|
||||
window->width,
|
||||
window->height);
|
||||
window->height,
|
||||
window->window_type == GDK_WINDOW_TEMP);
|
||||
if (GDK_WINDOW_IS_MAPPED (window))
|
||||
{
|
||||
broadway_output_show_surface (display->output, impl->id);
|
||||
@ -363,7 +364,8 @@ _gdk_broadway_display_create_window_impl (GdkDisplay *display,
|
||||
window->x,
|
||||
window->y,
|
||||
window->width,
|
||||
window->height);
|
||||
window->height,
|
||||
window->window_type == GDK_WINDOW_TEMP);
|
||||
}
|
||||
|
||||
static void
|
||||
|
Loading…
Reference in New Issue
Block a user