Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

small tooltip windows have transparency issues #500

Closed
totaam opened this issue Jan 22, 2014 · 25 comments
Closed

small tooltip windows have transparency issues #500

totaam opened this issue Jan 22, 2014 · 25 comments

Comments

@totaam
Copy link
Collaborator

totaam commented Jan 22, 2014

Issue migrated from trac ticket # 500

component: client | priority: critical | resolution: fixed

2014-01-22 20:37:37: maxmylyn created the issue


Some websites have a small pop-up that will display information, such as time since a post, information about a link, etc. etc.. In Xpra certain browsers will cause them to display a cross-hatching of colored lines before moving the mouse causes the proper pop-up to appear, with the lines just at the very bottom of the pop-up.

Interestingly, the pop-ups are only a problem in Chrome, not Firefox. The Firefox pop-ups are a solid white color, rather than the black (possibly partially transparent?) color in Chrome.

Currently running Xpra 0.11.x r5209 in Windows 7 64-bit. I'll attach a few screenshots to explain further.

@totaam
Copy link
Collaborator Author

totaam commented Jan 22, 2014

2014-01-22 20:38:03: maxmylyn uploaded file xpra pop up bug chrome.png (88.3 KiB)

the bugged pop-up in Chrome.
xpra pop up bug chrome.png

@totaam
Copy link
Collaborator Author

totaam commented Jan 22, 2014

2014-01-22 20:38:25: maxmylyn uploaded file xpra pop up bug firefox.png (80.1 KiB)

The pop-up working properly in Firefox
xpra pop up bug firefox.png

@totaam
Copy link
Collaborator Author

totaam commented Jan 22, 2014

2014-01-22 20:38:46: maxmylyn uploaded file xpra pop up bug working on interfacelift.png (62.1 KiB)

The pop-up working on interfacelift in Chrome
xpra pop up bug working on interfacelift.png

@totaam
Copy link
Collaborator Author

totaam commented Jan 22, 2014

2014-01-22 20:39:52: maxmylyn uploaded file xpra pop up bug working on twitch.png (109.9 KiB)

The pop-up working on twitch in chrome
xpra pop up bug working on twitch.png

@totaam
Copy link
Collaborator Author

totaam commented Jan 22, 2014

2014-01-22 20:41:09: maxmylyn uploaded file xpra pop up bug after moving mouse.png (101.9 KiB)

Pop up working semi-properly on bmwusa after moving the mouse
xpra pop up bug after moving mouse.png

@totaam
Copy link
Collaborator Author

totaam commented Jan 22, 2014

2014-01-22 20:41:37: maxmylyn uploaded file xpra pop up bug twitch after mouse move.png (60.9 KiB)

pop-up showing colors after moving mouse on twitch
xpra pop up bug twitch after mouse move.png

@totaam
Copy link
Collaborator Author

totaam commented Jan 22, 2014

2014-01-22 20:43:03: maxmylyn commented


I forgot to mention in the original post, but in some websites the pop-ups behave as expected in Chrome, and in others it shows up bugged. I'm not sure yet why.

@totaam
Copy link
Collaborator Author

totaam commented Jan 23, 2014

2014-01-23 00:29:13: totaam commented


I don't think the colour (black vs white) is relevant here: browsers are free to style alt tags as they wish, it may just be how those two browsers do it. You can verify this by running the browser natively (without involving xpra).

  • does this also happen on OSX?
  • does this also happen with opengl turned off?
  • does the bug occur with the default transparency test applications:
  • [/browser/xpra/trunk/src/tests/xpra/test_apps/transparent_colors.py tests.xpra.test_apps.transparent_colors]
  • [/browser/xpra/trunk/src/tests/xpra/test_apps/transparent_window.py tests.xpra.test_apps.transparent_window]
  • does this happen with transparency turned off on the server:
XPRA_ALPHA=0 xpra start ...
  • xpra info|grep window captured when the tooltip window is showing could be useful too
  • does this happen with all encodings that support transparency? (all the png encodings, webp and rgb) Does it happen with encodings that do not support transparency? (jpeg)

@totaam
Copy link
Collaborator Author

totaam commented Jan 23, 2014

2014-01-23 12:48:40: totaam commented


Raising the priority: I'm waiting to hear on this bug to release 0.11.1

@totaam
Copy link
Collaborator Author

totaam commented Jan 23, 2014

2014-01-23 18:05:53: maxmylyn commented


To answer your questions:

  • Yes, the same thing occurs in OSX.
    Interestingly instead of turning normal when you move the mouse like it does in the screenshot, the text just shifts over a couple of pixels to the right.

  • Yes, it behaves the exact same, both Windows and OSX with and without opengl

  • The default transparency tests look as they should, both with and without opengl

  • With XPRA_ALPHA=0, it behaves the exact same, both Windows and OSX

  • I retested with all the available encodings, and all the png encodings work fine. raw RGB + zlib/lz4 has the bug. jpeg works fine.

How do I use xpra info|grep window?

@totaam
Copy link
Collaborator Author

totaam commented Jan 23, 2014

2014-01-23 18:33:19: maxmylyn commented


Okay, Alex showed me how to use it. I'll attach the relevant .txt.

@totaam
Copy link
Collaborator Author

totaam commented Jan 23, 2014

2014-01-23 18:33:58: maxmylyn uploaded file xprainfo.txt (32.8 KiB)

the file generated after running "xpra info | grep window > xprainfo.txt"

@totaam
Copy link
Collaborator Author

totaam commented Jan 24, 2014

2014-01-24 05:12:17: totaam commented


Thanks for the details, so this is not transparency or GL related, only raw RGB has this problem.
From the xpra info log, the tooltip window is (I'm only showing the most relevant bits):

window[34].window-type=('TOOLTIP',)
window[34].total_frames[rgb24]=1
window[34].total_pixels[rgb24]=4002
window[34].size=(174, 23)
window[34].override-redirect=True
window[34].has-alpha=True
window[34].encoding=h264
window[34].encoding.last_used=rgb24

Human readable summary: the window is a TOOLTIP override-redirect window and we only send a single pixel update (174x23=4002) which is using rgb24 because it is small enough, and not rgb32 because the client probably does not support it (win32 I assume). The global encoding seems to be set to h264, but we never create a video context for small transient windows like these.

And judging by the screenshot, it looks like the rgb24 data is being processed as if it was rgb32. This is strange but at least now I know where to look.

@totaam
Copy link
Collaborator Author

totaam commented Jan 24, 2014

2014-01-24 05:48:42: totaam commented


Updated the bug title: it isn't with ALT tags, at least not in chrome, but with title tags (on both images and links).
A good page to test this is: links-testing.
I get the tooltip to show with chrome on tests: 13, 11, 10 (image only), 9, 8 (image only), 6, 5, 4, 3, 2

@totaam
Copy link
Collaborator Author

totaam commented Jan 24, 2014

2014-01-24 05:54:12: totaam uploaded file test-link-title.html (0.1 KiB)

simplest html test case possible

@totaam
Copy link
Collaborator Author

totaam commented Jan 24, 2014

2014-01-24 08:34:59: totaam commented


Fixed in r5262 (5263 for v0.11.x branch) by not sending alpha: we tell the server we don't handle RGBA on win32 or OSX, this means we strip the alpha server side.
The reason why we didn't do this normally is that:

  • the bandwidth savings are tiny (since this is used for very small windows only)
  • all pixels are stored as 32bpp anyway, so the empty alpha gets re-added client side anyway

In the process of debugging, I cleaned up the GL codepath: r5261

I am keeping this ticket open because we should be able to handle RGBA pixels client side, even when we don't actually paint the alpha channel.
May be related to #521

@totaam
Copy link
Collaborator Author

totaam commented Feb 24, 2014

2014-02-24 23:11:16: afarr commented


I am still seeing this issue on chrome (and lazarus) with osx client 0.12.0 r5531 and fedora 19 server 0.12.0 r 5531. Interestingly though, with firefox the tooltips are behaving as expected.

With chrome:

window[56].window-type=('TOOLTIP',)
window[56].total_frames[png]=1
window[56].total_pixels[png]=3772
window[56].size=(164, 23)
window[56].override-redirect=True
window[56].has-alpha=True
window[56].encoding=png
window[56].encoding.last_used=png

With firefox:

window[57].window-type=('TOOLTIP',)
window[57].total_frames[png]=1
window[57].total_pixels[png]=3744
window[57].size=(156, 24)
window[57].override-redirect=True
window[57].has-alpha=False
window[57].encoding=png
window[57].encoding.last_used=png

@totaam
Copy link
Collaborator Author

totaam commented Feb 27, 2014

2014-02-27 10:26:10: totaam commented


As expected this is because of the alpha channel: firefox doesn't use alpha but chrome does (look for has-alpha).

@totaam
Copy link
Collaborator Author

totaam commented Feb 28, 2014

2014-02-28 09:33:17: totaam commented


Lots of fixes in this area: r5624, r5625, r5626, r5627 and some more in #521#comment:4

[[BR]]

So, the core issue was that we were converting BGRX to RGBX but still sending it as rgb24, and it needs to be rgb32 instead.

[[BR]]

Most of the important fixes have been backported.

afarr: Feel free to close this ticket if everything works as expected, and if you have time please also check #521

@totaam
Copy link
Collaborator Author

totaam commented Mar 6, 2014

2014-03-06 21:17:24: afarr commented


Bad news... with 0.12.0 r5692 osx client and 0.12.0 r5711 fedora 19 server I'm still seeing the buggy Alpha dsiplay on tooltips with chrome and lazarus. (I'll attach a screenshot.)

