Attached is the fourth update to my XEmbed system tray patches. For this version I made some fairly major changes:
1. Did away with the low-level checks for systrays, and instead had the systray icon windows created off-screen so they aren't mapped, as per Alexandre's suggestion.
2. systray_dock_window will put the icon windows back on the screen if there isn't an XEmbed tray to dock with.
3. Eliminated the WS_EX_TRAYWINDOW style hack, and moved the call to systray_dock_window to X11DRV_CreateWindow. I used the window class name to see if it was a tray window being created or not.
4. Consolidated all patches into one, as the individual patches weren't really individual changes. (Thanks to Mike McCormack for this advice.)
As usual, comments/suggestions appreciated.
Thanks again, James Liggett
On Wed, 2006-08-16 at 17:21 -0700, James Liggett wrote:
inline static BOOL is_window_managed( HWND hwnd ) { DWORD style, ex_style;
- WCHAR classname[80];
- ex_style = GetWindowLongW( hwnd, GWL_EXSTYLE );
- GetClassNameW( hwnd, classname, 80 );
- if (!managed_mode) return FALSE; /* tray window is always managed */
- ex_style = GetWindowLongW( hwnd, GWL_EXSTYLE );
- if (ex_style & WS_EX_TRAYWINDOW) return TRUE;
- if (strcmpW( classname, adaptor_classname ) == 0)
/* child windows are not managed */ style = GetWindowLongW( hwnd, GWL_STYLE ); if (style & WS_CHILD) return FALSE;return TRUE;
You can move the ex_style and classname populating calls to right before their usage, so that they are called only when needed.