Pages: 1 2 [3] 4   Go Down
Author Topic: X11 paste in IDE  (Read 5239 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Full Member
***
Karma: 0
Posts: 179
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
Please, if you have *useful* info about why this doesn't work, and info that's specific the Arduino's case

I would have thought that the best place to start was what I've already pointed out above: X11 cut and paste does work in the error window but context menus don't. Vice versa in main IDE editor window.

Both are presumably in the same java environment so that should not take someone with  your talents too long to track down what they got wrong.

Logged

Offline Offline
God Member
*****
Karma: 32
Posts: 830
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

You're very welcome to make a much better product and impress us with your ability until then use a more appropriate tone when participating in the discussion.

I'm sorry you seem to have missed the constructive criticism and lessons here.

The fact is, for many developers with even a reasonable amount of previous programming experience, a real, full-strength programming editor + Martin Oldfield's makefiles *is* a "better product" -- no contest.

While I agree a civil tone is important to keeping any forum a better place to be, and I personally strive to maintain one even when I'm being critical of something, I think the take-home lesson here for the developers is that despite apparently delighting  hundreds of thousands of complete novices, the IDE is *not* a friendly tool for an experienced programmer -- it is a buggy and frustrating hinderence, in fact.

Some of that frustration is on display in this thread. It won't go away until you improve the IDE to make it more suitable for people of this background. Fixing the long-standing and significant bugs in the "Arduino" preprocessor, or giving the user a means of simply bypassing it to allow them to write code in "real" C++, would be a straigtforward and significant step forward.

Now, perhaps it is the case that you've made the business decision that the more experienced Arduino developer is simply irrelevant when considering the development of your products. Fine. That's your call. But whether or not that's a call you've consciously and deliberately made, the way things stand at the moment many people *will* be actively seeking alternatives to having to work within your IDE to develop for the Arduino platform.

And inevitably you will be seeing some vented spleen in these forums as people find their way along similar paths of annoyance, frustration, and sometimes sheer exasperation.

I hope you see I've taken the time to write this to in fact provide you some potentially useful feedback. Take it or leave it, but in any case, you're welcome.

Logged

WiFi shields/Yun too expensive? Embeddedcoolness.com is now selling the RFXduino nRF24L01+ <-> TCP/IP Linux gateway: Simpler, more affordable, and even more powerful wireless Internet connectivity for *all* your Arduino projects! (nRF24L01+ shield and dev board kits available too.)

North Queensland, Australia
Offline Offline
Edison Member
*
Karma: 70
Posts: 2172
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Well said,

Quote
I think the take-home lesson here for the developers is that despite apparently delighting  hundreds of thousands of complete novices, the IDE is *not* a friendly tool for an experienced programmer -- it is a buggy and frustrating hinderence, in fact.

This just about sums up my frustration.

Quote
What was the extension of the file? I've read (but haven't yet verified) that in 1.0.1, only .h and .cpp files can now be included by a #include directive from within a sketch (who knows why... the Arduino team seem hell-bent on doing all they can to subvert the expected and otherwise well-defined behaviour of the venerable C preprocessor.)

If this was seen in my post http://arduino.cc/forum/index.php/topic,117890.msg888860.html#msg888860, I didn't try .c, .hpp, other c or c++ files. I had a custom file to include in, it is standard behaviour, but Arduino IDE shrugged it off.

It also has a severe bug in the inclusion system of sketch and library paths ( added into v 1.0.1 ), static paths like the core and avr locations are fine as they are not intercepted by the IDE. Which leads me to ponder... why move the files at all if there is no need.

Logged


Global Moderator
Offline Offline
Brattain Member
*****
Karma: 485
Posts: 18810
Lua rocks!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

one very useful feature on X11 based systems is PRIMARY buffer. As soon as any text is selected it is copied to the buffer, then clicking mouse button 3 (often scroll wheel click) then pastes the buffer.

This is about an order of magnitude faster the all the right-click context menu cut and paste method

Huh? 10 times faster than pressing Ctrl+V?

Surely not.

Personally I find all this X11 stuff confusing. Who the hell wants stuff copied to the buffer just because you select it?
Logged


0
Offline Offline
God Member
*****
Karma: 26
Posts: 610
Always making something...
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Nick, it really is incredibly quick and convenient.  10X might be an exaggeration, but trust me, it truly is very fast, especially in combination with focus-follows-cursor window management.  It doesn't work nearly as well with click-to-focus, which is the standard window management on Windows and Macintosh.

To be honest, the X11 approach is mostly useful for quickly copying data between programs.  Conventional Windows & Mac style tends to also be useful for keeping something around for a while, but X11-style tends to be used for very immediate short-term copying, since the selection is so fragile.  Clicking the wrong way destroys the previous selection.  But when you just want to copy some text from a window, and especially when the destination is an empty text box or console-based application (both cases the precise cursor position doesn't matter), you just click & drag to select the desired text, the move the mouse imprecisely (very quickly) to the destination (it automatically gets focus if you're using focus follows cursor) and click the middle button.  To someone who's only ever used Macintosh and Windows, that must sound really bizarre, but believe me, it's incredibly convenient.

There's absolutely no reason both can't work.  Firefox, Libre/Open Office and lots of other major programs support both when running on X11.  Arduino should too when running on X11.  "When in Rome (do as the Romans do)."  Don't worry, this isn't going to be somehow emulated on Mac or Windows.  It's only about properly integrating with the environment in which Arduino is running.  Good software should do that....

I personally use all 3 systems on a pretty regular basis.  When I use Windows and Mac (and Arduino on Linux), I *really* miss the incredible speed & convenience of focus follows cursor window management and X11-style text copying.  Arduino (perhaps due to Java?) also has some quirks where it doesn't obey focus-follows-cursor window management.  Someday I'd like to fix these, but unfortunately my strengths are in low-level embedded programming and hardware, so I really need someone who truly understands these finer points of desktop and Java/swing development to at least point the way.

« Last Edit: August 12, 2012, 06:16:59 am by Paul Stoffregen » Logged

Forum Administrator
Offline Offline
God Member
*****
Karma: 52
Posts: 646
I find plain exciting
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

@pico
thanks for the civil feedback, I understand your point. We're working on a much more open development process encouraging more contributions.

Experienced developers have a simple way to solve some of their frustrations: git clone the arduino code, patch it, submit a pull request.
I will personally take charge of have any reasonable patch included in the IDE. We've also hired a developer to implement all the long standing issues the IDE has had.
Please understand that not all the patches that make experienced developers happy might end up in the IDE.

-----personal opinion, not an official Arduino position -------
I think that in the short term we can patch the IDE to make it more useable but the fundamental structure of the IDE is probably a bit old and makes it hard to add fancy features like step by step debugging and the rest. It's probably time we rebuild the ide based on a more solid basis but on the same principles of simplicity that make Arduino good as a beginner platform
---- end of personal opinion ------

m


Logged

0
Offline Offline
Faraday Member
**
Karma: 8
Posts: 2526
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
Huh? 10 times faster than pressing Ctrl+V?

Surely not.

Yep, since it's a click instead of click + CRTL-V.  No "let go of the mouse and find the keyboard" transition to make.

After you've selected the text, it's already copied, so there's no need for a CTRL-C, and the same mouse click that would change focus to the target window for the paste actually executes the paste.

So, for X-11:

click+drag, click

For Windows, et al:

click+drag, CTRL-C, click, CTRL-V

Note the mouse-to-keyboard (or vice versa) input device transitions in the X11 version (none) vs. the other version (minimum of 3), and the fact there are twice as many operations.

If you don't use focus-follows-mouse, there's an extra click in there for X11, but you don't even have to change buttons to do it.

-j
Logged

Offline Offline
Full Member
***
Karma: 0
Posts: 179
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
There's absolutely no reason both can't work. 

That's the key point. And since only one of these two features works in each (no context menus in IDE code window but X11 works in error window) it must be possible. Someone is gobbling mouse events in the code window. Presumably this was designed on Windows and the defect was not noticed.

Nick:
Quote
Huh? 10 times faster than pressing Ctrl+V?


Before posting I wondered if it was overstating, though about it and decided it was not far off. I can effect a copy / paste from one window to another of withing a window in under 1/2 a second.

It seems all those who don't understand why those who miss it are moaning, are those who have not had the chance to experience how quick and easy it is. Once you've tasted it, you won't want to go back smiley-wink



Logged

Offline Offline
Full Member
***
Karma: 0
Posts: 179
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

@pico
thanks for the civil feedback, I understand your point. We're working on a much more open development process encouraging more contributions.

Experienced developers have a simple way to solve some of their frustrations: git clone the arduino code, patch it, submit a pull request.
I will personally take charge of have any reasonable patch included in the IDE. We've also hired a developer to implement all the long standing issues the IDE has had.
Please understand that not all the patches that make experienced developers happy might end up in the IDE.

-----personal opinion, not an official Arduino position -------
I think that in the short term we can patch the IDE to make it more useable but the fundamental structure of the IDE is probably a bit old and makes it hard to add fancy features like step by step debugging and the rest. It's probably time we rebuild the ide based on a more solid basis but on the same principles of simplicity that make Arduino good as a beginner platform
---- end of personal opinion ------

m




