Author Topic: CB log tab : Copy selection to clipboard  (Read 14033 times)

Offline killerbot

  • Administrator
  • Lives here!
  • *****
  • Posts: 5529
CB log tab : Copy selection to clipboard
« on: May 11, 2013, 10:57:58 pm »
who is able to succeed on that (on linux) ?

For me always like this :
- select something
- right click in order to select (Copy selection to clipboard) ==> nothing more selected

==> unable to copy something

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7252
Re: CB log tab : Copy selection to clipboard
« Reply #1 on: May 11, 2013, 11:21:29 pm »
Does not work here either, "Ctrl+C" also fails, but "Shift+Del" works.

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13406
    • Travis build status
Re: CB log tab : Copy selection to clipboard
« Reply #2 on: May 11, 2013, 11:35:06 pm »
It is cause by one of my commits, which changed the API. :(
Will check in a minute...
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13406
    • Travis build status
Re: CB log tab : Copy selection to clipboard
« Reply #3 on: May 12, 2013, 01:34:53 am »
Hm, my commit is 8798 and I don't think it is the cause for the problem.

killerbot: do you have a working version?
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7252
Re: CB log tab : Copy selection to clipboard
« Reply #4 on: May 12, 2013, 02:45:01 am »
It is your commit.
The issue is caused by sdk/loggers.cpp:189:
Code
    wxWindowUpdateLocker noUpdates(control);

The update-locker seems to clear the selection.
I think it's not needed there, because the function only reads the style and does not do anything critical.
Removing it, should not do any harm and makes the issue go away.

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13406
    • Travis build status
Re: CB log tab : Copy selection to clipboard
« Reply #5 on: May 12, 2013, 03:03:45 am »
Yes, but you cannot tell from the commit itself.

Hm, isn't it safer to save the selection and then restore it (if there is API available)?
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline killerbot

  • Administrator
  • Lives here!
  • *****
  • Posts: 5529
Re: CB log tab : Copy selection to clipboard
« Reply #6 on: May 12, 2013, 09:28:14 am »
Hm, my commit is 8798 and I don't think it is the cause for the problem.

killerbot: do you have a working version?
nope, I think this problem is already present for some long time

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7252
Re: CB log tab : Copy selection to clipboard
« Reply #7 on: May 12, 2013, 09:59:05 am »
Yes, but you cannot tell from the commit itself.

Hm, isn't it safer to save the selection and then restore it (if there is API available)?
It's not obvious, that wxWindowUpdateLocker clears the selection, it's also not documented and might be a bug in wxWidgets.
I did not test it with other windows or with wx from trunk.

Nevertheless, if this one line is removed it works as expected !

And I don't think we need to freeze the textcontrol to fetch it's style.
Why should it be safer ?

The update-locker was originally only used when the wrap-mode is changed and that is probably correct here to avoid flickering.
I don't know if it is really needed. In this case a slection will also be cleared, but this can probably be ignored or the selection can be stored and recreated if it is really wanted.

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7252
Re: CB log tab : Copy selection to clipboard
« Reply #8 on: May 12, 2013, 11:30:49 am »
Maybe we should remove the Freeze()-Thaw() stuff in the loggers completely.
Even if it might flicker on linux. On windows they have no effect at all as far as I know.

But they always scroll the textcontrol to the first position.
We can possibly work around this by storing (and restoring) the scroll-position, but I don't know if it is really neeeded.

I don't see any issue, if we do not use Freeze() and Thaw() here.
Only tested on my fedora 18 system with gnome-shell.

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13406
    • Travis build status
Re: CB log tab : Copy selection to clipboard
« Reply #9 on: May 12, 2013, 11:58:03 am »
Have you tried to build a larger project with lots of warnings to see what is the performance?
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7252
Re: CB log tab : Copy selection to clipboard
« Reply #10 on: May 12, 2013, 12:11:26 pm »
Have you tried to build a larger project with lots of warnings to see what is the performance?
No.

We  only have Freeze() and Thaw() in the ListCtrlLogger::Append()-functions (if we remove the from TextCtrlLogger::GetWrapMode() and TextCtrlLogger::ToggleWrapMode() ).
I did not remove them from there,as they seem not to cause problems.

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13406
    • Travis build status
Re: CB log tab : Copy selection to clipboard
« Reply #11 on: May 12, 2013, 12:24:22 pm »
OK. Go on and commit if you like :)
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline killerbot

  • Administrator
  • Lives here!
  • *****
  • Posts: 5529
Re: CB log tab : Copy selection to clipboard
« Reply #12 on: May 12, 2013, 06:28:26 pm »
the patch works.  ;D

In order to make the user not wonder if he actually did copy something, can the "visual" selection be maintained, just like in the editor window when you right click ?