Opened 9 years ago

Closed 9 years ago

Last modified 8 years ago

#4056 closed defect (fixed)

Write. text selection have fg & bg black

Reported by: godiard Owned by: godiard
Priority: Unspecified by Maintainer Milestone:
Component: Write Version: Unspecified
Severity: Unspecified Keywords: r+, 13.1.0, olpc-test-passed
Cc: Distribution/OS: Unspecified
Bug Status: Unconfirmed

Description (last modified by godiard)

Similar to #4055, but didn't found the solution yet.

When use abiword in gnome, the selection have a blue background and in sugar have a black background.

Attachments (2)

override_selection_color.diff (1.1 KB) - added by godiard 9 years ago.
0001-Add-theming-for-Abiword-text-selection-SL-4056.patch (817 bytes) - added by godiard 9 years ago.

Download all attachments as: .zip

Change History (9)

comment:1 Changed 9 years ago by godiard

  • Description modified (diff)

comment:2 Changed 9 years ago by godiard

Tried different options:

  • Set the color in the css, as:
    AbiWidget *:selected {
       background-color: @selection_grey;
  • Override the color in the activity:
    diff --git a/ b/
    index 2dff90b..f594709 100644
    --- a/
    +++ b/
    @@ -25,6 +25,7 @@ from gi.repository import GObject
     from gi.repository import Gtk
    +from gi.repository import Gdk
     from gi.repository import Abi
     from gi.repository import GdkPixbuf
     import telepathy
    @@ -215,6 +216,15 @@ class AbiWordActivity(activity.Activity):
    +        # set selection color
    +        selection_color = style.Color('#A6A6A6')
    +        rgba = Gdk.RGBA()
    +,,, rgba.alpha = \
    +                                                selection_color.get_rgba()
    +        logging.error('set selection bacground %s', rgba)
    +        self.abiword_canvas.override_background_color(Gtk.StateFlags.SELECTED,
    +                rgba)
         def get_preview(self):
             if not hasattr(self.abiword_canvas, 'render_page_to_image'):
                 return activity.Activity.get_preview(self)

I think the code relevant in abiword is in wp/ap/gtk/ap_UnixFrameImpl.cpp method AP_UnixFrameImpl::getColorSelBackground

Changed 9 years ago by godiard

comment:3 Changed 9 years ago by garnacho

Rendering in Abiword is delegated to an internal widget deriving from GtkDrawingArea, so the CSS rule that does black on black is likely aiming to theme those generically, a more specific rule can be set in the theme to specifically fix this for Abiword text view:

ApDocView:selected {

color: ...;
background-color: ...;


comment:4 Changed 9 years ago by manuq

  • Resolution set to fixed
  • Status changed from new to closed

Thanks Carlos, pushed to artwork together with the Evince styling.

comment:5 Changed 9 years ago by manuq

  • Keywords r+ 13.1.0 olpc-test-pending added

comment:6 Changed 8 years ago by greenfeld

  • Keywords olpc-test-passed added; olpc-test-pending removed

Selected text will always be shown with black text and highlighted in gray (regardless of original text color) in OLPC 13.1.0 os8.

comment:7 Changed 8 years ago by dnarvaez

  • Milestone 0.98 deleted

Milestone 0.98 deleted

Note: See TracTickets for help on using tickets.