Commit 1dc551cf authored by Alexandre Julliard's avatar Alexandre Julliard

Authors: Kai Morich <kai.morich@bigfoot.de>, Marcus Meissner <marcus@jet.franken.de>

Added systray support. Swallow the windows systray icons into kpanel systray if KDE/KWM is running.
parent 9e6b1d14
...@@ -33,7 +33,8 @@ C_SRCS = \ ...@@ -33,7 +33,8 @@ C_SRCS = \
shlfolder.c \ shlfolder.c \
shlview.c \ shlview.c \
shpolicy.c \ shpolicy.c \
shv_bg_cmenu.c shv_bg_cmenu.c \
systray.c
RC_SRCS= \ RC_SRCS= \
shres.rc shres.rc
......
...@@ -657,28 +657,6 @@ BOOL WINAPI ShellAboutW( HWND hWnd, LPCWSTR szApp, LPCWSTR szOtherStuff, ...@@ -657,28 +657,6 @@ BOOL WINAPI ShellAboutW( HWND hWnd, LPCWSTR szApp, LPCWSTR szOtherStuff,
} }
/************************************************************************* /*************************************************************************
* Shell_NotifyIcon [SHELL32.296]
* FIXME
* This function is supposed to deal with the systray.
* Any ideas on how this is to be implimented?
*/
BOOL WINAPI Shell_NotifyIcon( DWORD dwMessage, PNOTIFYICONDATAA pnid )
{ FIXME("Taskbar Notification Area functionality not implemented !\n");
return TRUE; /* pretend success */
}
/*************************************************************************
* Shell_NotifyIcon [SHELL32.297]
* FIXME
* This function is supposed to deal with the systray.
* Any ideas on how this is to be implimented?
*/
BOOL WINAPI Shell_NotifyIconA(DWORD dwMessage, PNOTIFYICONDATAA pnid )
{ FIXME("Taskbar Notification Area functionality not implemented !\n");
return TRUE; /* pretend success */
}
/*************************************************************************
* FreeIconList * FreeIconList
*/ */
void WINAPI FreeIconList( DWORD dw ) void WINAPI FreeIconList( DWORD dw )
......
...@@ -2270,6 +2270,9 @@ DECL_WINELIB_TYPE_AW(LPNONCLIENTMETRICS) ...@@ -2270,6 +2270,9 @@ DECL_WINELIB_TYPE_AW(LPNONCLIENTMETRICS)
#define WS_EX_OVERLAPPEDWINDOW (WS_EX_WINDOWEDGE|WS_EX_CLIENTEDGE) #define WS_EX_OVERLAPPEDWINDOW (WS_EX_WINDOWEDGE|WS_EX_CLIENTEDGE)
#define WS_EX_PALETTEWINDOW (WS_EX_WINDOWEDGE|WS_EX_TOOLWINDOW|WS_EX_TOPMOST) #define WS_EX_PALETTEWINDOW (WS_EX_WINDOWEDGE|WS_EX_TOOLWINDOW|WS_EX_TOPMOST)
/* WINE internal... */
#define WS_EX_TRAYWINDOW 0x80000000L
/* Window scrolling */ /* Window scrolling */
#define SW_SCROLLCHILDREN 0x0001 #define SW_SCROLLCHILDREN 0x0001
#define SW_INVALIDATE 0x0002 #define SW_INVALIDATE 0x0002
......
...@@ -474,6 +474,7 @@ extern void X11DRV_WND_SurfaceCopy(struct tagWND *wndPtr, struct tagDC *dcPtr, I ...@@ -474,6 +474,7 @@ extern void X11DRV_WND_SurfaceCopy(struct tagWND *wndPtr, struct tagDC *dcPtr, I
extern void X11DRV_WND_SetDrawable(struct tagWND *wndPtr, struct tagDC *dc, WORD flags, BOOL bSetClipOrigin); extern void X11DRV_WND_SetDrawable(struct tagWND *wndPtr, struct tagDC *dc, WORD flags, BOOL bSetClipOrigin);
extern BOOL X11DRV_WND_SetHostAttr(struct tagWND *wndPtr, INT haKey, INT value); extern BOOL X11DRV_WND_SetHostAttr(struct tagWND *wndPtr, INT haKey, INT value);
extern BOOL X11DRV_WND_IsSelfClipping(struct tagWND *wndPtr); extern BOOL X11DRV_WND_IsSelfClipping(struct tagWND *wndPtr);
extern void X11DRV_WND_DockWindow(struct tagWND *wndPtr);
extern int X11DRV_EVENT_PrepareShmCompletion( Drawable dw ); extern int X11DRV_EVENT_PrepareShmCompletion( Drawable dw );
extern void X11DRV_EVENT_WaitShmCompletion( int compl ); extern void X11DRV_EVENT_WaitShmCompletion( int compl );
......
...@@ -102,6 +102,8 @@ BOOL WIN_WindowNeedsWMBorder( DWORD style, DWORD exStyle ) ...@@ -102,6 +102,8 @@ BOOL WIN_WindowNeedsWMBorder( DWORD style, DWORD exStyle )
( ((style & WS_CAPTION) == WS_CAPTION) || ( ((style & WS_CAPTION) == WS_CAPTION) ||
(style & WS_THICKFRAME))) (style & WS_THICKFRAME)))
return TRUE; return TRUE;
if (exStyle & WS_EX_TRAYWINDOW)
return TRUE;
return FALSE; return FALSE;
} }
......
...@@ -53,6 +53,8 @@ Atom dndProtocol = None; ...@@ -53,6 +53,8 @@ Atom dndProtocol = None;
Atom dndSelection = None; Atom dndSelection = None;
Atom wmChangeState = None; Atom wmChangeState = None;
Atom kwmDockWindow = None;
/*********************************************************************** /***********************************************************************
* X11DRV_WND_GetXWindow * X11DRV_WND_GetXWindow
* *
...@@ -166,6 +168,8 @@ BOOL X11DRV_WND_CreateDesktopWindow(WND *wndPtr, CLASS *classPtr, BOOL bUnicode) ...@@ -166,6 +168,8 @@ BOOL X11DRV_WND_CreateDesktopWindow(WND *wndPtr, CLASS *classPtr, BOOL bUnicode)
dndSelection = TSXInternAtom( display, "DndSelection" , False ); dndSelection = TSXInternAtom( display, "DndSelection" , False );
if( wmChangeState == None ) if( wmChangeState == None )
wmChangeState = TSXInternAtom (display, "WM_CHANGE_STATE", False); wmChangeState = TSXInternAtom (display, "WM_CHANGE_STATE", False);
if (kwmDockWindow == None)
kwmDockWindow = TSXInternAtom( display, "KWM_DOCKWINDOW", False );
((X11DRV_WND_DATA *) wndPtr->pDriverData)->window = ((X11DRV_WND_DATA *) wndPtr->pDriverData)->window =
X11DRV_WND_GetXRootWindow( wndPtr ); X11DRV_WND_GetXRootWindow( wndPtr );
...@@ -192,17 +196,14 @@ BOOL X11DRV_WND_CreateWindow(WND *wndPtr, CLASS *classPtr, CREATESTRUCTA *cs, BO ...@@ -192,17 +196,14 @@ BOOL X11DRV_WND_CreateWindow(WND *wndPtr, CLASS *classPtr, CREATESTRUCTA *cs, BO
/* Create "managed" windows only if a title bar or resizable */ /* Create "managed" windows only if a title bar or resizable */
/* frame is required. */ /* frame is required. */
if (WIN_WindowNeedsWMBorder(cs->style, cs->dwExStyle)) if (WIN_WindowNeedsWMBorder(cs->style, cs->dwExStyle)) {
{
win_attr.event_mask = ExposureMask | KeyPressMask | win_attr.event_mask = ExposureMask | KeyPressMask |
KeyReleaseMask | PointerMotionMask | KeyReleaseMask | PointerMotionMask |
ButtonPressMask | ButtonReleaseMask | ButtonPressMask | ButtonReleaseMask |
FocusChangeMask | StructureNotifyMask; FocusChangeMask | StructureNotifyMask;
win_attr.override_redirect = FALSE; win_attr.override_redirect = FALSE;
wndPtr->flags |= WIN_MANAGED; wndPtr->flags |= WIN_MANAGED;
} } else {
else
{
win_attr.event_mask = ExposureMask | KeyPressMask | win_attr.event_mask = ExposureMask | KeyPressMask |
KeyReleaseMask | PointerMotionMask | KeyReleaseMask | PointerMotionMask |
ButtonPressMask | ButtonReleaseMask | ButtonPressMask | ButtonReleaseMask |
...@@ -233,6 +234,11 @@ BOOL X11DRV_WND_CreateWindow(WND *wndPtr, CLASS *classPtr, CREATESTRUCTA *cs, BO ...@@ -233,6 +234,11 @@ BOOL X11DRV_WND_CreateWindow(WND *wndPtr, CLASS *classPtr, CREATESTRUCTA *cs, BO
if(!(wGroupLeader = X11DRV_WND_GetXWindow(wndPtr))) if(!(wGroupLeader = X11DRV_WND_GetXWindow(wndPtr)))
return FALSE; return FALSE;
/* If we are the systray, we need to be managed to be noticed by KWM */
if (wndPtr->dwExStyle & WS_EX_TRAYWINDOW)
X11DRV_WND_DockWindow(wndPtr);
if (wndPtr->flags & WIN_MANAGED) if (wndPtr->flags & WIN_MANAGED)
{ {
XClassHint *class_hints = TSXAllocClassHint(); XClassHint *class_hints = TSXAllocClassHint();
...@@ -880,4 +886,25 @@ BOOL X11DRV_WND_IsSelfClipping(WND *wndPtr) ...@@ -880,4 +886,25 @@ BOOL X11DRV_WND_IsSelfClipping(WND *wndPtr)
return X11DRV_WND_GetXWindow(wndPtr) != None; return X11DRV_WND_GetXWindow(wndPtr) != None;
} }
/***********************************************************************
* X11DRV_WND_DockWindow
*
* Set the X Property of the window that tells the windowmanager we really
* want to be in the systray
*
* KDE: set "KWM_DOCKWINDOW", type "KWM_DOCKWINDOW" to 1 before a window is
* mapped.
*
* all others: to be added ;)
*/
void X11DRV_WND_DockWindow(WND *wndPtr)
{
int data = 1;
Window win = X11DRV_WND_GetXWindow(wndPtr);
if (kwmDockWindow == None)
return; /* no KDE running */
TSXChangeProperty(
display,win,kwmDockWindow,kwmDockWindow,32,PropModeReplace,(char*)&data,1
);
}
#endif /* !defined(X_DISPLAY_MISSING) */ #endif /* !defined(X_DISPLAY_MISSING) */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment