Author Topic: The 11 February 2008 build (4872) is out.  (Read 33273 times)

Offline killerbot

  • Administrator
  • Lives here!
  • *****
  • Posts: 5490
The 11 February 2008 build (4872) is out.
« on: February 11, 2008, 08:28:32 pm »
Get quick announcements through the RSS feed http://www.codeblocks.org/nightly/CodeBlock_RSS.xml

Before you use a nightly make sure you understand how it works.

A link to the unicode windows wxWidget dll for Code::Blocks : http://prdownload.berlios.de/codeblocks/wxmsw28u_gcc_cb_wx287.7z

For those who might need this one (when no MingW installed on your system) : the mingw10m.dll : http://prdownload.berlios.de/codeblocks/mingwm10_gcc421.7z

The 11 February 2008 build is out.
  - Windows :
   http://prdownload.berlios.de/codeblocks/CB_20080211_rev4872_win32.7z
  - Linux :
   none

Resolved Fixed:

  • C::B could crash or hang because of cbMessageBox calls inside worker thread in ThreadSearch plugin (very big thanks to Jens for this fix)
  • Fixed breakpoints set as pending not being able to be removed
  • Fix for rare crash when removing a breakpoint (thx Pecan)
  • Added: "Verbatim String" to Squirrel lexer (Thanks to Wahooney)
  • Applied path 2369 (fixes Bug 13054) (thanks Jens)
  • Fixed: [Bug #13064] Copy contents with search results and build messages
  • Fixed critical bug that could cause data corruption in rare cases. Thanks to Ceniza for providing the reproducable test case

Regressions/Confirmed/Annoying/Common bugs:

  • toolbar-images-not-changing-state (is a wx problem/Win XP problem)


Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: The 11 February 2008 build (4872) is out.
« Reply #1 on: February 11, 2008, 08:48:51 pm »
Binaries for debian i386, amd64 and sources (tar-balls also usable on other platforms) can be found in my repository (see signature).

Offline Xaviou

  • Regular
  • ***
  • Posts: 402
    • X@v's wxStuff
Re: The 11 February 2008 build (4872) is out.
« Reply #2 on: February 11, 2008, 09:46:41 pm »
Ubuntu 7.04 -> 7.10 Amd64 tar.gz archive (containing '.deb' installers builds with wx2.8.7) can be found here
The french wxWidgets site : http://www.wxdev.fr
My wxWidgets's stuff : https://wxstuff.xaviou.fr/

Offline pasgui

  • Almost regular
  • **
  • Posts: 165
    • LGP
Re: The 11 February 2008 build (4872) is out.
« Reply #3 on: February 11, 2008, 11:00:56 pm »
Build for Ubuntu i386/amd64 can be found here

Best regards, pasgui

Offline sika

  • Multiple posting newcomer
  • *
  • Posts: 18
Re: The 11 February 2008 build (4872) is out.
« Reply #4 on: February 13, 2008, 01:53:30 pm »

Offline thomas

  • Administrator
  • Lives here!
  • *****
  • Posts: 3979
Re: The 11 February 2008 build (4872) is out.
« Reply #5 on: February 13, 2008, 09:19:19 pm »
Is there some news for bug #11505 (https://developer.berlios.de/bugs/?func=detailbug&bug_id=11505&group_id=5358)?
Thanks
That's not a bug, but a feature request :)  Regarding news to this feature, there are no recent news.
I implemented that feature inside Code::Blocks on 2006-10-02. It was explicitely disabled under GTK two weeks later, since users reported that the operating system already implements the functionality, and doubling it in the application would paste all text twice (which of course doesn't make sense).
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."

Offline Pecan

  • Plugin developer
  • Lives here!
  • ****
  • Posts: 2750
Re: The 11 February 2008 build (4872) is out.
« Reply #6 on: February 14, 2008, 04:32:20 am »
Is there some news for bug #11505 (https://developer.berlios.de/bugs/?func=detailbug&bug_id=11505&group_id=5358)?
Thanks

The following url contains a zip file.
http://www.savefile.com/files/1379067

The zip file MouseSap.zip contains a plugin to implement the "OnGPM" (middle mouse paste) as a plugin for both MSW and Linux.

Download the zip file, and expand it. From the CodeBlocks "Menu/Plugins/Manage Plugins/Install New" dialog, navigate to either libMouseSap.cbplugin (for linux), or MouseSap.cbplugin for MSW.

The plugin pastes the last text selection at the current cursor position.

One difference from the current implementation in MSW. It re-selects the pasted text at the target cursor position. I find this behavior more comfortable than the jump backward to the original selection  caused by not re-marking the selection.

Let me know how it works for you.
« Last Edit: February 14, 2008, 04:45:42 am by Pecan »

Offline sika

  • Multiple posting newcomer
  • *
  • Posts: 18
Re: The 11 February 2008 build (4872) is out.
« Reply #7 on: February 14, 2008, 10:02:42 am »
Thanks for the plugin!
I didn't know it had been implemented in 2006.
Honestly, on linux this is quite a standard feature. I haven't seen many apps having the same problem. That's why I call it a bug  :).
I'll try to summarize the situation (this is under linux, I can't test under win32 (I thought this feature was specific to linux)):

CB without plugin:
-copy text outside CB, paste inside CB -> works (so this is done by the operating system?)
-copy text inside CB, paste inside CB -> doesn't work
-copy text inside CB, paste outside CB -> doesn't work

CB with the plugin:
-copy text outside CB, paste inside CB -> doesn't work
-copy text inside CB, paste inside CB -> works (well as you stated, the pasted text is selected. In other apps the cursor is placed after the pasted text or the original text is selected. I don't know what is the best behavior.)
-copy text inside CB, paste outside CB -> doesn't work

The odd thing is everything work just fine with the text in the "messages" frame (in the build log for example).

EDIT: there was a mistake
« Last Edit: February 14, 2008, 10:30:08 am by sika »

Offline thomas

  • Administrator
  • Lives here!
  • *****
  • Posts: 3979
Re: The 11 February 2008 build (4872) is out.
« Reply #8 on: February 14, 2008, 11:05:49 am »
The text areas in the messages panel are native controls. Therefore, the OS does everything, we don't even know.

The editor is not a native control, which makes things more complicated. What the "GPM hack" in Code::Blocks does is simply insert the current selection (if any) at the clicked location. It does not modify the contents of the clipboard, nor look at it. It's not perfect, but it offers at least some of the functionality.

One reason why we don't touch the clipboard is that the feature was meant to be present under Windows, too, which would be perceived as disturbing behaviour for Windows users. Also, to fully simulate GPM, more drastic things have to happen. Pasting into Code::Blocks is trivial, we can just read from the clipboard. However, the opposite direction is a lot more complicated. We cannot know that the user is going to middle-click another window the next instant, and when it happens, it's too late already. This means that we have to export the current selection to the clipboard every time the application loses focus, just in case. Gulp. No thank you :)

Surprisingly, some users reported shortly after this feature was implemented that they were now getting double-inserts. I didn't see how this could have been possible, but had to believe them (hey... why should they lie?). So, the feature was disabled under Linux. Anything you see under Linux is plainly the operating system's doing.

Funnily, from your description, Pecan's plugin seems to actually make it worse, as pasting into Code::Blocks from outside doesn't work any more while it would before... so you can see that something is going on there from the operating system's side. I have no idea what messes up the copy from outside functionality, though.
The best thing may be to not touch anything, and let the OS do whatever it does  :?
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."

Offline Pecan

  • Plugin developer
  • Lives here!
  • ****
  • Posts: 2750
