Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
libSDL
Project
Project
Details
Activity
Releases
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
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
PocketInsanity
libSDL
Commits
18f003c1
Commit
18f003c1
authored
Jul 12, 2010
by
Sam Lantinga
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Made it possible to switch the text format in one place
parent
2e99ef1d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
7 deletions
+11
-7
SDL_x11clipboard.c
src/video/x11/SDL_x11clipboard.c
+11
-7
No files found.
src/video/x11/SDL_x11clipboard.c
View file @
18f003c1
...
...
@@ -27,6 +27,13 @@
#include "SDL_x11video.h"
/* If you don't support UTF-8, you might use XA_STRING here */
#if 1
#define TEXT_FORMAT XInternAtom(display, "UTF8_STRING", False)
#else
#define TEXT_FORMAT XA_STRING
#endif
/* Get any application owned window handle for clipboard association */
static
Window
GetWindow
(
_THIS
)
...
...
@@ -58,8 +65,8 @@ X11_SetClipboardText(_THIS, const char *text)
return
-
1
;
}
/*
If you don't support UTF-8, you might use XA_STRING here
*/
format
=
XInternAtom
(
display
,
"UTF8_STRING"
,
False
)
;
/*
Save the selection on the root window
*/
format
=
TEXT_FORMAT
;
XChangeProperty
(
display
,
DefaultRootWindow
(
display
),
XA_CUT_BUFFER0
,
format
,
8
,
PropModeReplace
,
(
const
unsigned
char
*
)
text
,
SDL_strlen
(
text
));
...
...
@@ -88,12 +95,9 @@ X11_GetClipboardText(_THIS)
text
=
NULL
;
/* Get the
SDL window that will own
the selection */
/* Get the
window that holds
the selection */
window
=
GetWindow
(
_this
);
/* If you don't support UTF-8, you might use XA_STRING here */
format
=
XInternAtom
(
display
,
"UTF8_STRING"
,
False
);
format
=
TEXT_FORMAT
;
owner
=
XGetSelectionOwner
(
display
,
XA_PRIMARY
);
if
((
owner
==
None
)
||
(
owner
==
window
))
{
owner
=
DefaultRootWindow
(
display
);
...
...
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