X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=blobdiff_plain;f=terminal.c;h=ca47c8335f79eabaf581bd71b8b55f28b8718ee6;hb=9f9d72ec58642e91b4f93ee4405a8086ee2fb2f0;hp=590f456a2b1110402af170a9b7fd8ca7dffd9b79;hpb=0de1ac95e5fe91e71061120de314b9bd852c2303;p=PuTTY.git diff --git a/terminal.c b/terminal.c index 590f456a..ca47c833 100644 --- a/terminal.c +++ b/terminal.c @@ -6078,6 +6078,19 @@ void term_mouse(Terminal *term, Mouse_Button braw, Mouse_Button bcooked, sel_spread(term); } else if ((bcooked == MBT_SELECT && a == MA_DRAG) || (bcooked == MBT_EXTEND && a != MA_RELEASE)) { + if (a == MA_DRAG && + (term->selstate == NO_SELECTION || term->selstate == SELECTED)) { + /* + * This can happen if a front end has passed us a MA_DRAG + * without a prior MA_CLICK. OS X GTK does so, for + * example, if the initial button press was eaten by the + * WM when it activated the window in the first place. The + * nicest thing to do in this situation is to ignore + * further drags, and wait for the user to click in the + * window again properly if they want to select. + */ + return; + } if (term->selstate == ABOUT_TO && poseq(term->selanchor, selpoint)) return; if (bcooked == MBT_EXTEND && a != MA_DRAG &&