Unverified Commit 3f7bb584 authored by Mike Gabriel's avatar Mike Gabriel

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

parents 4904bfe1 49d63d92
...@@ -129,6 +129,10 @@ reread_keystrokes ...@@ -129,6 +129,10 @@ reread_keystrokes
autograb autograb
Toggles autograb mode Toggles autograb mode
dump_clipboard
print the current internal clipboard state (for debugging) to the
log.
force_synchronization force_synchronization
Forces immediate drawing of elements to be synchronized which can Forces immediate drawing of elements to be synchronized which can
fix some visual bugs. fix some visual bugs.
...@@ -25,4 +25,5 @@ ...@@ -25,4 +25,5 @@
<keystroke action="viewport_scroll_down" Control="1" AltMeta="1" key="KP_Down" /> <keystroke action="viewport_scroll_down" Control="1" AltMeta="1" key="KP_Down" />
<keystroke action="reread_keystrokes" Control="1" AltMeta="1" key="k" /> <keystroke action="reread_keystrokes" Control="1" AltMeta="1" key="k" />
<keystroke action="autograb" Control="1" AltMeta="1" key="g" /> <keystroke action="autograb" Control="1" AltMeta="1" key="g" />
<keystroke action="dump_clipboard" Control="1" Shift="1" AltMeta="1" key="c" />
</keystrokes> </keystrokes>
...@@ -75,8 +75,8 @@ extern void nxagentClientStateCallback(CallbackListPtr *callbacks, void *data, v ...@@ -75,8 +75,8 @@ extern void nxagentClientStateCallback(CallbackListPtr *callbacks, void *data, v
#define nxagentClientIsDialog(pClient) \ #define nxagentClientIsDialog(pClient) \
(nxagentClientHint(pClient) == NXCLIENT_DIALOG) (nxagentClientHint(pClient) == NXCLIENT_DIALOG)
#define nxagentClientInfoString(pClient) \ #define nxagentClientInfoString(pClient) \
(nxagentClientPriv(pClient) -> clientInfoString) ((pClient) ? nxagentClientPriv(pClient) -> clientInfoString : NULL)
/* /*
* The actual reason why the client is sleeping. * The actual reason why the client is sleeping.
......
...@@ -78,4 +78,6 @@ extern WindowPtr nxagentGetClipboardWindow(Atom property); ...@@ -78,4 +78,6 @@ extern WindowPtr nxagentGetClipboardWindow(Atom property);
extern int nxagentSendNotify(xEvent *event); extern int nxagentSendNotify(xEvent *event);
extern void nxagentDumpClipboardStat(void);
#endif /* __Clipboard_H__ */ #endif /* __Clipboard_H__ */
...@@ -1070,6 +1070,11 @@ void nxagentDispatchEvents(PredicateFuncPtr predicate) ...@@ -1070,6 +1070,11 @@ void nxagentDispatchEvents(PredicateFuncPtr predicate)
nxagentToggleAutoGrab(); nxagentToggleAutoGrab();
break; break;
} }
case doDumpClipboard:
{
nxagentDumpClipboardStat();
break;
}
default: default:
{ {
FatalError("nxagentDispatchEvent: handleKeyPress returned unknown value\n"); FatalError("nxagentDispatchEvent: handleKeyPress returned unknown value\n");
......
...@@ -52,6 +52,7 @@ enum HandleEventResult ...@@ -52,6 +52,7 @@ enum HandleEventResult
doSwitchResizeMode, doSwitchResizeMode,
doSwitchDeferMode, doSwitchDeferMode,
doAutoGrab, doAutoGrab,
doDumpClipboard
}; };
extern CARD32 nxagentLastEventTime; extern CARD32 nxagentLastEventTime;
......
...@@ -102,6 +102,8 @@ char * nxagentSpecialKeystrokeNames[] = { ...@@ -102,6 +102,8 @@ char * nxagentSpecialKeystrokeNames[] = {
"autograb", "autograb",
"dump_clipboard",
NULL, NULL,
}; };
...@@ -142,6 +144,7 @@ struct nxagentSpecialKeystrokeMap default_map[] = { ...@@ -142,6 +144,7 @@ struct nxagentSpecialKeystrokeMap default_map[] = {
{KEYSTROKE_VIEWPORT_SCROLL_DOWN, ControlMask, True, XK_KP_Down}, {KEYSTROKE_VIEWPORT_SCROLL_DOWN, ControlMask, True, XK_KP_Down},
{KEYSTROKE_REREAD_KEYSTROKES, ControlMask, True, XK_k}, {KEYSTROKE_REREAD_KEYSTROKES, ControlMask, True, XK_k},
{KEYSTROKE_AUTOGRAB, ControlMask, True, XK_g}, {KEYSTROKE_AUTOGRAB, ControlMask, True, XK_g},
{KEYSTROKE_DUMP_CLIPBOARD, ControlMask | ShiftMask, True, XK_c},
{KEYSTROKE_END_MARKER, 0, False, NoSymbol}, {KEYSTROKE_END_MARKER, 0, False, NoSymbol},
}; };
struct nxagentSpecialKeystrokeMap *map = default_map; struct nxagentSpecialKeystrokeMap *map = default_map;
...@@ -715,6 +718,9 @@ Bool nxagentCheckSpecialKeystroke(XKeyEvent *X, enum HandleEventResult *result) ...@@ -715,6 +718,9 @@ Bool nxagentCheckSpecialKeystroke(XKeyEvent *X, enum HandleEventResult *result)
case KEYSTROKE_AUTOGRAB: case KEYSTROKE_AUTOGRAB:
*result = doAutoGrab; *result = doAutoGrab;
break; break;
case KEYSTROKE_DUMP_CLIPBOARD:
*result = doDumpClipboard;
break;
case KEYSTROKE_NOTHING: /* do nothing. difference to KEYSTROKE_IGNORE is the return value */ case KEYSTROKE_NOTHING: /* do nothing. difference to KEYSTROKE_IGNORE is the return value */
case KEYSTROKE_END_MARKER: /* just to make gcc STFU */ case KEYSTROKE_END_MARKER: /* just to make gcc STFU */
case KEYSTROKE_MAX: case KEYSTROKE_MAX:
......
...@@ -78,10 +78,12 @@ enum nxagentSpecialKeystroke { ...@@ -78,10 +78,12 @@ enum nxagentSpecialKeystroke {
KEYSTROKE_AUTOGRAB, KEYSTROKE_AUTOGRAB,
KEYSTROKE_NOTHING, KEYSTROKE_DUMP_CLIPBOARD,
/* insert more here and in the string translation */ /* insert more here and in the string translation */
KEYSTROKE_NOTHING,
KEYSTROKE_MAX, KEYSTROKE_MAX,
}; };
......
...@@ -127,6 +127,7 @@ Equipment Corporation. ...@@ -127,6 +127,7 @@ Equipment Corporation.
#include "Handlers.h" #include "Handlers.h"
#include "Keyboard.h" #include "Keyboard.h"
#include "Init.h" #include "Init.h"
#include "Utils.h"
const int nxagentMaxFontNames = 10000; const int nxagentMaxFontNames = 10000;
...@@ -584,6 +585,8 @@ Reply Total Cached Bits In Bits Out Bits/Reply Ratio ...@@ -584,6 +585,8 @@ Reply Total Cached Bits In Bits Out Bits/Reply Ratio
nxagentFreeFontData(); nxagentFreeFontData();
#endif /* NXAGENT_SERVER */ #endif /* NXAGENT_SERVER */
nxagentFreeAtomMap();
KillAllClients(); KillAllClients();
free(clientReady); free(clientReady);
dispatchException &= ~DE_RESET; dispatchException &= ~DE_RESET;
...@@ -988,6 +991,10 @@ ProcFreePixmap(register ClientPtr client) ...@@ -988,6 +991,10 @@ ProcFreePixmap(register ClientPtr client)
void void
CloseDownClient(register ClientPtr client) CloseDownClient(register ClientPtr client)
{ {
#ifdef DEBUG
fprintf(stderr, "%s: [%d]\n", __func__, client->clientState);
#endif
#ifdef NXAGENT_SERVER #ifdef NXAGENT_SERVER
/* /*
* Need to reset the karma counter and get rid of the pending sync * Need to reset the karma counter and get rid of the pending sync
......
...@@ -155,9 +155,13 @@ extern void nxagentInitViewportFrame(ScreenPtr, WindowPtr); ...@@ -155,9 +155,13 @@ extern void nxagentInitViewportFrame(ScreenPtr, WindowPtr);
extern int nxagentShadowInit(ScreenPtr, WindowPtr); extern int nxagentShadowInit(ScreenPtr, WindowPtr);
void void
ActivatePointerGrab(register DeviceIntPtr mouse, register GrabPtr grab, ActivatePointerGrab(register DeviceIntPtr mouse, register GrabPtr grab,
TimeStamp time, Bool autoGrab) TimeStamp time, Bool autoGrab)
{ {
#ifdef DEBUG
fprintf(stderr, "%s: called\n", __func__);
#endif
xorg_ActivatePointerGrab(mouse, grab, time, autoGrab); xorg_ActivatePointerGrab(mouse, grab, time, autoGrab);
#ifdef NXAGENT_SERVER #ifdef NXAGENT_SERVER
...@@ -166,7 +170,7 @@ ActivatePointerGrab(register DeviceIntPtr mouse, register GrabPtr grab, ...@@ -166,7 +170,7 @@ ActivatePointerGrab(register DeviceIntPtr mouse, register GrabPtr grab,
* If grab is synchronous, events are delivered to clients only if they send * If grab is synchronous, events are delivered to clients only if they send
* an AllowEvent request. If mode field in AllowEvent request is SyncPointer, the * an AllowEvent request. If mode field in AllowEvent request is SyncPointer, the
* delivered event is saved in a queue and replayed later, when grab is released. * delivered event is saved in a queue and replayed later, when grab is released.
* We should export sync grab to X as async in order to avoid events to be * We should export sync grab to X as async in order to avoid events to be
* queued twice, in the agent and in the X server. This solution have a drawback: * queued twice, in the agent and in the X server. This solution have a drawback:
* replayed events are not delivered to that application that are not clients of * replayed events are not delivered to that application that are not clients of
* the agent. * the agent.
...@@ -217,6 +221,10 @@ ActivatePointerGrab(register DeviceIntPtr mouse, register GrabPtr grab, ...@@ -217,6 +221,10 @@ ActivatePointerGrab(register DeviceIntPtr mouse, register GrabPtr grab,
void void
DeactivatePointerGrab(register DeviceIntPtr mouse) DeactivatePointerGrab(register DeviceIntPtr mouse)
{ {
#ifdef DEBUG
fprintf(stderr, "%s: called\n", __func__);
#endif
xorg_DeactivatePointerGrab(mouse); xorg_DeactivatePointerGrab(mouse);
#ifdef NXAGENT_SERVER #ifdef NXAGENT_SERVER
......
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