winex11: Move foreign_window_proc to systray.c.

Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Jacek Caban 2022-05-04 01:24:03 +02:00 committed by Alexandre Julliard
parent 21d269f2fc
commit 7256519102
3 changed files with 26 additions and 25 deletions

View File

@ -142,7 +142,7 @@ static void create_tooltip(struct tray_icon *icon)
}
}
void update_systray_balloon_position(void)
static void update_systray_balloon_position(void)
{
RECT rect;
POINT pos;
@ -783,3 +783,26 @@ int CDECL wine_notify_icon( DWORD msg, NOTIFYICONDATAW *data )
}
return ret;
}
/* window procedure for foreign windows */
LRESULT WINAPI foreign_window_proc( HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam )
{
switch(msg)
{
case WM_WINDOWPOSCHANGED:
update_systray_balloon_position();
break;
case WM_PARENTNOTIFY:
if (LOWORD(wparam) == WM_DESTROY)
{
TRACE( "%p: got parent notify destroy for win %lx\n", hwnd, lparam );
PostMessageW( hwnd, WM_CLOSE, 0, 0 ); /* so that we come back here once the child is gone */
}
return 0;
case WM_CLOSE:
if (GetWindow( hwnd, GW_CHILD )) return 0; /* refuse to die if we still have children */
break;
}
return DefWindowProcW( hwnd, msg, wparam, lparam );
}

View File

@ -1987,29 +1987,6 @@ static struct x11drv_win_data *X11DRV_create_win_data( HWND hwnd, const RECT *wi
}
/* window procedure for foreign windows */
static LRESULT WINAPI foreign_window_proc( HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam )
{
switch(msg)
{
case WM_WINDOWPOSCHANGED:
update_systray_balloon_position();
break;
case WM_PARENTNOTIFY:
if (LOWORD(wparam) == WM_DESTROY)
{
TRACE( "%p: got parent notify destroy for win %lx\n", hwnd, lparam );
NtUserPostMessage( hwnd, WM_CLOSE, 0, 0 ); /* so that we come back here once the child is gone */
}
return 0;
case WM_CLOSE:
if (NtUserGetWindowRelative( hwnd, GW_CHILD )) return 0; /* refuse to die if we still have children */
break;
}
return DefWindowProcW( hwnd, msg, wparam, lparam );
}
/***********************************************************************
* create_foreign_window
*

View File

@ -642,7 +642,6 @@ extern Window create_dummy_client_window(void) DECLSPEC_HIDDEN;
extern Window create_client_window( HWND hwnd, const XVisualInfo *visual ) DECLSPEC_HIDDEN;
extern void set_window_visual( struct x11drv_win_data *data, const XVisualInfo *vis, BOOL use_alpha ) DECLSPEC_HIDDEN;
extern void change_systray_owner( Display *display, Window systray_window ) DECLSPEC_HIDDEN;
extern void update_systray_balloon_position(void) DECLSPEC_HIDDEN;
extern HWND create_foreign_window( Display *display, Window window ) DECLSPEC_HIDDEN;
extern BOOL update_clipboard( HWND hwnd ) DECLSPEC_HIDDEN;
extern void init_win_context(void) DECLSPEC_HIDDEN;
@ -853,6 +852,8 @@ extern NTSTATUS x11drv_ime_set_cursor_pos( UINT pos ) DECLSPEC_HIDDEN;
extern NTSTATUS x11drv_ime_set_open_status( UINT open ) DECLSPEC_HIDDEN;
extern NTSTATUS x11drv_ime_update_association( UINT arg ) DECLSPEC_HIDDEN;
extern LRESULT WINAPI foreign_window_proc( HWND hwnd, UINT msg, WPARAM wparam,
LPARAM lparam ) DECLSPEC_HIDDEN;
extern NTSTATUS x11drv_client_func( enum x11drv_client_funcs func, const void *params,
ULONG size ) DECLSPEC_HIDDEN;