Unverified Commit e89fb895 authored by Mike Gabriel's avatar Mike Gabriel

Merge branch 'uli42-pr/more_clipboard_improvements' into 3.6.x

parents 057ce728 30fb45b2
...@@ -81,6 +81,9 @@ static char *nxagentAtomNames[NXAGENT_NUMBER_OF_ATOMS + 1] = ...@@ -81,6 +81,9 @@ static char *nxagentAtomNames[NXAGENT_NUMBER_OF_ATOMS + 1] =
"WM_NX_READY", /* 3 */ "WM_NX_READY", /* 3 */
"MCOPGLOBALS", /* 4 */ "MCOPGLOBALS", /* 4 */
"NX_CUT_BUFFER_SERVER", /* 5 */ "NX_CUT_BUFFER_SERVER", /* 5 */
/* Unfortunately we cannot rename this to NX_SELTRANS_TO_AGENT
because nomachine's nxclient is depending on this
selection */
"TARGETS", /* 6 */ "TARGETS", /* 6 */
"TEXT", /* 7 */ "TEXT", /* 7 */
"NX_AGENT_SIGNATURE", /* 8 */ "NX_AGENT_SIGNATURE", /* 8 */
...@@ -90,7 +93,8 @@ static char *nxagentAtomNames[NXAGENT_NUMBER_OF_ATOMS + 1] = ...@@ -90,7 +93,8 @@ static char *nxagentAtomNames[NXAGENT_NUMBER_OF_ATOMS + 1] =
"UTF8_STRING", /* 12 */ "UTF8_STRING", /* 12 */
"_NET_WM_STATE", /* 13 */ "_NET_WM_STATE", /* 13 */
"_NET_WM_STATE_FULLSCREEN", /* 14 */ "_NET_WM_STATE_FULLSCREEN", /* 14 */
"NX_CUT_BUFFER_CLIENT", /* 15 */ "NX_SELTRANS_FROM_AGENT", /* 15 */
"COMPOUND_TEXT", /* 16 */
NULL, NULL,
NULL NULL
}; };
......
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
#include "../../include/window.h" #include "../../include/window.h"
#include "screenint.h" #include "screenint.h"
#define NXAGENT_NUMBER_OF_ATOMS 17 #define NXAGENT_NUMBER_OF_ATOMS 18
extern Atom nxagentAtoms[NXAGENT_NUMBER_OF_ATOMS]; extern Atom nxagentAtoms[NXAGENT_NUMBER_OF_ATOMS];
......
...@@ -36,18 +36,17 @@ typedef struct _XFixesAgentInfo ...@@ -36,18 +36,17 @@ typedef struct _XFixesAgentInfo
int EventBase; int EventBase;
int ErrorBase; int ErrorBase;
int Initialized; int Initialized;
} XFixesAgentInfoRec; } XFixesAgentInfoRec;
extern XFixesAgentInfoRec nxagentXFixesInfo; extern XFixesAgentInfoRec nxagentXFixesInfo;
/* /*
* Create the NX_CUT_BUFFER_CLIENT atom and * Create the NX_SELTRANS_FROM_AGENT atom and
* initialize the required property to exchange * initialize the required property to exchange
* data with the X server. * data with the X server.
*/ */
extern int nxagentInitClipboard(WindowPtr pWindow); extern Bool nxagentInitClipboard(WindowPtr pWindow);
/* /*
* Called whenever a client or a window is * Called whenever a client or a window is
......
...@@ -94,7 +94,7 @@ nxagentWMStateRec; ...@@ -94,7 +94,7 @@ nxagentWMStateRec;
#undef DEBUG #undef DEBUG
#ifdef NXAGENT_CLIPBOARD #ifdef NXAGENT_CLIPBOARD
extern WindowPtr nxagentGetClipboardWindow(Atom, WindowPtr); extern WindowPtr nxagentGetClipboardWindow(Atom);
#endif #endif
#ifdef NXAGENT_ARTSD #ifdef NXAGENT_ARTSD
...@@ -135,7 +135,7 @@ ProcChangeProperty(ClientPtr client) ...@@ -135,7 +135,7 @@ ProcChangeProperty(ClientPtr client)
REQUEST_FIXED_SIZE(xChangePropertyReq, totalSize); REQUEST_FIXED_SIZE(xChangePropertyReq, totalSize);
#ifdef NXAGENT_CLIPBOARD #ifdef NXAGENT_CLIPBOARD
pWin = nxagentGetClipboardWindow(stuff->property, NULL); pWin = nxagentGetClipboardWindow(stuff->property);
if (pWin == NULL) if (pWin == NULL)
#endif #endif
......
...@@ -49,6 +49,24 @@ typedef enum _BackingStoreMode ...@@ -49,6 +49,24 @@ typedef enum _BackingStoreMode
} BackingStoreMode; } BackingStoreMode;
/* since nx 2.0.0-32 clipboard data exchange can be limited. Client
here means "nxclient":
Enable or disable copy and paste operations from the user's desktop
to the NX session or vice versa. This option can take four values:
client The content copied on the client can be pasted inside the
NX session.
server The content copied inside the NX session can be pasted
on the client.
both The copy & paste operations are allowed both between the
client and the NX session and viceversa.
none The copy&paste operations between the client and the NX
session are never allowed.
*/
typedef enum _ClipboardMode typedef enum _ClipboardMode
{ {
ClipboardBoth, ClipboardBoth,
......
...@@ -412,10 +412,10 @@ void nxagentRemoveSplashWindow(void) ...@@ -412,10 +412,10 @@ void nxagentRemoveSplashWindow(void)
#ifdef TEST #ifdef TEST
fprintf(stderr, "%s: setting the ownership of %s (%d) on window 0x%lx\n", __func__ fprintf(stderr, "%s: setting the ownership of %s (%d) on window 0x%lx\n", __func__
"NX_CUT_BUFFER_SERVER", (int)serverCutProperty, nxagentWindow(screenInfo.screens[0]->root)); "NX_CUT_BUFFER_SERVER", (int)serverTransToAgentProperty, nxagentWindow(screenInfo.screens[0]->root));
#endif #endif
XSetSelectionOwner(nxagentDisplay, serverCutProperty, XSetSelectionOwner(nxagentDisplay, serverTransToAgentProperty,
nxagentWindow(screenInfo.screens[0]->root), CurrentTime); nxagentWindow(screenInfo.screens[0]->root), CurrentTime);
} }
......
...@@ -2602,7 +2602,7 @@ void nxagentMapDefaultWindows(void) ...@@ -2602,7 +2602,7 @@ void nxagentMapDefaultWindows(void)
* to notify of the agent start. * to notify of the agent start.
*/ */
XSetSelectionOwner(nxagentDisplay, serverCutProperty, XSetSelectionOwner(nxagentDisplay, serverTransToAgentProperty,
nxagentDefaultWindows[i], CurrentTime); nxagentDefaultWindows[i], CurrentTime);
} }
...@@ -2802,7 +2802,7 @@ Bool nxagentReconnectAllWindows(void *p0) ...@@ -2802,7 +2802,7 @@ Bool nxagentReconnectAllWindows(void *p0)
fprintf(stderr, "nxagentReconnectAllWindows: All windows reconfigured.\n"); fprintf(stderr, "nxagentReconnectAllWindows: All windows reconfigured.\n");
#endif #endif
if (nxagentInitClipboard(screenInfo.screens[0]->root) == -1) if (!nxagentInitClipboard(screenInfo.screens[0]->root))
{ {
#ifdef WARNING #ifdef WARNING
fprintf(stderr, "nxagentReconnectAllWindows: WARNING! Couldn't initialize the clipboard.\n"); fprintf(stderr, "nxagentReconnectAllWindows: WARNING! Couldn't initialize the clipboard.\n");
......
...@@ -178,7 +178,7 @@ do\ ...@@ -178,7 +178,7 @@ do\
WindowPtr nxagentWindowPtr(Window window); WindowPtr nxagentWindowPtr(Window window);
#ifdef XlibAtom #ifdef XlibAtom
extern XlibAtom serverCutProperty; extern XlibAtom serverTransToAgentProperty;
#endif #endif
/* /*
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment