Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
G
glfw
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
pirvi-public
glfw
Commits
e5d890a1
Commit
e5d890a1
authored
10 years ago
by
Camilla Löwy
Browse files
Options
Downloads
Patches
Plain Diff
Made clipboard string member name consistent.
parent
44c899ce
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/x11_clipboard.c
+15
-15
15 additions, 15 deletions
src/x11_clipboard.c
src/x11_init.c
+1
-1
1 addition, 1 deletion
src/x11_init.c
src/x11_platform.h
+2
-4
2 additions, 4 deletions
src/x11_platform.h
with
18 additions
and
20 deletions
src/x11_clipboard.c
+
15
−
15
View file @
e5d890a1
...
...
@@ -110,8 +110,8 @@ static Atom writeTargetToProperty(const XSelectionRequestEvent* request)
targets
[
i
],
8
,
PropModeReplace
,
(
unsigned
char
*
)
_glfw
.
x11
.
selection
.
s
tring
,
strlen
(
_glfw
.
x11
.
selection
.
s
tring
));
(
unsigned
char
*
)
_glfw
.
x11
.
clipboardS
tring
,
strlen
(
_glfw
.
x11
.
clipboardS
tring
));
}
else
targets
[
i
+
1
]
=
None
;
...
...
@@ -162,8 +162,8 @@ static Atom writeTargetToProperty(const XSelectionRequestEvent* request)
request
->
target
,
8
,
PropModeReplace
,
(
unsigned
char
*
)
_glfw
.
x11
.
selection
.
s
tring
,
strlen
(
_glfw
.
x11
.
selection
.
s
tring
));
(
unsigned
char
*
)
_glfw
.
x11
.
clipboardS
tring
,
strlen
(
_glfw
.
x11
.
clipboardS
tring
));
return
request
->
property
;
}
...
...
@@ -181,8 +181,8 @@ static Atom writeTargetToProperty(const XSelectionRequestEvent* request)
void
_glfwHandleSelectionClear
(
XEvent
*
event
)
{
free
(
_glfw
.
x11
.
selection
.
s
tring
);
_glfw
.
x11
.
selection
.
s
tring
=
NULL
;
free
(
_glfw
.
x11
.
clipboardS
tring
);
_glfw
.
x11
.
clipboardS
tring
=
NULL
;
}
void
_glfwHandleSelectionRequest
(
XEvent
*
event
)
...
...
@@ -253,8 +253,8 @@ void _glfwPushSelectionToManager(_GLFWwindow* window)
void
_glfwPlatformSetClipboardString
(
_GLFWwindow
*
window
,
const
char
*
string
)
{
free
(
_glfw
.
x11
.
selection
.
s
tring
);
_glfw
.
x11
.
selection
.
s
tring
=
strdup
(
string
);
free
(
_glfw
.
x11
.
clipboardS
tring
);
_glfw
.
x11
.
clipboardS
tring
=
strdup
(
string
);
XSetSelectionOwner
(
_glfw
.
x11
.
display
,
_glfw
.
x11
.
CLIPBOARD
,
...
...
@@ -281,11 +281,11 @@ const char* _glfwPlatformGetClipboardString(_GLFWwindow* window)
{
// Instead of doing a large number of X round-trips just to put this
// string into a window property and then read it back, just return it
return
_glfw
.
x11
.
selection
.
s
tring
;
return
_glfw
.
x11
.
clipboardS
tring
;
}
free
(
_glfw
.
x11
.
selection
.
s
tring
);
_glfw
.
x11
.
selection
.
s
tring
=
NULL
;
free
(
_glfw
.
x11
.
clipboardS
tring
);
_glfw
.
x11
.
clipboardS
tring
=
NULL
;
for
(
i
=
0
;
i
<
formatCount
;
i
++
)
{
...
...
@@ -311,7 +311,7 @@ const char* _glfwPlatformGetClipboardString(_GLFWwindow* window)
event
.
xselection
.
target
,
(
unsigned
char
**
)
&
data
))
{
_glfw
.
x11
.
selection
.
s
tring
=
strdup
(
data
);
_glfw
.
x11
.
clipboardS
tring
=
strdup
(
data
);
}
XFree
(
data
);
...
...
@@ -320,16 +320,16 @@ const char* _glfwPlatformGetClipboardString(_GLFWwindow* window)
event
.
xselection
.
requestor
,
event
.
xselection
.
property
);
if
(
_glfw
.
x11
.
selection
.
s
tring
)
if
(
_glfw
.
x11
.
clipboardS
tring
)
break
;
}
if
(
_glfw
.
x11
.
selection
.
s
tring
==
NULL
)
if
(
_glfw
.
x11
.
clipboardS
tring
==
NULL
)
{
_glfwInputError
(
GLFW_FORMAT_UNAVAILABLE
,
"X11: Failed to convert selection to string"
);
}
return
_glfw
.
x11
.
selection
.
s
tring
;
return
_glfw
.
x11
.
clipboardS
tring
;
}
This diff is collapsed.
Click to expand it.
src/x11_init.c
+
1
−
1
View file @
e5d890a1
...
...
@@ -730,7 +730,7 @@ void _glfwPlatformTerminate(void)
_glfw
.
x11
.
cursor
=
(
Cursor
)
0
;
}
free
(
_glfw
.
x11
.
selection
.
s
tring
);
free
(
_glfw
.
x11
.
clipboardS
tring
);
_glfwTerminateJoysticks
();
_glfwTerminateContextAPI
();
...
...
This diff is collapsed.
Click to expand it.
src/x11_platform.h
+
2
−
4
View file @
e5d890a1
...
...
@@ -114,6 +114,8 @@ typedef struct _GLFWlibraryX11
Cursor
cursor
;
XContext
context
;
char
*
clipboardString
;
// Window manager atoms
Atom
WM_PROTOCOLS
;
Atom
WM_STATE
;
...
...
@@ -206,10 +208,6 @@ typedef struct _GLFWlibraryX11
int
exposure
;
}
saver
;
struct
{
char
*
string
;
}
selection
;
struct
{
Window
source
;
}
xdnd
;
...
...
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