Bug 2583 - disappearing windows when using 'xrender' compositing
Summary: disappearing windows when using 'xrender' compositing
Status: RESOLVED FIXED
Alias: None
Product: Sato
Classification: Yocto Project Subprojects
Component: Matchbox (show other bugs)
Version: svn
Hardware: x86 Multiple
: Medium normal
Target Milestone: Future
Assignee: Ross Burton
QA Contact:
URL:
Whiteboard:
Depends on:
Blocks:
 
Reported: 2012-06-12 05:57 UTC by Joe Steeve
Modified: 2012-09-04 14:18 UTC (History)
3 users (show)

See Also:
OS type for building Yocto: ---
Type of Regression: ---
Verified:
Documentation change: ---


Attachments
patch for disappearing windows issue in matchbox (1.03 KB, patch)
2012-06-12 05:57 UTC, Joe Steeve
no flags Details | Diff
fix for disappearing windows (take-2) (1.09 KB, patch)
2012-06-13 18:40 UTC, Joe Steeve
no flags Details | Diff
fix for disappearing windows (take-3) (1.11 KB, patch)
2012-06-13 18:58 UTC, Joe Steeve
no flags Details | Diff
fix for disappearing windows (take-4) (1.46 KB, patch)
2012-06-17 10:15 UTC, Joe Steeve
no flags Details | Diff
fix for disappearing windows (take-5) (7.26 KB, patch)
2012-08-28 21:51 UTC, Joe Steeve
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Joe Steeve 2012-06-12 05:57:23 UTC
Created attachment 566 [details]
patch for disappearing windows issue in matchbox

Note: We are not using 'sato'. We are using the matchbox-window-manager-2 in our custom image.

We are using the 'Xrender' compositing manager. The main window opens a dialog-box-1. dialog-box-1 opens up another dialog-box-2. When opening dialog-box-2, if something had changed in the underlying windows causing the ConfigureNotify to be emitted, the underlying windows are hidden away by matchbox. The window stack looks like this:

==== window stack =====
     +-- XID: 4008ef NAME: Alpha keyboard, type 2, layer 0
   +-- XID: 4006c9 NAME: Login, type 2, layer 0
 XID: 400003 NAME: hmi-ui, type 1, layer 3
======================

The attached patch fixes this problem.
Comment 1 Ross Burton 2012-06-13 17:30:10 UTC
I'm somewhat impressed that people are using mb-wm-2...
Comment 2 Joe Steeve 2012-06-13 17:46:52 UTC
@ross: Is there a better wm for a "single-application with compositing coolness" usecase?
Comment 3 tf 2012-06-13 17:47:25 UTC
I don't think that is correct, it likely only works for you because the ConfigureNotify in this case is for stacking change without change to the window geometry. I think mb_wm_comp_mgr_xrender_client_configure_real() needs to check whether the window size has changed; if it has not, the function can short-circuit out, leaving the existing picture alone. If the size has changed, the picture needs to be release *and* recreated (at the moment the picture creation only happens in the _show() method, which is why this does not work).
Comment 4 Joe Steeve 2012-06-13 17:54:28 UTC
@tf: Okay. I am a noob to X11. I just traced the execution to see where it was getting screwed.

Any pointers on where the original geometry and the new geometry would be?
Comment 5 Joe Steeve 2012-06-13 18:29:07 UTC
Looks like the new geometry comes along with the ConfigureNotify event. But this is not propagated beyond 'mb_wm_handle_composite_config_notify' in core/mb-window-manager.c.

- Should we propagate this event up to the xrender composite-manager, and check for geometry change there?

- Or, should we just check for it in the window-manager.c and not call the comp-manager when there is no geometry change?
Comment 6 Joe Steeve 2012-06-13 18:40:33 UTC
Created attachment 581 [details]
fix for disappearing windows (take-2)
Comment 7 Joe Steeve 2012-06-13 18:41:48 UTC
I have attached another patch. This time, I check if geometry has changed before calling the composite-manager's configure_notify handler.

Please check and comment.
Comment 8 Joe Steeve 2012-06-13 18:58:11 UTC
Created attachment 582 [details]
fix for disappearing windows (take-3)

Fixed a small bug with the previous patch.
Comment 9 Joe Steeve 2012-06-17 10:13:51 UTC
The issue shows up again when the dialog box's geometry changes. When a ChangeNotify is raised, the dclient->picture is destroyed but never created again.
Comment 10 Joe Steeve 2012-06-17 10:15:12 UTC
Created attachment 591 [details]
fix for disappearing windows (take-4)

This patch drops the dclient->picture and creates it with the changed window when ChangeNotify is raised.
Comment 11 Joe Steeve 2012-07-04 04:11:43 UTC
@tf: Please can you have a look at the patch and tell me whether its correct?
Comment 12 tf 2012-08-14 10:34:32 UTC
(In reply to comment #11)
> @tf: Please can you have a look at the patch and tell me whether its correct?

the configure_real function really should check whether the window extents/position have changed to avoid doing this unnecessarily. As is, you can get at the bounding box with XFixesFetchRegionAndBounds(), though it would make sense if the configuration geometry was getting passed down into the compositor configure function so it can be compared to old values cached in the MBWMCompMgrDefaultClient struct.

(MBWM2 has been more or less unmaintained for 4 years ever since Intel acquired the codebase, and I have not got the spare time to take it on at the moment but our company, sleep(5) ltd, could provide support and further development on commercial basis for anyone needing that.)
Comment 13 Joe Steeve 2012-08-28 21:51:56 UTC
Created attachment 745 [details]
fix for disappearing windows (take-5)
Comment 14 Joe Steeve 2012-08-28 21:53:01 UTC
@tf I've attached another patch implementing your suggestions. In this one, the geometry is pushed upto the *configure_real. The *configure_real redraws only when the geometry is changed.
Comment 15 Song Liu 2012-08-29 20:46:34 UTC
Changed the milestone as this is not really part of the Yocto Project release. 'Future' is not exactly right either, but we don't seem to have a n/a value for target milestone. 

Thanks for letting me know, Ross!
Comment 16 tf 2012-09-04 09:31:18 UTC
Comment on attachment 745 [details]
fix for disappearing windows (take-5)

This looks good to me.
Comment 17 Ross Burton 2012-09-04 09:36:29 UTC
Thanks Tomas, much appreciated.

Merged to master
Comment 18 Joe Steeve 2012-09-04 14:18:50 UTC
tf & Ross Burton, thanks guys.