That's encouraging. I started this thread to get this issue noticed and hopefully fixed. I'm pretty new with Arduino but have quickly become a bit disillusioned with the apparent lack of will to fix things in the official releases and with that QA in general.

The project seems mature enough that a lot of things should have been a long time back. The heap management is the most outstanding and unacceptable bug.

It really needs to be fixed.
Logged

0
Offline Offline
God Member
*****
Karma: 26
Posts: 610
Always making something...
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

I started this thread to get this issue noticed and hopefully fixed.

Most of the Arduino Team uses Macintosh.  I'm probably the only one who will fix this, and I've tried to explain to you what I need.

Just to be absolutely clear, the observation that it works in one UI elememt but not another IS NOT ENOUGH.  If you want me to fix this, you must dig deeper (or convince someone else to do so).  I'm not a desktop environment or Java/swing UI expert, but if someone points the way with a good technical explanation of why it's not working and with links to relevant and specific documentation, I will work on this.

So, there you have it.  You hoped someone would notice.  I have.  I'm a long-time contributor, and recently the Arduino Team gave me commit access.  I do want to fix this.

But your hope that it will be fixed, merely because you've pointed out the problem, is unrealistic.  This is a minor bug.  Arduino doesn't employ programmers to fix minor issues (and lately there's been a lack of man-hours).  Most of the programmers use Macs.  If you really want this fixed, you're going to have to actually do more than just rant on a forum.  Likewise with the issue tracker.

The ball's in your court!  If you want this fixed, you're going to have to contribute.  This problem isn't going to fix itself.  It's extremely unlikely anyone will work on this with only the limited info you're provided so far.  You don't need to fully develop a patch (I'll do that), but at the very least some in-depth research into what's different between those UI elements is required.  If you're not willing to do that, and nobody else is, then this probably will never get fixed.
« Last Edit: August 13, 2012, 03:39:35 am by Paul Stoffregen » Logged

Global Moderator
Offline Offline
Brattain Member
*****
Karma: 485
Posts: 18810
Lua rocks!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

 This is a minor bug.

If you don't mind my saying. This isn't a bug. It's a feature request.

With all respect to people who run Linux --- of which I am one --- most Mac/Windows users don't expect this behaviour.
Logged


Global Moderator
Offline Offline
Brattain Member
*****
Karma: 485
Posts: 18810
Lua rocks!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

I'm pretty new with Arduino ...

The IDE allows for an external editor. In what way does this not address your problem with copy/paste?
Logged


0
Offline Offline
God Member
*****
Karma: 26
Posts: 610
Always making something...
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

most Mac/Windows users don't expect this behaviour.

I would never try to emulate the X11 style on a platform where users don't expect it.  I only want to make Arduino properly integrate with X11, when actually running on Linux.
Logged

0
Offline Offline
God Member
*****
Karma: 26
Posts: 610
Always making something...
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

I've been looking into this a bit more....

The places where X11 "selection" copy works are due to having the support built in to Java's default GUI widgets.  The places where it doesn't work are where Arduino implements its own... mainly just the edit.  The bad news is there is NOT any already-working code Java within Arduino's IDE than can simply be copied to make X11 selection/clipboard work properly in the places where is currently fails.  It may seem intuitive that Arduino must already contain the proper code since it works in some places, but that is simply not the case.

I did get some partial results by modifying the FocusHandler class in JeditTextArea.java.  Specifically this:

Code:
    public void focusLost(FocusEvent evt)
    {
      //System.out.println("JEditTextArea: focusLost");
      setCaretVisible(false);
      focusedComponent = null;
      Clipboard unixclipboard = getToolkit().getSystemSelection();
      if (unixclipboard != null) {
        String selection = getSelectedText();
        if (selection != null) {
          unixclipboard.setContents(new StringSelection(selection), null);
        }
      }
    }
  }

This is far from perfect.  First, it doesn't work for copying within Arduino itself, but it does allow you to select something in Arduino and then middle-click in another non-Arduino window to paste it.  This also has a major shortcoming where it overwrites the selection from any other window if something is currently selected in Arduino and Arduino gets and loses focus even momentarily (perhaps while moving the mouse over it in focus follow cursor window management mode).

Of course, this only exports data from Arduino and does nothing to allow middle-click within Arduino.

I still do not know how to set up a listener for the actual event of the current selection changing by mouse or keyboard actions.  That really is necessary to truly make this work the way it should.

But maybe sharing this less-than-ideal code might help, in the unlikely case someone (other than me) actually works on this?
Logged

0
Offline Offline
God Member
*****
Karma: 26
Posts: 610
Always making something...
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Update: I got it working!!!!  smiley-twist

Testing now.  Patch coming soon.....
Logged

Pages: 1 2 [3] 4   Go Up
Jump to: