Attached is the second update of the XEmbed systray patches. Changes in this version:
1. On the advice of Juan Lang, I only acquire the wine tsx11 lock when actually making X calls, and not while initializing data.
2. Added the ability to detect if we have an XEmbed systray so that we can selectively determine if we need to map tray windows or not. Under the last version, the icons would not be mapped under any circumstances whatsoever. While it would work if we had an XEmbed-compliant tray to dock with, the icon wouldn't show up at all if there wasn't one. Things work both ways now. But, if you look at the patches, you'll notice that the logic in the if statements is a little ugly. Is there a cleaner way to do this?
Thanks, James Liggett
I also forgot to add these other changes: 3. Patched server changes against server/protocol.def as per Juan Lang's advice.
4. With more testing, I found that the XSync call has no effect on the reliability of the docking. As Alexandre says they're a bad idea in this case, I just got rid of that patch.
On Sun, 2006-08-13 at 00:04 -0700, James Liggett wrote:
- Added the ability to detect if we have an XEmbed systray so that we
can selectively determine if we need to map tray windows or not. Under the last version, the icons would not be mapped under any circumstances whatsoever. While it would work if we had an XEmbed-compliant tray to dock with, the icon wouldn't show up at all if there wasn't one. Things work both ways now. But, if you look at the patches, you'll notice that the logic in the if statements is a little ugly. Is there a cleaner way to do this?
+ if ((X11DRV_get_systray_window( display ) == None) || + ((X11DRV_get_systray_window( display ) != None) && + (!(ex_style & WS_EX_TRAYWINDOW))))
This can be simplified:
if ( (X111DRV_get_systray_window( display ) == None) || (!(ex_style & WS_EX_TRAYWINDOW)) )
The reason the two are logically equivalent is that the first condition being false is implied when you're looking on the other side of the or statement, meaning that X11DRV_get_systray_window( display ) MUST not be None if we're even checking ex_style & WS_EX_TRAYWINDOW.
Thanks, Scott Ritchie
On Sun, 2006-08-13 at 13:39 -0700, Scott Ritchie wrote:
The reason the two are logically equivalent is that the first condition being false is implied when you're looking on the other side of the or statement, meaning that X11DRV_get_systray_window( display ) MUST not be None if we're even checking ex_style & WS_EX_TRAYWINDOW.
You're right--why didn't I think of that? (groan...) I really should stop coding past midnight ;-) Thanks a lot Scott!
Sending another update shortly.