Hiding cursor in Fl_Double_Window

158 views
Skip to first unread message

Florent Berthaut

unread,
Mar 1, 2016, 6:06:37 AM3/1/16
to fltk.general
Hi all,

I'm trying to hide the cursor in an Fl_Double_Window with fltk 1.3 and
it does not seem work, either on Linux or Mac.
I have tried window->cursor(FL_CURSOR_NONE), fl_cursor(FL_CURSOR_NONE)
but none of these work.
Am I missing something? Is this an OS related issue ?

Regards,

Florent

--
http://hitmuri.net

MacArthur, Ian (Finmeccanica, UK)

unread,
Mar 1, 2016, 6:16:14 AM3/1/16
to fltkg...@googlegroups.com

> I'm trying to hide the cursor in an Fl_Double_Window with fltk 1.3 and
> it does not seem work, either on Linux or Mac.
> I have tried window->cursor(FL_CURSOR_NONE), fl_cursor(FL_CURSOR_NONE)
> but none of these work.
> Am I missing something? Is this an OS related issue ?


Hmm, this ought to work.

Try the test/cursor.exe program and see if it works (it does for me right now on Win7).

Also, you could look at the sample code I just posted in:

"[fltk.coredev] porting branch: rewrite fl_XXX_offscreen() functions platform independently"

Which messes about setting the cursor (albeit to FL_CURSOR_MOVE, though you could change it to FL_CURSOR_NONE) and see how that goes for you.

Cheers,
--
Ian


Selex ES Ltd
Registered Office: Sigma House, Christopher Martin Road, Basildon, Essex SS14 3EL
A company registered in England & Wales. Company no. 02426132
********************************************************************
This email and any attachments are confidential to the intended
recipient and may also be privileged. If you are not the intended
recipient please delete it from your system and notify the sender.
You should not copy it or use it for any purpose nor disclose or
distribute its contents to any other person.
********************************************************************

Albrecht Schlosser

unread,
Mar 1, 2016, 6:20:47 AM3/1/16
to fltkg...@googlegroups.com
On 01.03.2016 12:06 Florent Berthaut wrote:

> I'm trying to hide the cursor in an Fl_Double_Window with fltk 1.3 and
> it does not seem work, either on Linux or Mac.
> I have tried window->cursor(FL_CURSOR_NONE), fl_cursor(FL_CURSOR_NONE)
> but none of these work.

Take a look at test/cursor.cxx. Does it work for you?

> Am I missing something? Is this an OS related issue ?

test/cursor works for me under both Windows and Linux, but indeed, under
Linux FL_CURSOR_NONE shows a cursor, whereas Windows does not. So it
seems we have a platform specific problem.

MacArthur, Ian (Finmeccanica, UK)

unread,
Mar 1, 2016, 6:35:01 AM3/1/16
to fltkg...@googlegroups.com
> > I'm trying to hide the cursor in an Fl_Double_Window with fltk 1.3
> and
> > it does not seem work, either on Linux or Mac.
> > I have tried window->cursor(FL_CURSOR_NONE),
> fl_cursor(FL_CURSOR_NONE)
> > but none of these work.
>
> Take a look at test/cursor.cxx. Does it work for you?
>
> > Am I missing something? Is this an OS related issue ?
>
> test/cursor works for me under both Windows and Linux, but indeed,
> under
> Linux FL_CURSOR_NONE shows a cursor, whereas Windows does not. So it
> seems we have a platform specific problem.

Hmm; I just tried test/cursor on my F17/ Gnome test box and FL_CURSOR_NONE works correctly (i.e. the cursor goes away when in the app window) so it seems it is not platform specific.

I wonder if it might be WM specific though?

Mind you, the fltk on that test box is probably a bot older - I might try a more recent tarball in case it is something we broke fairly recently!

Florent Berthaut

unread,
Mar 1, 2016, 6:38:30 AM3/1/16
to fltkg...@googlegroups.com
On 01/03/16 11:34, MacArthur, Ian (Finmeccanica, UK) wrote:
> Hmm; I just tried test/cursor on my F17/ Gnome test box and FL_CURSOR_NONE works correctly (i.e. the cursor goes away when in the app window) so it seems it is not platform specific.

FL_CURSOR_NONE actually works in test/cursor (at least on Linux) ... so
I might be doing something wrong there.


