Xmir doesn't update the screen size until something is actually rendered

Bug #1491071 reported by Christopher Townsend
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
xorg-server (Ubuntu)
Triaged
High
Unassigned

Bug Description

In trying to get Compiz working under Xmir in Unity 8 desktop mode, I have found that when a Mir window opens and then resizes to whatever Unity 8 tells it to, the resize event does not get propagated down until another resize event occurs.

For example, I start up an X app. The Xmir window opens and is resized, but internally, Xmir still reports the full screen size so when Compiz starts, it thinks the surface size is the size of the physical display.

I'll include a patch that fixes this and we can discuss if it's a good fix.

Tags: xmir
Revision history for this message
Christopher Townsend (townsend) wrote :

Well, my patch-foo seems week as I can't seem to generate a good diff. At any rate, here's what I'm proposing:

Using a fully patched source tree, open hw/xmir/xmir-input.c. Find the xmir_handle_input_in_main_thread() function. In the mir_event_type_resize case add the following after the ErrorF() line:

xmir_output_handle_resize(ctx->xmir_window, mir_resize_event_get_width(mir_event_get_resize_event(ev)), mir_resize_event_get_height(mir_event_get_resize_event(ev)));

such that the code block looks like:

    case mir_event_type_resize:
        ErrorF("Resize requested to %ix%i\n", mir_resize_event_get_width(mir_event_get_resize_event(ev)), mir_resize_event_get_height(mir_event_get_resize_event(ev)));
        xmir_output_handle_resize(ctx->xmir_window, mir_resize_event_get_width(mir_event_get_resize_event(ev)), mir_resize_event_get_height(mir_event_get_resize_event(ev)));
        if (ctx->xmir_window->damage)
            DamageDamageRegion(&ctx->xmir_window->window->drawable, &ctx->xmir_window->region);
        break;

I'm thinking since xmir_output_handle_resize() is being called, we might be able to remove some subsequent calls to it to avoid some overhead.

Revision history for this message
Robert Ancell (robert-ancell) wrote :

Hey, you know XMir is on a git branch right?

lp:~xmir-team/xorg-server/+git/xmir

where lp is git+ssh://<email address hidden>/

Should be easier to generate diffs - propose merges.

Revision history for this message
Robert Ancell (robert-ancell) wrote :

Yeah, it makes sense to me to just call xmir_output_handle_resize after getting the mir_event_type_resize. I think we could definitely drop the damage call as well - this will be done inside xmir_output_handle_resize anyway.

Revision history for this message
Robert Ancell (robert-ancell) wrote :

The patch files in the Ubuntu package are just generated from the git branch using format-patch. I rebase this branch each time I update the Ubuntu package.

Changed in xorg-server (Ubuntu):
status: New → Triaged
importance: Undecided → High
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

The resize logic in question was rewritten recently to work (better) in -rootless mode. As for non-rootless mode that's still more broken, but also already logged as bug 1417541. So we'll track it there.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.