Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
f1c131ba
Commit
f1c131ba
authored
Jul 10, 2009
by
Yuri Khan
Committed by
Alexandre Julliard
Jul 13, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winex11.drv: Handle clipboard on an auxiliary thread for windowless apps.
parent
f27d88e1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
60 additions
and
27 deletions
+60
-27
clipboard.c
dlls/winex11.drv/clipboard.c
+60
-27
No files found.
dlls/winex11.drv/clipboard.c
View file @
f1c131ba
...
...
@@ -2504,6 +2504,52 @@ INT CDECL X11DRV_GetClipboardFormatName(UINT wFormat, LPWSTR retStr, INT maxlen)
return
strlenW
(
retStr
);
}
static
void
selection_acquire
(
void
)
{
Window
owner
;
Display
*
display
;
owner
=
thread_selection_wnd
();
display
=
thread_display
();
wine_tsx11_lock
();
selectionAcquired
=
0
;
selectionWindow
=
0
;
/* Grab PRIMARY selection if not owned */
if
(
use_primary_selection
)
XSetSelectionOwner
(
display
,
XA_PRIMARY
,
owner
,
CurrentTime
);
/* Grab CLIPBOARD selection if not owned */
XSetSelectionOwner
(
display
,
x11drv_atom
(
CLIPBOARD
),
owner
,
CurrentTime
);
if
(
use_primary_selection
&&
XGetSelectionOwner
(
display
,
XA_PRIMARY
)
==
owner
)
selectionAcquired
|=
S_PRIMARY
;
if
(
XGetSelectionOwner
(
display
,
x11drv_atom
(
CLIPBOARD
))
==
owner
)
selectionAcquired
|=
S_CLIPBOARD
;
wine_tsx11_unlock
();
if
(
selectionAcquired
)
{
selectionWindow
=
owner
;
TRACE
(
"Grabbed X selection, owner=(%08x)
\n
"
,
(
unsigned
)
owner
);
}
}
static
DWORD
WINAPI
selection_thread_proc
(
LPVOID
unused
)
{
selection_acquire
();
while
(
selectionAcquired
)
{
MsgWaitForMultipleObjectsEx
(
0
,
NULL
,
INFINITE
,
QS_SENDMESSAGE
,
0
);
}
return
0
;
}
/**************************************************************************
* AcquireClipboard (X11DRV.@)
...
...
@@ -2511,8 +2557,7 @@ INT CDECL X11DRV_GetClipboardFormatName(UINT wFormat, LPWSTR retStr, INT maxlen)
int
CDECL
X11DRV_AcquireClipboard
(
HWND
hWndClipWindow
)
{
DWORD
procid
;
Window
owner
;
Display
*
display
;
HANDLE
selectionThread
;
TRACE
(
" %p
\n
"
,
hWndClipWindow
);
...
...
@@ -2540,33 +2585,21 @@ int CDECL X11DRV_AcquireClipboard(HWND hWndClipWindow)
}
}
owner
=
thread_selection_wnd
();
display
=
thread_display
();
wine_tsx11_lock
();
selectionAcquired
=
0
;
selectionWindow
=
0
;
/* Grab PRIMARY selection if not owned */
if
(
use_primary_selection
)
XSetSelectionOwner
(
display
,
XA_PRIMARY
,
owner
,
CurrentTime
);
/* Grab CLIPBOARD selection if not owned */
XSetSelectionOwner
(
display
,
x11drv_atom
(
CLIPBOARD
),
owner
,
CurrentTime
);
if
(
use_primary_selection
&&
XGetSelectionOwner
(
display
,
XA_PRIMARY
)
==
owner
)
selectionAcquired
|=
S_PRIMARY
;
if
(
XGetSelectionOwner
(
display
,
x11drv_atom
(
CLIPBOARD
))
==
owner
)
selectionAcquired
|=
S_CLIPBOARD
;
if
(
hWndClipWindow
)
{
selection_acquire
();
}
else
{
selectionThread
=
CreateThread
(
NULL
,
0
,
&
selection_thread_proc
,
NULL
,
0
,
NULL
);
wine_tsx11_unlock
();
if
(
!
selectionThread
)
{
WARN
(
"Could not start clipboard thread
\n
"
);
return
0
;
}
if
(
selectionAcquired
)
{
selectionWindow
=
owner
;
TRACE
(
"Grabbed X selection, owner=(%08x)
\n
"
,
(
unsigned
)
owner
);
CloseHandle
(
selectionThread
);
}
return
1
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment