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