Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

#626 Clipboard is trashed when SciTe instance is closed

Bug
open-works-for-me
Neil Hodgson
SciTE (622)
3
2014-10-06
2007-11-06
Daniel
No

v1.72, v1.73 and v.174 on linux are affected by this bug. Copy & Paste only work when the SciTe instance is running. If you close down the instance, another target textarea (even a new SciTe instance) won't Paste anything since the clipboard is invalidated when SciTe is closed

Originally posted on Gentoo bugzilla http://bugs.gentoo.org/show_bug.cgi?id=189230

Discussion

  • Neil Hodgson
    Neil Hodgson
    2007-11-06

    • assigned_to: nobody --> nyamatongwe
    • priority: 5 --> 3
    • milestone: --> Bug
    • status: open --> open-works-for-me
     
  • Neil Hodgson
    Neil Hodgson
    2007-11-06

    Logged In: YES
    user_id=12579
    Originator: NO

    Works for me with version in CVS.

     
  • Daniel
    Daniel
    2007-11-06

    Logged In: YES
    user_id=799761
    Originator: YES

    I have checked out the CVS 'scite' and 'scintilla', compiled them and then performed this test:

    opened up bin/SciTe
    typed some text
    copied text into clipboard using Ctrl+C
    quit SciTe
    opened up another application (mousepad or even SciTe again)
    pasted text

    Result: nothing is pasted

    It does not work for me

     
  • Daniel
    Daniel
    2007-11-06

    • status: open-works-for-me --> pending
     
  • Neil Hodgson
    Neil Hodgson
    2007-11-06

    Logged In: YES
    user_id=12579
    Originator: NO

    That's what I did on both Fedora Core 7 and Ubuntu 6.10 although I don't have mousepad so used gedit and SciTE as the destination. Both platforms worked.

     
  • Neil Hodgson
    Neil Hodgson
    2007-11-06

    • status: pending --> pending-works-for-me
     
  • Daniel
    Daniel
    2007-11-06

    Logged In: YES
    user_id=799761
    Originator: YES

    The test needs SciTe to be the source and any other application to be the destination. The SciTe instance from which the text was copied must have been closed before pasting.

    I guess you have already performed the test this way.

    The bug has been confirmed also by other people on the Gentoo bug tracker (http://bugs.gentoo.org/show_bug.cgi?id=189230) and it's not working after having performed the steps previously described.

    I am not experiencing the issue with any other application; this Gentoo installation has not native KDE or GNOME but has the XFCE4 desktop engine.

    I have given a look to the interested code and it amazes me why it is not working for me.

    Note: USE_GTK_CLIPBOARD is defined here.

    I have also edited ScintillaGTK.cxx at line 1634 with a sample line:

    gtk_clipboard_set_text(clipBoard, "hello", 5); return;

    but when I close the SciTe instance no text is pasted anywhere.

    Could you help at narrowing down the bug cause? Could it be something related to GTK objects being disposed prematurely? I have no GTK programming experience

    Thanks

     
  • Daniel
    Daniel
    2007-11-06

    • status: pending-works-for-me --> open-works-for-me
     
  • Daniel
    Daniel
    2007-11-06

    Logged In: YES
    user_id=799761
    Originator: YES

    I have gtk+ v1.2.10-r12 and gtk+ v2.10.14 installed.

    gtk+ v2.10.14 is being used during compilation

     
  • Daniel
    Daniel
    2007-11-06

    • status: open-works-for-me --> pending-works-for-me
     
  • Neil Hodgson
    Neil Hodgson
    2007-11-07

    Logged In: YES
    user_id=12579
    Originator: NO

    This could be caused by shutting down in an unusual way although that was the point of the June patches. The traditional behaviour on X11 is for clipboards to only be valid while an application is running. Its only fairly recently that its been expected that an invisible program would store clipboard contents after an application exits. Its possible that the clipboard manager on XFCE doesn't like Scintilla's clipboard behaviour.

    See
    http://library.gnome.org/devel/gdk/stable/GdkDisplay.html#gdk-display-store-clipboard

    You may find developers more knowledgeable about this area on the mailing list.

     
  • Daniel
    Daniel
    2007-11-07

    Logged In: YES
    user_id=799761
    Originator: YES

    XFCE runs parts of the GNOME subsystem to offer its features, so as far as freedesktop standards are respected it will work (and GDK is compliant to that standard, as they claim).
    I have other GDK applications and they work without any issue; XFCE clipboard manager is the same as GNOME's, afaik.

    I erroneously thought that gdk_display_store_clipboard() was somewhere being called by SciTE: it is not, correct?

    Maybe this is the issue? I have added at ScintillaGTK.cxx:1637

        gdk\_display\_store\_clipboard\(gdk\_display\_get\_default\(\), GTK\_WIDGET\(PWidget\(wMain\)\)->window, time\(NULL\), \(GdkAtom \*\)&clipboardCopyTargets, nClipboardCopyTargets\);
    

    Without any success.

    I have the (wrong?) feeling that gdk_display_store_clipboard() should be used.

    Anyway, I hope you are going to fix this bug - sorry but I cannot work on it any further. I also hope you would like to confirm this bug.

     
  • Daniel
    Daniel
    2007-11-07

    • status: pending-works-for-me --> open-works-for-me
     
  • Neil Hodgson
    Neil Hodgson
    2007-11-07

    Logged In: YES
    user_id=12579
    Originator: NO

    There shouldn't need to be an explicit call to gdk_display_store_clipboard since the normal exit handling of GTK+ should do that. The link was just a starting point for looking into clipboard manager issues. I don't run Gentoo or XFCE and the bug doesn't occur on a setup I use so I won't be working on this further.

     
  • Neil Hodgson
    Neil Hodgson
    2007-11-23

    • status: open-works-for-me --> closed-works-for-me
     
  • Daniel
    Daniel
    2007-11-23

    Logged In: YES
    user_id=799761
    Originator: YES

    Please leave it open, if you wish, since it has been confirmed by several other people (see http://bugs.gentoo.org/show_bug.cgi?id=189230\).

    If the bug is closed nobody else will care about it

     
  • Neil Hodgson
    Neil Hodgson
    2007-11-23

    Logged In: YES
    user_id=12579
    Originator: NO

    This was closed with the release of 1.75. Can you reproduce with 1.75?

     
  • Daniel
    Daniel
    2007-11-27

    Logged In: YES
    user_id=799761
    Originator: YES

    I have downloaded the released v1.75 and the bug is still present.

    After closing SciTE, whatever was on the clipboard is lost.

     
  • Daniel
    Daniel
    2007-11-27

    • status: closed-works-for-me --> pending
     
  • Neil Hodgson
    Neil Hodgson
    2007-11-27

    • status: pending --> open-works-for-me
     
  • Neil Hodgson
    Neil Hodgson
    2007-11-27

    Logged In: YES
    user_id=12579
    Originator: NO

    OK, opened again but still marked "Works For Me" as it works on Ubuntu and Fedora.