Zim

Mouse cursor disappears on edit

Bug #1157289 reported by Alexei Kojenov
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Zim
Confirmed
Undecided
Unassigned

Bug Description

I actually have two problems with the mouse cursor. Don't know if they are related or just coincidental:

1. The cursor doesn't turn into a "hand" when hovering over a link.

2. The mouse cursor disappears as soon I start editing a page and never appears again. The cursor is missing when the mouse is over the page view. It shows (arrow) while over the index page, but moving the mouse back to the page makes the cursor hides again. The only solution to this is restarting zim.

My zim version is 0.59 on Kubuntu 12.04 32-bit.
Python version is sys.version_info(major=2, minor=7, micro=3, releaselevel='final', serial=0)
Gtk version is (2, 24, 10)
Pygtk version is (2, 24, 0)

It is interesting that my other Kubuntu machine (12.10 64-bit) with the same zim version does not have this issue.

Tags: usability
Revision history for this message
Jaap Karssenberg (jaap.karssenberg) wrote : Re: [Bug 1157289] [NEW] Mouse cursor disappears on edit

Can you run "zim -D" and check for any error output ?

Thanks,

Jaap

On Tue, Mar 19, 2013 at 5:38 PM, aleko74 <email address hidden> wrote:
> Public bug reported:
>
> I actually have two problems with the mouse cursor. Don't know if they
> are related or just coincidental:
>
> 1. The cursor doesn't turn into a "hand" when hovering over a link.
>
> 2. The mouse cursor disappears as soon I start editing a page and never
> appears again. The cursor is missing when the mouse is over the page
> view. It shows (arrow) while over the index page, but moving the mouse
> back to the page makes the cursor hides again. The only solution to this
> is restarting zim.
>
> My zim version is 0.59 on Kubuntu 12.04 32-bit.
> Python version is sys.version_info(major=2, minor=7, micro=3, releaselevel='final', serial=0)
> Gtk version is (2, 24, 10)
> Pygtk version is (2, 24, 0)
>
> It is interesting that my other Kubuntu machine (12.10 64-bit) with the
> same zim version does not have this issue.
>
> ** Affects: zim
> Importance: Undecided
> Status: New
>
>
> ** Tags: usability
>
> --
> You received this bug notification because you are subscribed to Zim.
> https://bugs.launchpad.net/bugs/1157289
>
> Title:
> Mouse cursor disappears on edit
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/zim/+bug/1157289/+subscriptions

Revision history for this message
Alexei Kojenov (alexei-kojenov) wrote :

Jaap, attached is the "zim -D" output. I don't see any errors there, just one warning, but I don't think it's related. Thanks!

Revision history for this message
Jaap Karssenberg (jaap.karssenberg) wrote : Re: [Bug 1157289] Re: Mouse cursor disappears on edit

On Wed, Mar 20, 2013 at 5:13 PM, aleko74 <email address hidden> wrote:
> Jaap, attached is the "zim -D" output. I don't see any errors there,
> just one warning, but I don't think it's related. Thanks!

Agreed, that's not related.

Hard to diagnose if there are no errors, not sure what to do about it.

One way to remove the error might be to edit zim/gui/pageview.py and
comment line 3720

  window.set_cursor(cursor)

in the method "update_cursor()".

Commenting this line will make zim not change the cursor at all, so
cursor should remain as is.

Btw. are you sure the change always happens when you start editing? We
only change the cursor when you move over a link or over an image, but
we do nothing to the cursor when you start editing.

Regards,

Jaap

Revision history for this message
Evan Edwards (evan-z) wrote :

I can confirm this is happening with a pretty stock Kubuntu setup. I can also give a work-around:

Close all zim processes (including the trayicon if you have that enabled), and run:

GDK_NATIVE_WINDOWS=1 zim

As a really goofy quick fix, you can also right click to bring up the context menu, which will also make the pointer reappear.

As a pure guess, the text widget is turning off the mouse pointer when somebody starts typing (a common editor practice), but not turning it back on when the mouse is moved. As a result, this is a very reliable bug: move the mouse into the text space, type a character to make the pointer disappear, then it works *outside* the text space, but is invisible over the text. To make reappear, right click in the text space and it reappears until another key is pressed.

Using the GDK_NATIVE_WINDOWS work-around, the expected behavior occurs: the mouse pointer disappears when a key is pressed, but then reappears as soon as the mouse is moved.

I use the term "text space" because I'm not sure where the boundaries of the effect are, and I'm trying not to make assumptions in a bug report.

Much respect and thanks to all the devs,
Evan 'JabberWokky' Edwards

Changed in zim:
status: New → Confirmed
Revision history for this message
Evan Edwards (evan-z) wrote :

A thought just occurred: it could plausibly be related to hardware acceleration or video driver. Alexei, is there a difference between your two setups in terms of video drivers that might be related? Your comment about the fact that it is happening on one system but not the other -- but with the same software -- made me think of it.

Of course, this is all very likely a lower level bug than zim itself, but knowing the details would probably be useful should this pop up for other users.

Evan 'JabberWokky' Edwards

Revision history for this message
Jaap Karssenberg (jaap.karssenberg) wrote :

On Fri, Mar 22, 2013 at 12:22 PM, Evan Edwards <email address hidden> wrote:
> I can confirm this is happening with a pretty stock Kubuntu setup. I
> can also give a work-around:
>
> Close all zim processes (including the trayicon if you have that
> enabled), and run:
>
> GDK_NATIVE_WINDOWS=1 zim
>
> As a really goofy quick fix, you can also right click to bring up the
> context menu, which will also make the pointer reappear.
>
> As a pure guess, the text widget is turning off the mouse pointer when
> somebody starts typing (a common editor practice), but not turning it
> back on when the mouse is moved. As a result, this is a very reliable
> bug: move the mouse into the text space, type a character to make the
> pointer disappear, then it works *outside* the text space, but is
> invisible over the text. To make reappear, right click in the text
> space and it reappears until another key is pressed.
>
> Using the GDK_NATIVE_WINDOWS work-around, the expected behavior occurs:
> the mouse pointer disappears when a key is pressed, but then reappears
> as soon as the mouse is moved.

Thanks for this information - would not have easily found that myself.

Have to investigate where the problems lies, but sounds like it might
be a problem in the Gtk library itself as it only seems to happen on
Kbuntu.

Regards,

Jaap

Revision history for this message
Jaap Karssenberg (jaap.karssenberg) wrote :

Some background:

Documentation says that GDK_NATIVE_WINDOWS is intended for
applications that mix X and GDK calls.

Zim does change the cursor, but uses a GDK call for this, so in theory
zim should not be affected since we never call X directly.

Also note that this feature is new in Gtk 2.18, have to check gtk
version on my test systems - might be older.

Regards,

Jaap

Revision history for this message
Jaap Karssenberg (jaap.karssenberg) wrote :

Last comment for now:

Could you try out a fix for me?

In "zim/gui/pageview.py" in the method "update_cursor()" around line
3719 there is this snippet:

  if cursor != self._cursor:
   window = self.get_window(gtk.TEXT_WINDOW_TEXT)
   window.set_cursor(cursor)

Please change it the following and check if that resolves the issue:

  if cursor != self._cursor:
   window = self.get_window(gtk.TEXT_WINDOW_TEXT)
   window.ensure_native()
   window.set_cursor(cursor)

Thanks!

Jaap

Revision history for this message
Alexei Kojenov (alexei-kojenov) wrote :

Evan, I can confirm the workaround fixes both issues (hand cursor and cursor hiding)!

There are indeed different graphic cards on the two machines:

* bug is reproduced:
NVIDIA Corporation GT216 [Quadro FX 880M]
driver nvidia-current 304.64-0ubuntu0.2

* bug not reproduced:
NVIDIA Corporation G92 [GeForce 9800 GT]
driver nvidia-current 304.51-0ubuntu1

Jaap, I tried your code fix but it didn't change anything.

Alexei

Revision history for this message
Jaap Karssenberg (jaap.karssenberg) wrote :

On Fri, Mar 22, 2013 at 6:17 PM, aleko74 <email address hidden> wrote:
> Jaap, I tried your code fix but it didn't change anything.

That's a pitty, but it confirms that the issue is outside zim.

Have tested now myself as well on Gtk 2.24 under Ubuntu (unity), I see
no issue, so problem only occurs in some environments.

So far I see no solution I can put in the zim code to fix this - so
above mentioned fix is only option for now.

Regards,

Jaap

Revision history for this message
Evan Edwards (evan-z) wrote :

As an *unconfirmed* (and hard to test for me at this moment) possibility, it may have something to do with the synergy desktop sharing application. Or restarting its server changes something that fixes the problem (not necessarily permanently, but it has been the first thing I've found that affects the bug for me).

Revision history for this message
Diaa Sami (diaa.sami) wrote :

Thanks Evan for noticing the link between synergy and zim, I can confirm it, same happens for me with Tomboy.
As soon as I close synergy server (although no client was connected) and move the mouse, it works properly.

It's not a zim bug it seems.

Revision history for this message
Alexei Kojenov (alexei-kojenov) wrote :

I do not use synergy yet I still experience the issue.

Revision history for this message
kiatoa (estiforta) wrote :

In case it helps tracking down the root cause I'm adding my experience here.

I see the bug manifested both in Zim and in applications I've written using IUP (http://webserver2.tecgraf.puc-rio.br/iup/) and exiting/restarting synergy fixes it for me.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.