Issue: When I embed an Xephyr into a parent window, Xephyr scales itself to fix in the parent window size. However, if the parent window resizes, Xephyr does not follow. Xephyr also does not allow to decrease its size because it sets a size hints during startup. This issue is very easy to reproduce. The attached patch fixed this this issue. This patch does the following things: 1. Do not set size hints if we are using -parent 2. Add StructureNotify event mask 3. Capture configure event and process it if we are using -parent It reuses the RandR function to resize the screen. I only tested this patch on 1.6 branch, but probably should work for 1.7. Could you help to review and nominate for 1.7 and 1.8? By the way, I personally consider this is a bug rather than enhancement. :)
Created attachment 32313 [details] [review] [PATCH] Resize ephyr screen size automatically when parent window is resized.
Comment on attachment 32313 [details] [review] [PATCH] Resize ephyr screen size automatically when parent window is resized. Just found a little problem on this patch. in hostx_get_event(), it should return 0 in case -parent is not set. I will submit a new patch tonight.
Created attachment 32321 [details] [review] Resize ephyr screen automatically when parent window is resized
OK, this one is better. Please check.
Oh, actually I just found out that I have some problem with this patch when using it in my application. Please don't apply it yet. I will try to figure out what's going on.
Created attachment 32502 [details] [review] Resize ephyr screen automatically when parent window is resized.
Created attachment 32503 [details] test case
OK, I finally got the patch right. Additional changes are: 4. Call RRScreenSizeNotify at the end of rrSetConfig is necessary, otherwise the cursor constrain won't get right. 5. Call RROutputSetModes with NULL to remove old modes is necessary, otherwise xrandr will report historical sizes. Now with the attached test case, there are the following things that can be verify. After started testxephyr, start Xephyr with: $ Xephyr :1 -parent <window-id> -query localhost 1. In this test case, the window size will change after Xephyr embedded, but before the window shows up. After startup, Xephyr should just follow the new size, and moving cursor around should be no problem. 2. Login to the session. Open a terminal and run xrandr. It should report the current size. 3. Now try to resize the window freely. The session running inside should just follow. For example in a GNOME session, the panel will always follow the screen size. Maximized window will also follow. 4. Run xrandr again, and it should always report the current screen size as the only available size. Please review... Thanks.
Hi Vic As you may have noticed from the silence here, patch review on bugzilla doesn't always work. To get your patch processed faster, please send it to xorg-devel@lists.freedesktop.org, this way those with more knowledge of this area can review it easier and provide direct feedback. Thanks.
Will this patch ever be integrated? At least from my point of view, Xephyr not being resizeable is the main thing that stands in the way of SELinux application sandboxes being genuinely usable. It would really be nice to be able to confine things on an ad-hoc basis.
commit 8843aed82e7d69422e7763a35832a2be8f26723f Author: Vic Lee <llyzs@163.com> Date: Mon Jul 30 14:32:09 2012 -0400 ephyr: Resize screen automatically when parent window is resized
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.