Angus Leeming <[EMAIL PROTECTED]> writes: | I guess that this is for Lars: > | Without being rude, why the hell is this code in BufferView::Pimpl | and not in WorkArea:
while not being rude, you have a strange choice of words... | 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()); | } legacy code... | void BufferView::Pimpl::enterView() | { | if (active() && available()) { | SetXtermCursor(workarea_.getWin()); | using_xterm_cursor = true; | } | } this looks fine to me... | void BufferView::Pimpl::leaveView() | { | if (using_xterm_cursor) { | XUndefineCursor(fl_get_display(), workarea_.getWin()); | using_xterm_cursor = false; | } | } apart from the fact that we call XUndefineCursor here directly, this also looks fine. > | In WorkArea it would be: > | case FL_ENTER: | lyxerr[Debug::WORKAREA] << "Workarea event: ENTER" << endl; | fl_set_cursor(workarea_.getWin(), XC_xterm); | //area->workAreaEnter(); | break; | case FL_LEAVE: | lyxerr[Debug::WORKAREA] << "Workarea event: LEAVE" << endl; | Cursor cursor = Dialogs::tooltipsEnabled() ? | XC_question_arrow : FL_DEFAULT_CURSOR; | fl_set_cursor(workarea_.getWin(), cached_cursor); | //area->workAreaLeave(); | break; I am not sure that we want WorkArea to deicde cursor policy for the BufferView. It is not the WorkArea's task to control this. | Lars, would you be happy if I changed this? I can't see the reason for the | current code; it just seems unnecessarily complex. > | Alternatively, if you insist on the BufferView::Pimpl::enterView() and | leaveView(), can we please have a WorkArea method | void setCursor(Cursor cursor) { | fl_set_cursor(workarea_.getWin(), cursor); | } perhaps. | But really, this X11 stuff shouldn't be in BufferView IMO. sure, and fixing this is part of the guii work. -- Lgb