summaryrefslogtreecommitdiff
path: root/src/Fl_Input_.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'src/Fl_Input_.cxx')
-rw-r--r--src/Fl_Input_.cxx14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/Fl_Input_.cxx b/src/Fl_Input_.cxx
index bf96bd4c9..644d954c3 100644
--- a/src/Fl_Input_.cxx
+++ b/src/Fl_Input_.cxx
@@ -339,8 +339,8 @@ void Fl_Input_::drawtext(int X, int Y, int W, int H) {
int offset2;
if (pp <= e) x2 = xpos + (float)expandpos(p, pp, buf, &offset2);
else offset2 = (int) strlen(buf);
-#ifdef __APPLE__ // Mac OS: underline marked ( = selected + Fl::compose_state != 0) text
- if (Fl::compose_state) {
+#ifdef __APPLE__ // Mac OS: underline marked ( = selected + Fl::marked_text_length() != 0) text
+ if (Fl::marked_text_length()) {
fl_color(textcolor());
}
else
@@ -351,8 +351,8 @@ void Fl_Input_::drawtext(int X, int Y, int W, int H) {
fl_color(fl_contrast(textcolor(), selection_color()));
}
fl_draw(buf+offset1, offset2-offset1, x1, (float)(Y+ypos+desc));
-#ifdef __APPLE__ // Mac OS: underline marked ( = selected + Fl::compose_state != 0) text
- if (Fl::compose_state) {
+#ifdef __APPLE__ // Mac OS: underline marked ( = selected + Fl::marked_text_length() != 0) text
+ if (Fl::marked_text_length()) {
fl_color( fl_color_average(textcolor(), color(), 0.6) );
float width = fl_width(buf+offset1, offset2-offset1);
fl_line(x1, Y+ypos+height-1, x1+width, Y+ypos+height-1);
@@ -372,7 +372,11 @@ void Fl_Input_::drawtext(int X, int Y, int W, int H) {
CONTINUE2:
// draw the cursor:
- if (Fl::focus() == this && (Fl::compose_state || selstart == selend) &&
+ if (Fl::focus() == this && (
+#ifdef __APPLE__
+ Fl::marked_text_length() ||
+#endif
+ selstart == selend) &&
position() >= p-value() && position() <= e-value()) {
fl_color(cursor_color());
// cursor position may need to be recomputed (see STR #2486)