Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
I
Irrlicht New
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
MyCard
Irrlicht New
Commits
61c1d515
Commit
61c1d515
authored
Dec 10, 2021
by
mercury233
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix linux copy
parent
1e05248e
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
9 deletions
+21
-9
source/Irrlicht/CIrrDeviceLinux.cpp
source/Irrlicht/CIrrDeviceLinux.cpp
+13
-7
source/Irrlicht/COSOperator.cpp
source/Irrlicht/COSOperator.cpp
+8
-2
No files found.
source/Irrlicht/CIrrDeviceLinux.cpp
View file @
61c1d515
...
@@ -1107,11 +1107,14 @@ bool CIrrDeviceLinux::run()
...
@@ -1107,11 +1107,14 @@ bool CIrrDeviceLinux::run()
{
{
XEvent
respond
;
XEvent
respond
;
XSelectionRequestEvent
*
req
=
&
(
event
.
xselectionrequest
);
XSelectionRequestEvent
*
req
=
&
(
event
.
xselectionrequest
);
if
(
req
->
target
==
XA_STRING
)
if
(
req
->
target
==
XA_STRING
||
req
->
target
==
X_ATOM_TEXT
||
req
->
target
==
X_ATOM_UTF8_STRING
)
{
{
XChangeProperty
(
display
,
XChangeProperty
(
display
,
req
->
requestor
,
req
->
requestor
,
req
->
property
,
req
->
target
,
req
->
property
,
req
->
target
==
X_ATOM_TEXT
?
XA_STRING
:
req
->
target
,
8
,
// format
8
,
// format
PropModeReplace
,
PropModeReplace
,
(
unsigned
char
*
)
Clipboard
.
c_str
(),
(
unsigned
char
*
)
Clipboard
.
c_str
(),
...
@@ -1125,11 +1128,14 @@ bool CIrrDeviceLinux::run()
...
@@ -1125,11 +1128,14 @@ bool CIrrDeviceLinux::run()
data
[
0
]
=
X_ATOM_TEXT
;
data
[
0
]
=
X_ATOM_TEXT
;
data
[
1
]
=
XA_STRING
;
data
[
1
]
=
XA_STRING
;
XChangeProperty
(
display
,
req
->
requestor
,
XChangeProperty
(
display
,
req
->
property
,
req
->
target
,
req
->
requestor
,
8
,
PropModeReplace
,
req
->
property
,
(
unsigned
char
*
)
&
data
,
XA_ATOM
,
sizeof
(
data
));
32
,
// format
PropModeReplace
,
(
unsigned
char
*
)
&
X_ATOM_UTF8_STRING
,
1
);
respond
.
xselection
.
property
=
req
->
property
;
respond
.
xselection
.
property
=
req
->
property
;
}
}
else
else
...
...
source/Irrlicht/COSOperator.cpp
View file @
61c1d515
...
@@ -89,9 +89,15 @@ void COSOperator::copyToClipboard(const c16* text) const
...
@@ -89,9 +89,15 @@ void COSOperator::copyToClipboard(const c16* text) const
#elif defined(_IRR_COMPILE_WITH_X11_DEVICE_)
#elif defined(_IRR_COMPILE_WITH_X11_DEVICE_)
if
(
IrrDeviceLinux
)
if
(
IrrDeviceLinux
)
{
{
char
ctext
[
len
*
2
+
1
];
size_t
wlen
=
sizeof
(
wchar_t
)
*
(
len
+
1
);
size_t
lenNew
=
wcstombs
(
ctext
,
text
,
len
*
2
);
char
ctext
[
wlen
];
char
*
oldLocale
=
setlocale
(
LC_CTYPE
,
NULL
);
setlocale
(
LC_CTYPE
,
""
);
size_t
lenNew
=
wcstombs
(
ctext
,
text
,
wlen
);
ctext
[
lenNew
]
=
0
;
ctext
[
lenNew
]
=
0
;
setlocale
(
LC_CTYPE
,
oldLocale
);
IrrDeviceLinux
->
copyToClipboard
(
ctext
);
IrrDeviceLinux
->
copyToClipboard
(
ctext
);
}
}
#else
#else
...
...
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