summaryrefslogtreecommitdiff
path: root/hw/xwin/winclipboardxevents.c
diff options
context:
space:
mode:
Diffstat (limited to 'hw/xwin/winclipboardxevents.c')
-rw-r--r--hw/xwin/winclipboardxevents.c27
1 files changed, 15 insertions, 12 deletions
diff --git a/hw/xwin/winclipboardxevents.c b/hw/xwin/winclipboardxevents.c
index d4c617bec..194d2834d 100644
--- a/hw/xwin/winclipboardxevents.c
+++ b/hw/xwin/winclipboardxevents.c
@@ -32,6 +32,7 @@
#include <xwin-config.h>
#endif
#include "winclipboard.h"
+#include "misc.h"
/*
@@ -51,18 +52,20 @@ winClipboardFlushXEvents (HWND hwnd,
Display *pDisplay,
Bool fUseUnicode)
{
- Atom atomLocalProperty = XInternAtom (pDisplay,
- WIN_LOCAL_PROPERTY,
- False);
- Atom atomUTF8String = XInternAtom (pDisplay,
- "UTF8_STRING",
- False);
- Atom atomCompoundText = XInternAtom (pDisplay,
- "COMPOUND_TEXT",
- False);
- Atom atomTargets = XInternAtom (pDisplay,
- "TARGETS",
- False);
+ static Atom atomLocalProperty;
+ static Atom atomCompoundText;
+ static Atom atomUTF8String;
+ static Atom atomTargets;
+ static int generation;
+
+ if (generation != serverGeneration)
+ {
+ generation = serverGeneration;
+ atomLocalProperty = XInternAtom (pDisplay, WIN_LOCAL_PROPERTY, False);
+ atomUTF8String = XInternAtom (pDisplay, "UTF8_STRING", False);
+ atomCompoundText = XInternAtom (pDisplay, "COMPOUND_TEXT", False);
+ atomTargets = XInternAtom (pDisplay, "TARGETS", False);
+ }
/* Process all pending events */
while (XPending (pDisplay))