Florent

--
http://hitmuri.net

MacArthur, Ian (Finmeccanica, UK)

unread,
Mar 1, 2016, 6:41:01 AM3/1/16
to fltkg...@googlegroups.com
> On 01/03/16 11:34, MacArthur, Ian (Finmeccanica, UK) wrote:
> > Hmm; I just tried test/cursor on my F17/ Gnome test box and
> FL_CURSOR_NONE works correctly (i.e. the cursor goes away when in the
> app window) so it seems it is not platform specific.
>
> FL_CURSOR_NONE actually works in test/cursor (at least on Linux) ... so
> I might be doing something wrong there.


Does my offscreen_test code work for you? It would be trivial to try different cursor types in that for testing...

(And I'm interested to hear if it actually builds/works correctly for others anyway!)

Cheers,
--
Ian

Edzard Egberts

unread,
Mar 1, 2016, 7:15:28 AM3/1/16
to 'ed' via fltk.general
Florent Berthaut wrote:
> On 01/03/16 11:34, MacArthur, Ian (Finmeccanica, UK) wrote:
>> Hmm; I just tried test/cursor on my F17/ Gnome test box and
>> FL_CURSOR_NONE works correctly (i.e. the cursor goes away when in the
>> app window) so it seems it is not platform specific.
>
> FL_CURSOR_NONE actually works in test/cursor (at least on Linux) ... so
> I might be doing something wrong there.

Was the window shown before you called the cursor() functions? Maybe
even Fl_Window->wait_for_expose() is necessary to call, when the cursor
call follows directly on Fl_Window->show().

MacArthur, Ian (Finmeccanica, UK)

unread,
Mar 1, 2016, 7:44:41 AM3/1/16
to fltkg...@googlegroups.com
> Was the window shown before you called the cursor() functions? Maybe
> even Fl_Window->wait_for_expose() is necessary to call, when the cursor
> call follows directly on Fl_Window->show().


For my part, I always change the cursor in the handle() method, in response to FL_ENTER, FL_LEAVE etc.

That way, I'm pretty sure the window context is going to be OK at that point!

MacArthur, Ian (Finmeccanica, UK)

unread,
Mar 1, 2016, 8:23:22 AM3/1/16
to fltkg...@googlegroups.com
> Mind you, the fltk on that test box is probably a bot older - I might
> try a more recent tarball in case it is something we broke fairly
> recently!

For the record: tested on F17/Gnome with 1.3.x r11217 (the most recent weekly) and it works fine, so I do not think we have broken anything.

Albrecht Schlosser

unread,
Mar 1, 2016, 10:30:17 AM3/1/16
to fltkg...@googlegroups.com
On 01.03.2016 14:23 MacArthur, Ian (Finmeccanica, UK) wrote:
> > Mind you, the fltk on that test box is probably a bot older - I might
>> try a more recent tarball in case it is something we broke fairly
>> recently!
>
> For the record: tested on F17/Gnome with 1.3.x r11217 (the most recent weekly) and it works fine, so I do not think we have broken anything.

Yep, confirmed with my Ubuntu (14.04) system.

When run on the original desktop (in my Virtualbox VM) FL_CURSOR NONE
works fine. I don't know which WM it is actually...

When run on X2Go client with ICEWM it shows a strange behavior, as if it
just ignores the cursor setting and keeps the last used cursor. This
means if I move the cursor (slowly!) from the right side into the window
I get the same as FL_CURSOR_E. This is the cursor used when _crossing_
the window border (showing the option to resize the window to the right
side == east). Different (but consisten) cursors are shown when moving
the cursor slowly into the window from other sides. Moving the cursor
faster, however, "skipping" the border, then the normal cursor used
outside the window stays.

When run with an X server on my Windows box with the "remote" linux VM
(using ssh) I get another cursor, something like the "I" (or "beam"?)
cursor used when editing text. So yes, it is consistent, but it is not
NO cursor.

Always these WM differences ... sigh :-(

Florent Berthaut

unread,
Mar 1, 2016, 11:36:02 AM3/1/16
to fltkg...@googlegroups.com
Hi all,

So it seems to be working fine actually with the latest tarball.
Something must be wrong with the debian package i was using.

Florent

--
http://hitmuri.net

Reply all
Reply to author
Forward
0 new messages