Jacek Caban : winex11: Move foreign_window_proc to systray.c.

Alexandre Julliard julliard at winehq.org
Thu May 5 15:56:01 CDT 2022


Module: wine
Branch: master
Commit: 7256519102368ae47ec60c95026b18f79421c008
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=7256519102368ae47ec60c95026b18f79421c008

Author: Jacek Caban <jacek at codeweavers.com>
Date:   Wed May  4 01:24:03 2022 +0200

winex11: Move foreign_window_proc to systray.c.

Signed-off-by: Jacek Caban <jacek at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/winex11.drv/systray.c | 25 ++++++++++++++++++++++++-
 dlls/winex11.drv/window.c  | 23 -----------------------
 dlls/winex11.drv/x11drv.h  |  3 ++-
 3 files changed, 26 insertions(+), 25 deletions(-)

diff --git a/dlls/winex11.drv/systray.c b/dlls/winex11.drv/systray.c
index ae1c5738f8e..1c6616e0d9c 100644
--- a/dlls/winex11.drv/systray.c
+++ b/dlls/winex11.drv/systray.c
@@ -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 );
+}
diff --git a/dlls/winex11.drv/window.c b/dlls/winex11.drv/window.c
index f006150fb7c..7726ba78db0 100644
--- a/dlls/winex11.drv/window.c
+++ b/dlls/winex11.drv/window.c
@@ -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
  *
diff --git a/dlls/winex11.drv/x11drv.h b/dlls/winex11.drv/x11drv.h
index d3db49b86b6..42d9e39b082 100644
--- a/dlls/winex11.drv/x11drv.h
+++ b/dlls/winex11.drv/x11drv.h
@@ -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;




More information about the wine-cvs mailing list