Re: The 11 February 2008 build (4872) is out.
« Reply #9 on: February 14, 2008, 03:59:41 pm »
...
CB with the plugin:
-copy text outside CB, paste inside CB -> doesn't work
-copy text inside CB, paste inside CB -> works (well as you stated, the pasted text is selected. In other apps the cursor is placed after the pasted text or the original text is selected. I don't know what is the best behavior.)
-copy text inside CB, paste outside CB -> doesn't work
...

The first "doesn't work" is easy to fix. If there is no selection in the current editor, we can paste from the clipboard.

The second "doesn't work" is bad behavior from an MSW point of view, because I don't think the user expects "selected text" to clobber the clipboard unless they do a specific ctrl-c etc.

However, on Linux, it might be done, somewhat like Scintilla does it for gtk.
Code
#ifdef __WXGTK__
void ScintillaWX::DoMiddleButtonUp(Point pt) {
    // Set the current position to the mouse click point and
    // then paste in the PRIMARY selection, if any.  wxGTK only.
    int newPos = PositionFromLocation(pt);
    MovePositionTo(newPos, noSel, true);

    pdoc->BeginUndoAction();
    wxTextDataObject data;
    bool gotData = false;
    if (wxTheClipboard->Open()) {
        wxTheClipboard->UsePrimarySelection(true);
        gotData = wxTheClipboard->GetData(data);
        wxTheClipboard->UsePrimarySelection(false);
        wxTheClipboard->Close();
    }
    if (gotData) {
        wxString   text = wxTextBuffer::Translate(data.GetText(),
                                                  wxConvertEOLMode(pdoc->eolMode));
        wxWX2MBbuf buf = (wxWX2MBbuf)wx2stc(text);
        int        len = strlen(buf);
        pdoc->InsertString(currentPos, buf, len);
        SetEmptySelection(currentPos + len);
    }
    pdoc->EndUndoAction();
    NotifyChange();
    Redraw();

    ShowCaretAtCurrentPosition();
    EnsureCaretVisible();
}
#else
void ScintillaWX::DoMiddleButtonUp(Point WXUNUSED(pt)) {
}
#endif

Strangely, I do not see this implemented on my Ubuntu 7.10 system. There must be some option I cannot find.

 
« Last Edit: February 14, 2008, 04:02:05 pm by Pecan »

Offline Pecan

  • Plugin developer
  • Lives here!
  • ****
  • Posts: 2750
Re: The 11 February 2008 build (4872) is out.
« Reply #10 on: February 14, 2008, 07:22:10 pm »
...
CB with the plugin:
-copy text outside CB, paste inside CB -> doesn't work


Fixed: http://www.savefile.com/files/1380387
MouseSap001.zip. Make sure all editor windows are closed when you do the install, else MouseSap cannot see the window until the next CB startup.

Source: http://www.savefile.com/files/1380404
« Last Edit: February 14, 2008, 07:26:23 pm by Pecan »

Offline sika

  • Multiple posting newcomer
  • *
  • Posts: 18
Re: The 11 February 2008 build (4872) is out.
« Reply #11 on: February 14, 2008, 07:46:21 pm »
Ok, Thomas. Now I see why it isn't as simple as I thought.
Now I'm just wondering how do the other apps and native controls achieve this.
Thanks Pecan for the new version of your plugin! now the first problem is ok (the only problem that I see is that if you select something in CB, then something outside, it is the later that should be pasted.)
There's still the problem for selecting inside CB to paste outside. I agree that it should only be implemented for linux as this is quite a linux specific feature.
As for the scintilla code you gave, it seems to be the code for pasting with middle click inside scintilla (from what I understand). Do you know if you can do the opposite (from scintilla to outside world) with scintilla?

Offline thomas

  • Administrator
  • Lives here!
  • *****
  • Posts: 3979
Re: The 11 February 2008 build (4872) is out.
« Reply #12 on: February 15, 2008, 11:06:21 am »
Now I'm just wondering how do the other apps and native controls achieve this.
Well, a native control doesn't have to worry, it's coded into it, it just happens. Console programs don't have to worry either, as the shell window does that.

Quote
Do you know if you can do the opposite (from scintilla to outside world) with scintilla?
Yes, that's trivial, you only need to get the current text range and copy it to the clipboard. The problem is that you must do it every time the application loses focus, just in case. Actually, if you want to be able to copy from a text editor to somewhere else inside the application (file selector or whatever), you must do it every time the editor loses focus, or every time the user has made a new selection.
« Last Edit: February 15, 2008, 11:08:34 am by thomas »
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."

Offline Pecan

  • Plugin developer
  • Lives here!
  • ****
  • Posts: 2750
Re: The 11 February 2008 build (4872) is out.
« Reply #13 on: February 15, 2008, 11:15:00 pm »

There's still the problem for selecting inside CB to paste outside. I agree that it should only be implemented for linux as this is quite a linux specific feature.
As for the scintilla code you gave, it seems to be the code for pasting with middle click inside scintilla (from what I understand). Do you know if you can do the opposite (from scintilla to outside world) with scintilla?

Yes, with this version, selected code is copied to the primary clipboard when an editor loses focus.

The selection is also copied to the clipboard if the user middle-mouse-clicks inside the selection.

This plugins performs the same on both msw and linux.

http://www.savefile.com/files/1382874
« Last Edit: February 15, 2008, 11:57:23 pm by Pecan »

Offline sika

  • Multiple posting newcomer
  • *
  • Posts: 18
Re: The 11 February 2008 build (4872) is out.
« Reply #14 on: February 16, 2008, 08:43:17 am »
Thanks a lot!
This is getting great :D I'm currently testing the latest version.
I see a little problem remaining: copy/paste using middle click works ok now, but using keyboard (ctrl-c/ctrl-v) doesn't work correctly if you copy from inside CB to CB itself or any other app.
Do you think it can be solved?