Gives us a well behaved and configurable cursor in the main window as well as in the dialogs (fixes bug #73). Angus
Index: src/BufferView_pimpl.C =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/BufferView_pimpl.C,v retrieving revision 1.212 diff -u -p -r1.212 BufferView_pimpl.C --- src/BufferView_pimpl.C 12 Mar 2002 13:27:49 -0000 1.212 +++ src/BufferView_pimpl.C 13 Mar 2002 11:27:11 -0000 @@ -107,20 +107,6 @@ void waitForX() XSync(fl_get_display(), 0); } - -void SetXtermCursor(Window win) -{ - static Cursor cursor; - static bool cursor_undefined = true; - if (cursor_undefined) { - cursor = XCreateFontCursor(fl_get_display(), XC_xterm); - XFlush(fl_get_display()); - cursor_undefined = false; - } - XDefineCursor(fl_get_display(), win, cursor); - XFlush(fl_get_display()); -} - } // anon namespace @@ -773,7 +759,7 @@ void BufferView::Pimpl::selectionLost() void BufferView::Pimpl::enterView() { if (active() && available()) { - SetXtermCursor(workarea_.getWin()); + fl_set_cursor(workarea_.getWin(), XC_xterm); using_xterm_cursor = true; } } @@ -782,7 +768,9 @@ void BufferView::Pimpl::enterView() void BufferView::Pimpl::leaveView() { if (using_xterm_cursor) { - XUndefineCursor(fl_get_display(), workarea_.getWin()); + Cursor const cursor = Dialogs::tooltipsEnabled() ? + XC_question_arrow : FL_DEFAULT_CURSOR; + fl_set_cursor(workarea_.getWin(), cursor); using_xterm_cursor = false; } }