1
0
Fork 0
mirror of https://github.com/gwm17/glfw.git synced 2024-10-08 07:07:25 -04:00

Made clipboard string member name consistent.

This commit is contained in:
Camilla Berglund 2014-08-21 21:14:29 +02:00
parent 44c899ce70
commit e5d890a1aa
3 changed files with 18 additions and 20 deletions

View File

@ -110,8 +110,8 @@ static Atom writeTargetToProperty(const XSelectionRequestEvent* request)
targets[i],
8,
PropModeReplace,
(unsigned char*) _glfw.x11.selection.string,
strlen(_glfw.x11.selection.string));
(unsigned char*) _glfw.x11.clipboardString,
strlen(_glfw.x11.clipboardString));
}
else
targets[i + 1] = None;
@ -162,8 +162,8 @@ static Atom writeTargetToProperty(const XSelectionRequestEvent* request)
request->target,
8,
PropModeReplace,
(unsigned char*) _glfw.x11.selection.string,
strlen(_glfw.x11.selection.string));
(unsigned char*) _glfw.x11.clipboardString,
strlen(_glfw.x11.clipboardString));
return request->property;
}
@ -181,8 +181,8 @@ static Atom writeTargetToProperty(const XSelectionRequestEvent* request)
void _glfwHandleSelectionClear(XEvent* event)
{
free(_glfw.x11.selection.string);
_glfw.x11.selection.string = NULL;
free(_glfw.x11.clipboardString);
_glfw.x11.clipboardString = NULL;
}
void _glfwHandleSelectionRequest(XEvent* event)
@ -253,8 +253,8 @@ void _glfwPushSelectionToManager(_GLFWwindow* window)
void _glfwPlatformSetClipboardString(_GLFWwindow* window, const char* string)
{
free(_glfw.x11.selection.string);
_glfw.x11.selection.string = strdup(string);
free(_glfw.x11.clipboardString);
_glfw.x11.clipboardString = 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.string;
return _glfw.x11.clipboardString;
}
free(_glfw.x11.selection.string);
_glfw.x11.selection.string = NULL;
free(_glfw.x11.clipboardString);
_glfw.x11.clipboardString = 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.string = strdup(data);
_glfw.x11.clipboardString = strdup(data);
}
XFree(data);
@ -320,16 +320,16 @@ const char* _glfwPlatformGetClipboardString(_GLFWwindow* window)
event.xselection.requestor,
event.xselection.property);
if (_glfw.x11.selection.string)
if (_glfw.x11.clipboardString)
break;
}
if (_glfw.x11.selection.string == NULL)
if (_glfw.x11.clipboardString == NULL)
{
_glfwInputError(GLFW_FORMAT_UNAVAILABLE,
"X11: Failed to convert selection to string");
}
return _glfw.x11.selection.string;
return _glfw.x11.clipboardString;
}

View File

@ -730,7 +730,7 @@ void _glfwPlatformTerminate(void)
_glfw.x11.cursor = (Cursor) 0;
}
free(_glfw.x11.selection.string);
free(_glfw.x11.clipboardString);
_glfwTerminateJoysticks();
_glfwTerminateContextAPI();

View File

@ -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;