Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
wine
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Package registry
Container Registry
Model registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Alexey Alyaev
wine
Commits
6af0df45
Commit
6af0df45
authored
21 years ago
by
Ulrich Czekalla
Committed by
Alexandre Julliard
21 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Add option to use the primary selection in addition to the clipboard
selection.
parent
3f5fada7
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
dlls/x11drv/clipboard.c
+12
-6
12 additions, 6 deletions
dlls/x11drv/clipboard.c
documentation/samples/config
+1
-0
1 addition, 0 deletions
documentation/samples/config
with
13 additions
and
6 deletions
dlls/x11drv/clipboard.c
+
12
−
6
View file @
6af0df45
...
...
@@ -110,6 +110,7 @@ typedef struct
static
int
selectionAcquired
=
0
;
/* Contains the current selection masks */
static
Window
selectionWindow
=
None
;
/* The top level X window which owns the selection */
static
BOOL
clearAllSelections
=
FALSE
;
/* Always lose all selections */
static
BOOL
usePrimary
=
FALSE
;
/* Use primary selection in additon to the clipboard selection */
static
Atom
selectionCacheSrc
=
XA_PRIMARY
;
/* The selection source from which the clipboard cache was filled */
static
Window
PrimarySelectionOwner
=
None
;
/* The window which owns the primary selection */
static
Window
ClipboardSelectionOwner
=
None
;
/* The window which owns the clipboard selection */
...
...
@@ -259,6 +260,8 @@ static UINT ClipDataCount = 0;
*/
static
UINT
wSeqNo
=
0
;
#define IS_OPTION_TRUE(ch) ((ch) == 'y' || (ch) == 'Y' || (ch) == 't' || (ch) == 'T' || (ch) == '1')
/**************************************************************************
* Internal Clipboard implementation methods
**************************************************************************/
...
...
@@ -276,7 +279,10 @@ void X11DRV_InitClipboard(void)
char
buffer
[
20
];
DWORD
type
,
count
=
sizeof
(
buffer
);
if
(
!
RegQueryValueExA
(
hkey
,
"ClearAllSelections"
,
0
,
&
type
,
buffer
,
&
count
))
clearAllSelections
=
atoi
(
buffer
);
clearAllSelections
=
IS_OPTION_TRUE
(
buffer
[
0
]
);
count
=
sizeof
(
buffer
);
if
(
!
RegQueryValueExA
(
hkey
,
"UsePrimary"
,
0
,
&
type
,
buffer
,
&
count
))
usePrimary
=
IS_OPTION_TRUE
(
buffer
[
0
]
);
RegCloseKey
(
hkey
);
}
...
...
@@ -1083,7 +1089,7 @@ HANDLE X11DRV_CLIPBOARD_ImportClipboardData(LPBYTE lpdata, UINT cBytes)
/**************************************************************************
*
X11DRV_CLIPBOARD_ExportClipboardData
X11DRV_CLIPBOARD_ExportClipboardData
*
* Generic export clipboard data routine.
*/
...
...
@@ -1397,11 +1403,11 @@ static int X11DRV_CLIPBOARD_QueryAvailableData(LPCLIPBOARDINFO lpcbinfo)
* Query the selection owner for the TARGETS property
*/
wine_tsx11_lock
();
if
(
XGetSelectionOwner
(
display
,
XA_PRIMARY
)
||
if
(
(
usePrimary
&&
XGetSelectionOwner
(
display
,
XA_PRIMARY
)
)
||
XGetSelectionOwner
(
display
,
x11drv_atom
(
CLIPBOARD
)))
{
wine_tsx11_unlock
();
if
(
X11DRV_CLIPBOARD_QueryTargets
(
display
,
w
,
XA_PRIMARY
,
&
xe
))
if
(
usePrimary
&&
(
X11DRV_CLIPBOARD_QueryTargets
(
display
,
w
,
XA_PRIMARY
,
&
xe
))
)
selectionCacheSrc
=
XA_PRIMARY
;
else
if
(
X11DRV_CLIPBOARD_QueryTargets
(
display
,
w
,
x11drv_atom
(
CLIPBOARD
),
&
xe
))
selectionCacheSrc
=
x11drv_atom
(
CLIPBOARD
);
...
...
@@ -1974,14 +1980,14 @@ void X11DRV_AcquireClipboard(HWND hWndClipWindow)
wine_tsx11_lock
();
/* Grab PRIMARY selection if not owned */
if
(
!
(
selectionAcquired
&
S_PRIMARY
))
if
(
usePrimary
&&
!
(
selectionAcquired
&
S_PRIMARY
))
XSetSelectionOwner
(
display
,
XA_PRIMARY
,
owner
,
CurrentTime
);
/* Grab CLIPBOARD selection if not owned */
if
(
!
(
selectionAcquired
&
S_CLIPBOARD
))
XSetSelectionOwner
(
display
,
x11drv_atom
(
CLIPBOARD
),
owner
,
CurrentTime
);
if
(
XGetSelectionOwner
(
display
,
XA_PRIMARY
)
==
owner
)
if
(
usePrimary
&&
XGetSelectionOwner
(
display
,
XA_PRIMARY
)
==
owner
)
selectionAcquired
|=
S_PRIMARY
;
if
(
XGetSelectionOwner
(
display
,
x11drv_atom
(
CLIPBOARD
))
==
owner
)
...
...
This diff is collapsed.
Click to expand it.
documentation/samples/config
+
1
−
0
View file @
6af0df45
...
...
@@ -236,6 +236,7 @@ WINE REGISTRY Version 2
[Clipboard]
"ClearAllSelections" = "0"
"PersistentSelection" = "1"
"UsePrimary" = "0"
; List of all directories directly contain .AFM files
[afmdirs]
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment