Xmir doesn't update the screen size until something is actually rendered
Bug #1491071 reported by
Christopher Townsend
This bug report is a duplicate of:
Bug #1417541: Xmir root window does not resize reliably.
Edit
Remove
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.
Changed in xorg-server (Ubuntu): | |
status: | New → Triaged |
importance: | Undecided → High |
To post a comment you must log in.
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) )); window- >damage)
DamageDama geRegion( &ctx->xmir_ window- >window- >drawable, &ctx->xmir_ window- >region) ;
if (ctx->xmir_
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.