Pat Gunn (dachte) wrote,
Pat Gunn

Firefox and Clipboard-clobbering

I often find that my PRIMARY clipboard (the one associated with mouse selections in the X Window System, not to be confused with the CLIPBOARD clipboard used for menu-driven cut'n'paste) gets stuck with something that I selected sometime back, even after I select something new to put into it.

Being aware of this has led me to become more observant; enough to finally fully understand the problem and culprit.

It's Firefox. The old text that gets stuck is usually still selected in some Firefox window somewhere, and even when I haven't done anything with Firefox for half an hour, it'll still wake up occasionally, notice that some text is selected in one of its windows, and reassociate that with the clipboard, which actually has the visual effect of deselecting the text in whatever other app (usually a terminal) I'm trying to cut'n'paste from. I can see that deselection happen if I'm careful.

I think I can understand why Firefox behaves wierdly here; it has its own widget library that are going through a platform later called NSPR (Netscape Portable Runtime), and that layer probably is not very X11-savvy; it's a platform abstraction library, and those have the job of hiding differences between operating systems. IIRC, Firefox doesn't use native X11 widgets; there's some weird Xlib stuff in NSPR that does portable widgets, and so there's a lot of room for non-ICCCM-compliant behaviour. Somebody might've thought having a thread that pokes around the windows for currently-selected text and periodically associates it with the PRIMARY clipboard would be an adequate solution.

Unfortunately, it's frustrating as hell. When I can't reliably use the clipboard on my system because firefox is running, it's a problem. If anyone knows whether this is an unfixable design flaw, a known problem, or something somehow specific to me (I do use a weird X environment and it's possible there are WMHints that should allow Firefox to be smarter that are not happening), I'd be grateful for some poking around. I don't see myself leaving Firefox over this; it remains my favourite browser, none of the alternatives really interest me, and my past personal involvement with the Mozilla project has bought my loyalty for the forseeable future. I'd still love not to see the problem anymore.

(Crossposted to G+)

Tags: tech

  • CMU, the First Amendment, and Indecent Exposure

    Earlier on my G+ stream, I commented on the matter of a CMU student who protested the Catholic church's coverup of sexual abuse by dressing as the…

  • Dilution

    I've been thinking about an issue that's been raised in the secular community; I'm not sure it's a good issue, nor a bad one. Let me lead up to it…

  • Commentary on the Human Rights Campaign

    I recently was pointed at a blog post suggesting people reject the Human Rights Campaign, a large social justice organisation that focuses on…

  • Post a new comment


    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

    Your IP address will be recorded