summaryrefslogtreecommitdiff
path: root/selc.c
diff options
context:
space:
mode:
Diffstat (limited to 'selc.c')
-rw-r--r--selc.c65
1 files changed, 4 insertions, 61 deletions
diff --git a/selc.c b/selc.c
index 1b8eb86..b32bf74 100644
--- a/selc.c
+++ b/selc.c
@@ -42,9 +42,7 @@ static void attachio(int force);
static int samewin(HWND a, HWND b);
static int isclient(HWND hw, POINT pt);
static int ispass(HWND hw);
-static int skipctrlc(HWND hw);
static int goodsel(const struct Sel *s);
-static void sendctrlc(void);
static void docopy(void);
static void request(int kbd);
static LRESULT CALLBACK mouseproc(int code, WPARAM wp, LPARAM lp);
@@ -132,24 +130,6 @@ ispass(HWND hw)
}
static int
-skipctrlc(HWND hw)
-{
- char cls[64];
- HWND root;
- int i;
-
- root = GetAncestor(hw, GA_ROOT);
- if (!root)
- root = hw;
- if (!GetClassNameA(root, cls, (int)sizeof(cls)))
- return 0;
- for (i = 0; i < (int)LEN(nocctrlc); i++)
- if (strcmp(cls, nocctrlc[i]) == 0)
- return 1;
- return 0;
-}
-
-static int
goodsel(const struct Sel *s)
{
HWND a, b;
@@ -164,36 +144,6 @@ goodsel(const struct Sel *s)
}
static void
-sendctrlc(void)
-{
- INPUT in[4];
- int n, ctrl;
-
- ctrl = (GetAsyncKeyState(VK_CONTROL) & 0x8000) != 0;
- memset(in, 0, sizeof(in));
- n = 0;
- if (!ctrl) {
- in[n].type = INPUT_KEYBOARD;
- in[n].ki.wVk = VK_CONTROL;
- n++;
- }
- in[n].type = INPUT_KEYBOARD;
- in[n].ki.wVk = 'C';
- n++;
- in[n].type = INPUT_KEYBOARD;
- in[n].ki.wVk = 'C';
- in[n].ki.dwFlags = KEYEVENTF_KEYUP;
- n++;
- if (!ctrl) {
- in[n].type = INPUT_KEYBOARD;
- in[n].ki.wVk = VK_CONTROL;
- in[n].ki.dwFlags = KEYEVENTF_KEYUP;
- n++;
- }
- SendInput((UINT)n, in, sizeof(INPUT));
-}
-
-static void
docopy(void)
{
HWND fg, foc;
@@ -219,19 +169,12 @@ docopy(void)
seq = GetClipboardSequenceNumber();
SendMessageTimeoutA(foc, WM_COPY, 0, 0,
SMTO_ABORTIFHUNG | SMTO_NORMAL, COPYTO, &dummy);
- if (GetClipboardSequenceNumber() != seq) {
- if (verbose)
+ if (verbose) {
+ if (GetClipboardSequenceNumber() != seq)
fprintf(stderr, "selc: WM_COPY\n");
- goto done;
- }
- if (skipctrlc(foc) || skipctrlc(fg)) {
- if (verbose)
- fprintf(stderr, "selc: skip Ctrl+C\n");
- goto done;
+ else
+ fprintf(stderr, "selc: no copy\n");
}
- sendctrlc();
- if (verbose)
- fprintf(stderr, "selc: Ctrl+C\n");
done:
if (attached)
AttachThreadInput(mine, tid, FALSE);