Opened 12 years ago

Last modified 10 years ago

#8856 reopened defect

wxGTK: wrong cursor shapes for wxCURSOR_SIZE{NWSE,NESW}

Reported by: jroemmler Owned by:
Priority: low Milestone:
Component: wxGTK Version:
Keywords: Cc: jroemmler, mears
Blocked By: Blocking:
Patch: no

Description

The GTK port does not return the correct cursor shape for wxCURSOR_SIZENWSE and wxCURSOR_SIZENESW. According to the documentation, this should give me two different diagonal cursor shapes, but on GTK, it just gives me a wxCURSOR_SIZING shape (a 4-way arrow shape). I didn't have the time to create a patch, but I assume it is close to trivial to fix it: in wxWidgets-2.8.6/src/gtk/cursor.cpp:95 the two case statements have to select from a different GDK cursor shape:

case wxCURSOR_SIZENWSE:
case wxCURSOR_SIZENESW: gdk_cur = GDK_FLEUR; break;

does the following replacement work: ?

case wxCURSOR_SIZENWSE:

gdk_cur = GDK_BOTTOM_RIGHT_CORNER; break;

case wxCURSOR_SIZENESW:

gdk_cur = GDK_BOTTOM_LEFT_CORNER; break;

Can anyone verify this, please?

Change History (6)

comment:1 Changed 12 years ago by vadz

Looking at pictures at http://www-eleves-isia.cma.fr/documentation/GtkDoc/gdk/gdk-cursors.html I'm not sure whether this is the right replacement as BOTTOM cursors are not symmetric, i.e. they can only be used when resizing by the bottom, not top...

comment:2 Changed 12 years ago by jroemmler

Vadim,
thanks for looking into this. You are right, my suggested cursor shape is not symmetric (didn't find a shape preview, thanks for the link). But I'm also not happy with the current shape, because the 4-way arrow is usually meant for "moving" things. Should wxWidgets really make the assumption of symmetrical cursor shapes (top/left and right/bottom sizing cursor being the same)? GDK doesn't have that, too, as you pointed out correctly)...
I have two suggestions for fixing this:

(1) create a (symmetrical) bitmap cursor for the two mentioned cursor shapes?

(2) add new wxWidgets "stock cursor identifiers", one for resizing in each of 8 possible directions, which are
left, top, right, bottom, upper-left, upper-right, lower-left, lower-right?

comment:3 Changed 12 years ago by vadz

It would make sense to me if we used GDK_SIZING cursor for wxCURSOR_SIZING, I really don't know why wasn't it done like this from the beginning. If nobody objects to it, I'll replace GDK_FLEUR with GDK_SIZING.

As for the other cursors, we could indeed add missing ones, why not -- but someone would need to do it.

comment:4 Changed 12 years ago by jroemmler

Yes, changing wxCURSOR_SIZING from GDK_FLEUR to GDK_SIZING makes absolutely sense to me. You have my vote to change it :-)

I was also hoping to find a replacement for wxCURSOR_SIZENWSE and wxCURSOR_SIZENESW, but I agree that the available GDK cursor shapes don't fit; and as long as the stock wx cursor identifiers are not extended by missing ones we will not be able to use them. Sorry, but I don't have the right wx-knowledge to actually add them - it would also probably break backward compatibility (maybe a candidate for upcoming 3.0 version?), and I'm also not sure about cursor shape support on all the other platforms...

comment:5 Changed 12 years ago by vadz

Ok, I've changed FLEUR to SIZING, the rest will have to wait until someone has time to look at it.

Thanks

comment:6 Changed 10 years ago by vadz

  • Cc mears added; vadz removed
  • Component set to wxGTK
  • Patch unset
  • Status changed from closed to reopened
  • Summary changed from wrong cursor shapes on wxGTK/2.8.6 to wxGTK: wrong cursor shapes for wxCURSOR_SIZE{NWSE,NESW}
  • Type set to defect

Somehow this change has never got done in fact. Looking at it again now (because #11365 brought it up again), I wonder if it's really a good idea to change wxCURSOR_SIZENWSE to use SIZING cursor because it would then be inconsistent with wxCURSOR_SIZENESW.

Does anybody see any better solutions among those shown at http://library.gnome.org/devel/gdk/stable/gdk-Cursors.html?

Note: See TracTickets for help on using tickets.