Are the fixes meant to fix that? Is there some way to override the alpha for tooltips?

The interesting (but unsurprising now) bits of xpra info | grep window:

window[26].has-alpha=True
window[26].window-type=('TOOLTIP',)
window[26].total_frames[png]=2
window[26].total_pixels[png]=12282
window[26].override-redirect=True
window[26].size=(267, 23)
window[26].override-redirect=True
window[26].encoding=png

@totaam
Copy link
Collaborator Author

totaam commented Mar 6, 2014

2014-03-06 21:19:49: afarr uploaded file ticket500_tooltip-windows-still-displaying-poorly_r5692.png (330.7 KiB)

r5692 osx client chrome/lazarus tooltips still misbehaving
ticket500_tooltip-windows-still-displaying-poorly_r5692.png

@totaam
Copy link
Collaborator Author

totaam commented Mar 7, 2014

2014-03-07 14:09:03: totaam commented


AFAICT, this is a different bug with the exact same symptom, as it only occurs on OSX now. win32 is now fine and it wasn't before.

Which means that I will probably have to blacklist OSX for 32-bit RGB support. But I am now blocked by #529. Oh joy.

@totaam
Copy link
Collaborator Author

totaam commented Mar 13, 2014

2014-03-13 09:04:33: totaam commented


Help... with r5760 on server and client, I just cannot reproduce this at all now. Which is odd because I haven't made any changes that should have fixed this (and I've just skimmed the list of changes since r5700), and I was seeing the problem 6 days ago!?

I also hacked my server to remove other encodings completely (to make sure only rgb would get used), tried other encodings, etc. No luck!?

Can you still reproduce?

@totaam
Copy link
Collaborator Author

totaam commented Mar 13, 2014

2014-03-13 14:49:57: totaam commented


Got it at last! (by trying various archived beta builds to narrow things down), counterintuitively this is a real bug that has been there for much longer but only came to the surface because packaging problems on OSX prevented the inclusion of PIL (Python Imaging Library) in the disk image (and recent build improvements fixed that - which made the bug disappear from view).
Without PIL, the code reverts to the slower GDK image loading code... which did not deal with rgb32 and assumed the data could only be rgb24... r5771 fixes that.

In order to test this alternative codepath, you need to run a client without PIL installed (for example by removing PIL from the installation image) or using the environment variable: XPRA_USE_PIL=0 xpra attach ...

Feel free to just test that things look good instead, and close this ticket.

@totaam
Copy link
Collaborator Author

totaam commented Mar 18, 2014

2014-03-18 20:22:50: afarr commented


Ok, testing with XPRA_USE_PIL=0 the tooltips display as expected with all browsers (including with opengl=on).

Closing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant