Commit 070a82e7 authored by Alexandre Julliard's avatar Alexandre Julliard

user32: Merge the AcquireClipboard and EmptyClipboard driver entry points.

parent b7c340de
......@@ -295,10 +295,6 @@ BOOL WINAPI EmptyClipboard(void)
* WM_DESTROYCLIPBOARD itself. */
CLIPBOARD_SetClipboardOwner(cbinfo.hWndOpen);
/* Acquire the selection. This will notify the previous owner
* to clear its cache. */
USER_Driver->pAcquireClipboard(cbinfo.hWndOpen);
USER_Driver->pEmptyClipboard();
bCBHasChanged = TRUE;
......
......@@ -120,7 +120,6 @@ static const USER_DRIVER *load_driver(void)
GET_USER_FUNC(GetCursorPos);
GET_USER_FUNC(SetCursorPos);
GET_USER_FUNC(ClipCursor);
GET_USER_FUNC(AcquireClipboard);
GET_USER_FUNC(EmptyClipboard);
GET_USER_FUNC(SetClipboardData);
GET_USER_FUNC(GetClipboardData);
......@@ -334,11 +333,6 @@ static BOOL CDECL nulldrv_ClipCursor( LPCRECT clip )
return FALSE;
}
static INT CDECL nulldrv_AcquireClipboard( HWND hwnd )
{
return 0;
}
static BOOL CDECL nulldrv_CountClipboardFormats(void)
{
return 0;
......@@ -536,7 +530,6 @@ static USER_DRIVER null_driver =
nulldrv_SetCursorPos,
nulldrv_ClipCursor,
/* clipboard functions */
nulldrv_AcquireClipboard,
nulldrv_CountClipboardFormats,
nulldrv_EmptyClipboard,
nulldrv_EndClipboardUpdate,
......@@ -674,11 +667,6 @@ static BOOL CDECL loaderdrv_ClipCursor( LPCRECT clip )
return load_driver()->pClipCursor( clip );
}
static INT CDECL loaderdrv_AcquireClipboard( HWND hwnd )
{
return load_driver()->pAcquireClipboard( hwnd );
}
static BOOL CDECL loaderdrv_CountClipboardFormats(void)
{
return load_driver()->pCountClipboardFormats();
......@@ -791,7 +779,6 @@ static USER_DRIVER lazy_load_driver =
loaderdrv_SetCursorPos,
loaderdrv_ClipCursor,
/* clipboard functions */
loaderdrv_AcquireClipboard,
loaderdrv_CountClipboardFormats,
loaderdrv_EmptyClipboard,
loaderdrv_EndClipboardUpdate,
......
......@@ -80,7 +80,6 @@ typedef struct tagUSER_DRIVER {
BOOL (CDECL *pSetCursorPos)(INT,INT);
BOOL (CDECL *pClipCursor)(LPCRECT);
/* clipboard functions */
INT (CDECL *pAcquireClipboard)(HWND); /* Acquire selection */
BOOL (CDECL *pCountClipboardFormats)(void); /* Count available clipboard formats */
void (CDECL *pEmptyClipboard)(void); /* Empty clipboard data */
void (CDECL *pEndClipboardUpdate)(void); /* End clipboard update */
......
......@@ -1880,17 +1880,6 @@ static void check_clipboard_ownership(HWND *owner)
/**************************************************************************
* AcquireClipboard (MACDRV.@)
*/
int CDECL macdrv_AcquireClipboard(HWND hwnd)
{
TRACE("hwnd %p\n", hwnd);
check_clipboard_ownership(NULL);
return 0;
}
/**************************************************************************
* CountClipboardFormats (MACDRV.@)
*/
INT CDECL macdrv_CountClipboardFormats(void)
......@@ -1955,6 +1944,7 @@ INT CDECL macdrv_CountClipboardFormats(void)
void CDECL macdrv_EmptyClipboard(void)
{
TRACE("()\n");
check_clipboard_ownership(NULL);
macdrv_clear_pasteboard();
}
......
......@@ -4,7 +4,6 @@
# USER driver
@ cdecl AcquireClipboard(long) macdrv_AcquireClipboard
@ cdecl ActivateKeyboardLayout(long long) macdrv_ActivateKeyboardLayout
@ cdecl Beep() macdrv_Beep
@ cdecl ChangeDisplaySettingsEx(ptr ptr long long long) macdrv_ChangeDisplaySettingsEx
......
......@@ -2924,9 +2924,9 @@ static DWORD WINAPI selection_thread_proc(LPVOID p)
}
/**************************************************************************
* AcquireClipboard (X11DRV.@)
* X11DRV_AcquireClipboard
*/
int CDECL X11DRV_AcquireClipboard(HWND hWndClipWindow)
void X11DRV_AcquireClipboard(HWND hWndClipWindow)
{
DWORD procid;
HANDLE selectionThread;
......@@ -2953,7 +2953,8 @@ int CDECL X11DRV_AcquireClipboard(HWND hWndClipWindow)
GetCurrentThreadId(),
GetWindowThreadProcessId(hWndClipWindow, NULL), hWndClipWindow);
return SendMessageW(hWndClipWindow, WM_X11DRV_ACQUIRE_SELECTION, 0, 0);
SendMessageW(hWndClipWindow, WM_X11DRV_ACQUIRE_SELECTION, 0, 0);
return;
}
}
......@@ -2966,19 +2967,13 @@ int CDECL X11DRV_AcquireClipboard(HWND hWndClipWindow)
HANDLE event = CreateEventW(NULL, FALSE, FALSE, NULL);
selectionThread = CreateThread(NULL, 0, selection_thread_proc, event, 0, NULL);
if (!selectionThread)
if (selectionThread)
{
WARN("Could not start clipboard thread\n");
CloseHandle(event);
return 0;
WaitForSingleObject(event, INFINITE);
CloseHandle(selectionThread);
}
WaitForSingleObject(event, INFINITE);
CloseHandle(event);
CloseHandle(selectionThread);
}
return 1;
}
......@@ -3005,6 +3000,7 @@ static void empty_clipboard(BOOL keepunowned)
*/
void CDECL X11DRV_EmptyClipboard(void)
{
X11DRV_AcquireClipboard( GetOpenClipboardWindow() );
empty_clipboard( FALSE );
}
......
......@@ -2593,7 +2593,8 @@ LRESULT CDECL X11DRV_WindowMessage( HWND hwnd, UINT msg, WPARAM wp, LPARAM lp )
switch(msg)
{
case WM_X11DRV_ACQUIRE_SELECTION:
return X11DRV_AcquireClipboard( hwnd );
X11DRV_AcquireClipboard( hwnd );
return 0;
case WM_X11DRV_SET_WIN_REGION:
if ((data = get_win_data( hwnd )))
{
......
......@@ -23,7 +23,6 @@
@ cdecl EnumDisplayMonitors(long ptr ptr long) X11DRV_EnumDisplayMonitors
@ cdecl EnumDisplaySettingsEx(ptr long ptr long) X11DRV_EnumDisplaySettingsEx
@ cdecl GetMonitorInfo(long ptr) X11DRV_GetMonitorInfo
@ cdecl AcquireClipboard(long) X11DRV_AcquireClipboard
@ cdecl CountClipboardFormats() X11DRV_CountClipboardFormats
@ cdecl CreateDesktopWindow(long) X11DRV_CreateDesktopWindow
@ cdecl CreateWindow(long) X11DRV_CreateWindow
......
......@@ -600,7 +600,7 @@ extern XContext win_data_context DECLSPEC_HIDDEN;
extern XContext cursor_context DECLSPEC_HIDDEN;
extern void X11DRV_InitClipboard(void) DECLSPEC_HIDDEN;
extern int CDECL X11DRV_AcquireClipboard(HWND hWndClipWindow) DECLSPEC_HIDDEN;
extern void X11DRV_AcquireClipboard(HWND hWndClipWindow) DECLSPEC_HIDDEN;
extern void X11DRV_ResetSelectionOwner(void) DECLSPEC_HIDDEN;
extern void CDECL X11DRV_SetFocus( HWND hwnd ) DECLSPEC_HIDDEN;
extern void set_window_cursor( Window window, HCURSOR handle ) DECLSPEC_HIDDEN;
......
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