Skip to content

Commit

Permalink
Avoiding a hidden mouse pointer after a window is hidden
Browse files Browse the repository at this point in the history
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@5654 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
  • Loading branch information
Matthias Melcher committed Feb 2, 2007
1 parent 6bc5329 commit 3df9bdf
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 16 deletions.
1 change: 1 addition & 0 deletions CHANGES
Expand Up @@ -2,6 +2,7 @@ CHANGES IN FLTK 1.1.8

- Documentation fixes (STR #1454, STR #1455, STR #1456,
STR #1457, STR #1458, STR #1460, STR #1481, STR #1578)
- Avoiding hidden mouse pointer in OS X (STR #1475)
- Fixed calculation of character widths for OS X
Quartz rendering (no STR)
- Fixed OS X mouse click handling (STR #1504)
Expand Down
4 changes: 4 additions & 0 deletions src/Fl.cxx
Expand Up @@ -927,6 +927,10 @@ void Fl_Window::hide() {
*pp = ip->next;
#ifdef __APPLE__
MacUnlinkWindow(ip);
// MacOS X manages a single pointer per application. Make sure that hiding
// a toplevel window will not leave us with some random pointer shape, or
// worst case, an invisible pointer
if (!parent()) cursor(FL_CURSOR_DEFAULT);
#endif
i = 0;

Expand Down
34 changes: 18 additions & 16 deletions src/fl_cursor.cxx
Expand Up @@ -202,36 +202,38 @@ static Cursor crsrARROW =
#undef E

void Fl_Window::cursor(Fl_Cursor c, Fl_Color, Fl_Color) {
if (!shown()) return;
if (c == FL_CURSOR_DEFAULT) {
c = cursor_default;
}
CursHandle icrsr = fl_default_cursor;
switch (c) {
case FL_CURSOR_CROSS: i->cursor = GetCursor( crossCursor ); break;
case FL_CURSOR_WAIT: i->cursor = GetCursor( watchCursor ); break;
case FL_CURSOR_INSERT: i->cursor = GetCursor( iBeamCursor ); break;
case FL_CURSOR_CROSS: icrsr = GetCursor( crossCursor ); break;
case FL_CURSOR_WAIT: icrsr = GetCursor( watchCursor ); break;
case FL_CURSOR_INSERT: icrsr = GetCursor( iBeamCursor ); break;
case FL_CURSOR_N:
case FL_CURSOR_S:
case FL_CURSOR_NS: i->cursor = &crsrNSptr; break;
case FL_CURSOR_HELP: i->cursor = &crsrHELPptr; break;
case FL_CURSOR_HAND: i->cursor = &crsrHANDptr; break;
case FL_CURSOR_MOVE: i->cursor = &crsrMOVEptr; break;
case FL_CURSOR_NS: icrsr = &crsrNSptr; break;
case FL_CURSOR_HELP: icrsr = &crsrHELPptr; break;
case FL_CURSOR_HAND: icrsr = &crsrHANDptr; break;
case FL_CURSOR_MOVE: icrsr = &crsrMOVEptr; break;
case FL_CURSOR_NE:
case FL_CURSOR_SW:
case FL_CURSOR_NESW: i->cursor = &crsrNESWptr; break;
case FL_CURSOR_NESW: icrsr = &crsrNESWptr; break;
case FL_CURSOR_E:
case FL_CURSOR_W:
case FL_CURSOR_WE: i->cursor = &crsrWEptr; break;
case FL_CURSOR_WE: icrsr = &crsrWEptr; break;
case FL_CURSOR_SE:
case FL_CURSOR_NW:
case FL_CURSOR_NWSE: i->cursor = &crsrNWSEptr; break;
case FL_CURSOR_NONE: i->cursor = &crsrNONEptr; break;
case FL_CURSOR_ARROW: i->cursor = &crsrARROWptr; break;
case FL_CURSOR_NWSE: icrsr = &crsrNWSEptr; break;
case FL_CURSOR_NONE: icrsr = &crsrNONEptr; break;
case FL_CURSOR_ARROW: icrsr = &crsrARROWptr; break;
case FL_CURSOR_DEFAULT:
default:
i->cursor = fl_default_cursor; break;
default: break;
}
SetCursor( *icrsr );
if (i) {
i->cursor = icrsr;
}
SetCursor( *i->cursor );
}

#else
Expand Down

0 comments on commit 3df9bdf

Please sign in to comment.