Community
Participate
Working Groups
Created attachment 274084 [details] Reproducing project Something changed between Platform builds 4.8M6 and 4.8M7 that broke taking screenshots in SWTBot tests. Specifically, all screenshots are the same (binary copies) as the first one taken. It looks like org.eclipse.swt.graphics.GC.copyArea(...) works OK just on a first call but then produces the same content (maybe cached?) no matter what's happening on the screen. I can reproduce it on Fedora 27 and Red Hat Enterprise Linux 7.5 (x86_64) with platform builds 4.8M7 and I20180516-2000. How to reproduce: 1. Unpack eclipse-platform-4.8M7-linux-gtk-x86_64.tar.gz 2. Install SWTBot and PDE: ./eclipse/eclipse -noSplash \ -application org.eclipse.equinox.p2.director \ -repository http://download.eclipse.org/releases/photon,http://download.eclipse.org/eclipse/updates/4.8,http://download.eclipse.org/technology/swtbot/snapshots \ -i org.eclipse.swtbot.feature.group,org.eclipse.swtbot.eclipse.feature.group,org.eclipse.swtbot.eclipse.test.junit.feature.group,org.eclipse.swtbot.generator.feature.feature.group,org.eclipse.swtbot.ide.feature.group,org.eclipse.pde.feature.group 3. Run Eclipse: ./eclipse/eclipse & 4. Create a SWTBot project (SWTBot Test Plug-in) that makes a few changes on the screen and takes a few screenshots. (I'm attaching such a project.) 5. Run the project as a SWTBot Test 6. Look at the produced screenshot files - they are binary identical
Can you please add -vmargs -Dorg.eclipse.swt.internal.gtk.cairoContextReuse=false to your Eclipse with SWTBot and check if this fixes the problem? Also can you please point to the code which is creating screenshots? See bug 531667.
(In reply to Andrey Loskutov from comment #1) Thanks for your reply! > Can you please add -vmargs > -Dorg.eclipse.swt.internal.gtk.cairoContextReuse=false to your Eclipse with > SWTBot and check if this fixes the problem? No, this does not help... > > Also can you please point to the code which is creating screenshots? The reproducer I attached calls SWTBot's SWTUtils.captureScreenshot() which is effectively implemented by captureScreenshotInternal() here: http://git.eclipse.org/c/swtbot/org.eclipse.swtbot.git/tree/org.eclipse.swtbot.swt.finder/src/org/eclipse/swtbot/swt/finder/utils/SWTUtils.java#n444
I'll investigate this for RC2.
The commit that introduced this bug is: https://git.eclipse.org/c/platform/eclipse.platform.swt.git/commit/?id=6a595ca4d2accb36c336a08183008671ad23a9f3
(In reply to Eric Williams from comment #4) > The commit that introduced this bug is: > https://git.eclipse.org/c/platform/eclipse.platform.swt.git/commit/ > ?id=6a595ca4d2accb36c336a08183008671ad23a9f3 There is another way to fix the original issue. I will create a patch by EOD today can you please test it? Also one question I have is how does SWTBot works with Wayland and GTK3?
New Gerrit change created: https://git.eclipse.org/r/123018
(In reply to Eclipse Genie from comment #6) > New Gerrit change created: https://git.eclipse.org/r/123018 Alex and Eric, Can you please review this patch?
Created attachment 274112 [details] screenshots after the fix Here is the zip file containing the screen shots I got with the attached fix
Gerrit change https://git.eclipse.org/r/123018 was merged to [master]. Commit: http://git.eclipse.org/c/platform/eclipse.platform.swt.git/commit/?id=809b38a9c2e5537b4a532a4680f7fc06d8c7dbb2
(In reply to Eclipse Genie from comment #9) > Gerrit change https://git.eclipse.org/r/123018 was merged to [master]. > Commit: > http://git.eclipse.org/c/platform/eclipse.platform.swt.git/commit/ > ?id=809b38a9c2e5537b4a532a4680f7fc06d8c7dbb2 Merged to master
eclipse-platform-I20180521-2000-linux-gtk-x86_64 works for me, thank you guys for fixing this!
(In reply to Sravan Kumar Lakkimsetti from comment #5) > Also one question I have is how does SWTBot works with Wayland and GTK3? The screenshot functionality is totally non-working, as Wayland doesn't allow other applications to access each other's pixels/buffer. So this issue is X11 specific.
Based on Comment 11 Marking this as verified
New Gerrit change created: https://git.eclipse.org/r/124221
New Gerrit change created: https://git.eclipse.org/r/124222
Gerrit change https://git.eclipse.org/r/124222 was merged to [R4_8_maintenance]. Commit: http://git.eclipse.org/c/platform/eclipse.platform.swt.git/commit/?id=742c1cbd39bb33d4c9827db948582faef531b1ba
Gerrit change https://git.eclipse.org/r/124221 was merged to [master]. Commit: http://git.eclipse.org/c/platform/eclipse.platform.swt.git/commit/?id=eefce06f03d2324bb163236c7ef7d90838f1d9ad
Reverted this fix to identify a better solution for black bands problem
(In reply to Sravan Kumar Lakkimsetti from comment #18) > Reverted this fix to identify a better solution for black bands problem We will try to find a fix after RC4.
Created a new patch fixing this bug and 535123. Please verify this patch works https://git.eclipse.org/r/124241
Merged to R4_8_maintenance with https://git.eclipse.org/c/platform/eclipse.platform.swt.git/commit/?id=d34b12b98ea8c4e4cb1f2b84b13801e4db914e55
Checked in S-4.8RC4a-201806110500, works for me.