bugGNU Octave - Bugs: bug #41814, GUI: After start, terminal has...

 
 

bug #41814: GUI: After start, terminal has focus but doesn't show cursor on Windows

Submitted by:  Philip Nienhuis <philipnienhuis>
Submitted on:  Sun 09 Mar 2014 10:06:31 PM UTC  
 
Category:  GUI Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Incorrect Result
Status:  Fixed Assigned to:  None
Originator Name:  Philip Nienhuis Open/Closed:  Closed
Release:  3.8.1 Operating System:  Microsoft Windows

Add a New Comment (Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

( Jump to the original submission)

Sat 05 Apr 2014 09:16:42 PM UTC, comment #33: 

Per comment 29, 30, marking issue as fixed.

John Donoghue <lostbard>
Project Member
Sat 05 Apr 2014 04:36:40 AM UTC, comment #32: 
John Donoghue <lostbard>
Project Member
Sat 05 Apr 2014 12:40:24 AM UTC, comment #31: 

ok - I will push the patch as soon as it finished the current compile it is doing on my machine

John Donoghue <lostbard>
Project Member
Fri 04 Apr 2014 09:51:30 PM UTC, comment #30: 

And -as expected- works for 3.8.1 as well.

Philip Nienhuis <philipnienhuis>
Project Member
Fri 04 Apr 2014 08:41:11 PM UTC, comment #29: 

@John D, your patch works OK at least w. 4.1.0+, I'll trust it'll work with 3.8.1 too.

No complaints/warnings from gcc (I searched it for messages related to "QWinTerminal")

Philip Nienhuis <philipnienhuis>
Project Member
Fri 04 Apr 2014 07:39:17 PM UTC, comment #28: 

Your change looks like the right thing to do.  I guess this is my fault for not initializing all the variables when I added the blinking cursor feature.

The only change I would make is to make the order of the initializers be the same as the order of the member variable declarations in the class.  Otherwise, I think gcc will warn about it.

John W. Eaton <jwe>
Project Administrator
Fri 04 Apr 2014 07:23:48 PM UTC, comment #27: 

And in english:

The comma shouldn't be there.

I had reformated the changes and removed the debug statements just before recreating the patch and forgot to remove the comment.

I have updated the patch to remove it and will push to the stable branch after you have verified it works for you, unless there are any objections or issues.

John Donoghue <lostbard>
Project Member
Fri 04 Apr 2014 07:12:51 PM UTC, comment #26: 

No - shouldnt be needed - I the code change before creating the final patch and forgot to remove the unneeded comma.

Updated patch to remove it.

I will push to stable? if it works for you.

(file #31129)

John Donoghue <lostbard>
Project Member
Fri 04 Apr 2014 07:07:01 PM UTC, comment #25: 

Ah, so an uninitialized variable after all?

@John D: is the trailing comma in the patch really right?
(Trying to build w/o it now)

Philip Nienhuis <philipnienhuis>
Project Member
Fri 04 Apr 2014 06:22:57 PM UTC, comment #24: 

John, I haven't tried the patch yet (the error did not show up on my win system recently) but I think you found the solution.

Philip, you are right. My last patch (compared to the previous one) makes no difference concerning starting the timer.

Torsten Lilge <ttl>
Project Member
Fri 04 Apr 2014 05:37:06 PM UTC, comment #23: 

I did some debug messages in the focus in and out event and the cursor blinking variable seems to have weird values at the start.

This patch (attached) without the others appears to work consistently on my win machine.

(file #31127)

John Donoghue <lostbard>
Project Member
Fri 04 Apr 2014 03:05:40 PM UTC, comment #22: 

Sorry, Torsten, doesn't work.

Then a word of appreciation: Thanks for your hard work! even on such an minor cosmetic issue (but a nasty one at that), not to forget the many other GUI things you did.

Looking at the series of patches, I think the latest is essentially rewording two mutually exclusive IFs into an IF-ELSE, so I didn't expect it to change much.

What I see is this (I use the block cursor):

- When I start Octave, there's no cursor at all.
- After a click in another pane, I see an inactive cursor appearing in the terminal - i.e., an non-blinking open rectangle.
- As soon as I then click in the terminal pane, the cursor starts blinking.
- When I later click in another pane or elsewhere on the desktop, the inactive cursor appears again.

So IMO the issue doesn't look to be not starting to blink, but rather failing to show the cursor in the first place, at all.

As John D just wrote (and I did in the original report), everything else works OK, including accepting input.

Puzzling.....

Philip Nienhuis <philipnienhuis>
Project Member
Fri 04 Apr 2014 12:18:15 PM UTC, comment #21: 

I installed both the bug41814.patch and bug41814.patch to my mxe-octave 3.8.1 build and rebuilt octave.

Still the same issue for me - sometimes it works ok, but more often than not there is no cursor yet I can type into the terminal window.

John Donoghue <lostbard>
Project Member
Thu 03 Apr 2014 02:06:45 PM UTC, comment #20: 

And here the missing attachment :-)

(file #31115)

Torsten Lilge <ttl>
Project Member
Thu 03 Apr 2014 11:23:33 AM UTC, comment #19: 

Attached is another patch that has to be applied instead of the previous one (bug41814_v01.patch).

The patch bug41814.patch was pushed by changeset http://hg.savannah.gnu.org/hgweb/octave/rev/6b4f9cab88d6 and should have found its way into the gui-release and the default branch by now.

Torsten Lilge <ttl>
Project Member
Sat 29 Mar 2014 12:09:05 PM UTC, comment #18: 

FYI I also have the previous patch applied in both 3.8.1 & 4.1.0+

Philip Nienhuis <philipnienhuis>
Project Member
Sat 29 Mar 2014 12:06:30 PM UTC, comment #17: 

Yes there may be something in that timing issue:

On my (somewhat older & slower) WinXP Core Duo desktop, this bug shows up consistently, with or without patch.

On my (faster) Core i5 laptop, a 'fresh' Octave-3.8.1 build (with the patch) showed a blinking cursor only at the first start. Next tries => no cursor (until after first focus shift to terminal pane).
The odd thing is that after starting another Octave version (4.1.0+, with the patch) I now see a nice blinking cursor immediately - yesterday I didn't see it. A next start of 4.1.0+ => no cursor.
Upon the next first start of the fresh 3.8.1 I do see the blinking cursor again.
==> So, alternating between Octave versions helps getting it to work. But not reliably - very often it works, sometimes not.

This smells of some uninitialized memory affecting blinking.

FYI, wiping qt-settings and starting anew makes no difference.

Philip Nienhuis <philipnienhuis>
Project Member
Fri 28 Mar 2014 10:21:17 PM UTC, comment #16: 

Yes, for me it works. But it may be a timing problem that sometimes leads to the (necessary) focus change during start up depending on the order of the dock widget's initializations. That could also be the reason why the behavior shows up in 3.8.1 although there wasn't a change concerning the cursor.

Torsten Lilge <ttl>
Project Member
Fri 28 Mar 2014 10:01:47 PM UTC, comment #15: 

Unfortunately I see no improvement.
I'm building again to verify, somewhere tomorrow (Sat) I'll report back.
Does it work at your box?

It makes me wonder: what has changed between 3.8.0 (where it worked correctly) and 3.8.1?

Philip Nienhuis <philipnienhuis>
Project Member
Thu 27 Mar 2014 04:27:22 PM UTC, comment #14: 

Philip, could you please test the attached patch bug41814_v01.patch? It solves the issue on my win system.

(file #31062)

Torsten Lilge <ttl>
Project Member
Thu 27 Mar 2014 02:32:39 PM UTC, comment #13: 

My mistake, it really needs a focus change.

Torsten Lilge <ttl>
Project Member
Thu 27 Mar 2014 01:54:33 PM UTC, comment #12: 

? That's different than on my boxes.

Here, typing a character into the terminal with a non-showing cursor (set to "blinking") immediately after startup, doesn't make the cursor appear.
There needs to be a focus shift from and back to the terminal pane to get the blinking cursor shown.

Normally, after startup a cursor shows immediately when (during) the copyright messages appear in the terminal (before the prompt comes).
On Windows, with a cursor set to "blinking", it simply doesn't show at all (until focus shifts).

(flagrant guessing by me: it is as if the blinking simply isn't started; it seems like it must be triggered but the trigger only comes after focus is sent explicitly to the terminal.)

Philip Nienhuis <philipnienhuis>
Project Member
Thu 27 Mar 2014 11:56:23 AM UTC, comment #11: 

I can confirm now (3.8.1) that a blinking cursor does not show up in the terminal before a character is entered.

Torsten Lilge <ttl>
Project Member
Wed 19 Mar 2014 09:35:30 PM UTC, comment #10: 

With older mxe-octave: no difference (as I expected)

Philip Nienhuis <philipnienhuis>
Project Member
Wed 19 Mar 2014 03:52:48 PM UTC, comment #9: 

Thx, no hurry.
With a non-blinking cursor things work as expected.

Tonight I might have time to check a 3.8.1 (& 4.1.0+) build with an older mxe-octave build tree I still have lying around.
Not that I expect much change, but just to be sure.

Philip Nienhuis <philipnienhuis>
Project Member
Wed 19 Mar 2014 05:38:03 AM UTC, comment #8: 

Okay, I will have a look as soon I am able to make mxe cross build from the gui-release branch again. Right now I am stuck with undefined reference messages related to opengl.

Torsten Lilge <ttl>
Project Member
Tue 18 Mar 2014 03:12:22 PM UTC, comment #7: 

(sorry for late response, I had other pressing priorities last weeks)

Reopening this bug report as it didn't help on my MXE cross-builds for Windows. Adapted title to reflect Windows builds are still affected.

I've applied the patch (manually) to 3.8.1 & 4.1.0+, to no avail.
The patch does look like a right thing to do. But - I do not see how the blinking/no-blinking cursor symptom fits into it (see comment #3). That is very reliably reproducible on all my 3 windows boxes.

Updated my mxe tree, rebuilt - no luck.

Philip Nienhuis <philipnienhuis>
Project Member
Sat 15 Mar 2014 08:25:51 PM UTC, comment #6: 

I have pushed the patch with changeset
http://hg.savannah.gnu.org/hgweb/octave/rev/6b4f9cab88d6
We can reopen the report if the issue remains in windows

Torsten Lilge <ttl>
Project Member
Wed 12 Mar 2014 10:49:38 AM UTC, comment #5: 

That fixed it for my fedora linux build

John Donoghue <lostbard>
Project Member
Wed 12 Mar 2014 07:07:38 AM UTC, comment #4: 

Could you please test the attached patch? It fixes the issue on my system.

(file #30873)

Torsten Lilge <ttl>
Project Member
Wed 12 Mar 2014 06:58:13 AM UTC, comment #3: 

I usually have the editor detached.

Some more investigation shows that there's no cursor after start if it is set to 'blinking' (any type of cursor) - after clearing the 'blinking' check box and restarting Octave a cursor is shown in the terminal, and after setting no cursor is shown initially.

BTW no need to click - a focus change suffices. So perhaps it could have something to do with "focus follows mouse" settings (using TweakUI powertoy); but why then does it all work correctly with Octave-3.8.0?
This same issue happens on Win7 boxes where I have a fairly "plain vanilla" Windows installation.

Later today I can check with 4.1.0+ (just built overnight)

Philip Nienhuis <philipnienhuis>
Project Member
Wed 12 Mar 2014 01:37:13 AM UTC, comment #2: 

Perhaps related, on running the current devel code from the gui-release branch in linux (fedora, kde), I have the cursor shown and blinking in both the editor and the console.
When I type something it appears in the editor. Clicking in another octave window sets states correctly.

This is with the non-default window set up as shown in the attached image, where both the editor and comsole are displayed at the same time on startup.


John Donoghue <lostbard>
Project Member
Mon 10 Mar 2014 02:22:12 AM UTC, comment #1: 

On my build, I see the cursor blinking within the console after startup and can type into the console etc without having to click anywhere else.

John Donoghue <lostbard>
Project Member
Sun 09 Mar 2014 10:06:31 PM UTC, original submission:  

With MXE cross-built 3.8.1

After start of Octave I see no cursor, but the terminal does accept and echo input.
A cursor only shows up after first clicking in any other pane, then in the terminal pane.

This is actually a regression from 3.8.0 (perhaps a minor one at that), but before marking it as such I think this should be confirmed by others users.

Philip Nienhuis <philipnienhuis>
Project Member

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

Attached Files
file #31129:  term-focus.patch added by lostbard (1KiB - text/x-patch - update to remove extra comma)
file #31127:  term-focus.patch added by lostbard (1KiB - text/x-patch - Initialize blinkingCursor variable)
file #31115:  bug41814_v02.patch added by ttl (931B - text/x-diff)
file #31062:  bug41814_v01.patch added by ttl (901B - text/x-diff)
file #30873:  bug41814.patch added by ttl (829B - text/x-diff)
file #30868:  octave-win-config.png added by lostbard (152KiB - image/png - my octave window setup)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by jwe (Posted a comment)
  • -email is unavailable- added by ttl (Updated the item)
  • -email is unavailable- added by lostbard (Posted a comment)
  • -email is unavailable- added by philipnienhuis (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can add your encouragement to it.
    This task has 0 encouragements so far.

    Only project members can vote.

     

     

     

    Follow 15 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2014-04-05 lostbard StatusReady For Test => Fixed
        Open/ClosedOpen => Closed
    2014-04-05 lostbard StatusNone => Ready For Test
    2014-04-04 lostbard Attached File- => Added term-focus.patch, #31129
    2014-04-04 lostbard Attached File- => Added term-focus.patch, #31127
    2014-04-03 ttl Attached File- => Added bug41814_v02.patch, #31115
    2014-03-27 ttl Attached File- => Added bug41814_v01.patch, #31062
    2014-03-18 philipnienhuis StatusFixed => None
        Open/ClosedClosed => Open
        SummaryGUI: After start, terminal has focus but doesn\'t show cursor => GUI: After start, terminal has focus but doesn't show cursor on Windows
    2014-03-15 ttl StatusPatch Submitted => Fixed
        Open/ClosedOpen => Closed
    2014-03-12 ttl Attached File- => Added bug41814.patch, #30873
        StatusNone => Patch Submitted
    2014-03-12 lostbard Attached File- => Added octave-win-config.png, #30868

    Back to the top


    Powered by Savane 3.5