mirror of
https://github.com/fltk/fltk.git
synced 2026-06-05 08:06:35 +08:00
Avoiding a hidden mouse pointer after a window is hidden
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@5654 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
+18
-16
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user