Black background on GtkSourceView widget

Bug #1019380 reported by Dr. Amr Osman on 2012-06-29
This bug affects 13 people
Affects Status Importance Assigned to Milestone
Umang Varma

Bug Description

There is a black background on sticky notes when yellow is intended. Somehow, the GtkCssProvider doesn't respect or support the transparent background set to the TextView widget.

This bug initially reported the following issues:

Using stiky notes 0.1 in ubuntu with ambiance theme there is alot of bad UI
1) no monochrome Icon
2) using icons on buttons is against gnome recent behavior and generates inconsistencies (Now tracked separately on Bug #1021028)
3) the sticky note background color is black and font color is dark
4) sticky notes should use a simple handwriting font

Umang Varma (umang) wrote :


Thank you for your comments.

1. I am planing to make a monochrome Icon soon. As this is the first release, I had not researched ways to have the icon depend on the current icon theme without touching the /usr/share/icons directory. I think this should be easy to do.

2. Thanks for bringing this point out. I did notice that icons on buttons were discouraged. However, I am not comfortable replacing them with text. I think that when a program has three buttons, there isn't much to poke at. Further, native gnome apps often use buttons themselves. Nautilus, for example, has back and forward buttons. In my opinion, for a simple application like Indicator StickyNotes, there is no benefit of switching to labels.

3. Hmm. Do the notes not look like this for you? If they don't, please attach a screenshot and the exact version of Ubuntu you are using along with which desktop environment you are using (check using echo $DESKTOP_SESSION).

4. That's an interesting point. I've thought about it. Do you have a font in mind? I am not keen on using a font that doesn't ship by default on Ubuntu and most Linux distributions. However, is there is one that is available is most repositories (or at the very least Ubuntu's repository), I would be open to considering it.


Dr. Amr Osman (dr3mro) wrote :

ubuntu 12.04 .. with unity 5.12
dr3mro@Amilo:~$ echo $DESKTOP_SESSION

screen shot :


i will search for a font for you !!

Dr. Amr Osman (dr3mro) wrote :

Oh .. wait
I have experinence in developing apps for linux
may i join your team
i can create a daily ppa
and stable ppa for indicator-stickynotes
and make contributions to the code :)

Umang Varma (umang) wrote :

Thanks for the screenshot, that is not what I expected. I'll need to look into this further.

Sure! I'm not sure if a small app like Indicator StickyNotes needs more than one PPA, but if you want to submit code, just branch my repository and send me either a patch or pull request or github. (I like git better, so I use github for code hosting). If you like bzr, feel free to make a bzr branch on Launchpad. I'm sure it should be easy to extract a patch from bzr and apply to git. If you're trying to fix a specific issue or add a new feature, file a bug for each issue and use a separate branch for each new feature/issue.

Umang Varma (umang) wrote :

I've got basic monochrome icons in the repository.

Could you send me more details about the black background you noticed. Does it happen all the time? Does it happen if you reinstall indicator-stickynotes? Does it happen only with certain settings? Could you try downloading the latest source code from and running ? Do you still see the black background?


Dr. Amr Osman (dr3mro) wrote :

yes it happens all the time
I use ubuntu 12.04 with gnome3 ppa to get some of 3.4 gnome pkgs that didn't reach the main repos but i don't think that is the cause
i use unity with latest updates and 3.5 kernel

Dr. Amr Osman (dr3mro) wrote :

and yes it still happen with the git version

Umang Varma (umang) on 2012-07-04
description: updated
Changed in indicator-stickynotes:
status: New → Confirmed
importance: Undecided → Medium
assignee: nobody → Umang Varma (umang)
summary: - stikcy notes UI
+ Black background on GtkSourceView widget
Umang Varma (umang) wrote :

Hmm. I've tried hard to reproduce this but haven't been able to.

Could you try again with this download?

Umang Varma (umang) wrote :

Also, if that doesn't fix it, could you run `find . -iname "*sourceview*"` in your home directory (without the `backticks`, obviously) and tell me if there is any output? (it might take a while). I feel as though some sourceview setting, probably theme, is overriding the background set in style.css.

You're also not the only one with this issue:

Dr. Amr Osman (dr3mro) wrote :

sudo find / -iname "*sourceview*"
[sudo] password for dr3mro:

Umang Varma (umang) wrote :

OK. So, I'm assuming that the new github file didn't fix it for you. I'm going to try to examine this further on a virtual machine. If you ever manage to find a clue as to why this is happening, let me know.

Umang Varma (umang) wrote :

Also, do you have the same version of GtkSourceView that I have?

$ apt-cache policy libgtksourceview-3.0-0
  Installed: 3.4.2-0ubuntu1
  Candidate: 3.4.2-0ubuntu1

Dr. Amr Osman (dr3mro) wrote :

  Installed: 3.4.2-0ubuntu1
  Candidate: 3.4.2-0ubuntu1
  Version table:
 *** 3.4.2-0ubuntu1 0
        500 precise-updates/main i386 Packages
        100 /var/lib/dpkg/status
     3.4.1-0ubuntu1 0
        500 precise/main i386 Packages

Dr. Amr Osman (dr3mro) wrote :

I have found a work around and here is the diff

< GtkTextView
> GtkSourceView
< /*background-image-source: -gtk-gradient(linear,
< left top, right bottom,
< from(#ff0), to(#0ff));*/
< background-color:transparent;
> background-image: -gtk-gradient(linear,
> left top, left bottom,
> color-stop (0.0, #ff7),
> color-stop (0.0, #fe0));
< GtkTextView:selected
> GtkSourceView:selected
< color-stop (0, #ff7),
< color-stop (0.66, #fe0));
> color-stop (0.0, #ff7),
> color-stop (0.0, #fe0));

Umang Varma (umang) wrote :

Thanks for your patch!

I applied the patch, but that didn't help. I had tried setting the gradient on the SourceView initially, but that always set it to a flat color rather than a gradient and I seem to have the same problem here.

I wonder why GtkSourceView doesn't like transparent backgrounds on some computers. I have tried very hard to reproduce this in three different virtual machines (one with regular Unity, one with a GNOME3 desktop environment, and a final with the GNOME 3.4 PPA). I've tried installing GtkSourceView themes, but even that doesn't affect the stickynotes.

On 07/07/2012 03:26 PM, Umang Varma wrote:
> I wonder why GtkSourceView doesn't like transparent backgrounds on some
> computers. I have tried very hard to reproduce this in three different
> virtual machines (one with regular Unity, one with a GNOME3 desktop
> environment, and a final with the GNOME 3.4 PPA). I've tried installing
> GtkSourceView themes, but even that doesn't affect the stickynotes.

Might be due to some hardware issues with transparency !!

Umang Varma (umang) wrote :

Hmm. Do you have hardware acceleration? I have disabled acceleration on my virtual machines and it still works fine.

Dr. Amr Osman (dr3mro) wrote :

On 07/07/2012 03:48 PM, Umang Varma wrote:
> s and it still works fine.
yes i have hardware acc intel gma 450 and unity 3d works fine
but when i modified the code to make it loss the dark background yes it
lacks the gradient but better than dark ..
i dont know but it might be a bug with gtk ?

Umang Varma (umang) wrote :

Yes, probably. If you're interested in helping me find out what causes this, could you take install Ubuntu 12.04 in VirtualBox (or similar) and install indicator-stickynotes on it. Then, step-by-step install your ppas and themes onto it and see what causes it to break. My guess is that it's probably some GNOME/GTK related package or a Gtk or GtkSourceView theme that breaks it. Don't do it if it seems like too much to do, I'll keep investigating anyway.

Thanks again for your help with this.

Umang Varma (umang) wrote :


If you have upgraded to 12.10, could you see if you are still affected?

Changed in indicator-stickynotes:
status: Confirmed → Incomplete
Patrick (patrickstar777) wrote :

I don't know about this, but this bug might have to do with GTK or something since:

I also get the black text on black ground when renaming folders or files in nautilus or nemo (the text-field that turns black when being edited, text is only readable when selected, just like on the sticky-notes).

Umang Varma (umang) wrote :

The latest version probably fixes this issue. This was possibly the same issue as lp:1246283 which was fixed earlier. Please unmark as duplicate if you are still affected.

Umang Varma (umang) wrote :

lp:1353990 seems to suggest this is not fixed. I am reopening this bug. Any ideas as to what might be causing this are welcome.

Changed in indicator-stickynotes:
status: Incomplete → Confirmed
Jose (jose75x) wrote :

I have the same black backgroud problem. Reinstall doesn't fix it.

I use Linux Lite 2.0 (Ubuntu 14.04 LTS 32bit kernel version: 3.13.0-34) and version of indicator-stickynotes 0.4.4.

But it's strange because it was working fine, but yesterday the problem appears.

I have a backup copy of my system in a live CD and there stickynotes is working fine, so I did this in both system and live CD:

dpkg --get-selections | grep -v deinstall > ubuntu-files

This creates a text file with the installed packages, later i have compared both with diffuse, and the packages are the same in both systems, so I don't know what is the problem.

Some more info:

 $ apt-cache policy libgtksourceview-3.0-1
  Installed: 3.10.2-0ubuntu1
  Candidate: 3.10.2-0ubuntu1
  Version table:
 *** 3.10.2-0ubuntu1 0
        500 trusty/main i386 Packages
        100 /var/lib/dpkg/status

Hope this problem will be resolved, it's a nice utility.


Daniel Philipp (danphil7) wrote :

This bug affects me as well. I use Ubuntu 14.10 with indicator-stickynotes 0.4.4 from your ppa. No idea what causes this since I'm running it on a relatively fresh install of Utopic. I experience the black background right after installing the package.

$ apt-cache policy libgtksourceview-3.0-1
  Installed: 3.12.3-1ubuntu1
  Candidate: 3.12.3-1ubuntu1
  Version table:
 *** 3.12.3-1ubuntu1 0
        500 utopic/main amd64 Packages
        100 /var/lib/dpkg/status

If any more info is needed I'm happy to provide more information.

Artiom (zarianec91) wrote :

I have the same bug on my fresh install of Ubuntu 14.10 and I found solution for me. Changes were made only in the style.css file. Hope this helps.

Vincent Thiele (vincentthiele) wrote :

Comment #27 fixed the bug for me. Thank you Artiom!

Umang Varma (umang) wrote :

Finally, I see this bug too. I'm looking into this. Hopefully this will be easier to debug now that I am affected too.

The fix submitted by Artiom gives the GtkSourceView a background color, which it should not have since the window doesn't have a constant background. I can't merge that into the source code, but if you ahve a black background that's the best you can do for now. hopefully, I'll have a fix soon.

ConnyLo (webmaster-3457v) wrote :

Comment #27 fixed the bug for me but not for all chosen background colors.
If I choose purple color the background turns white.
If I take a rich yellow it turns to a a pale sandy yellowish color.
Maybe there is a color shift.

Umang Varma (umang) wrote :

In a couple hours, there should be a version for 15.04 available in the ppa. Please let me know if you still encounter the bug in 15.04. The problem seems to have magically vanished (for me at least) after the upgrade.

Umang Varma (umang) wrote :

Marking as incomplete until I hear that this issue persists in 15.04

Changed in indicator-stickynotes:
status: Confirmed → Incomplete
Lans (lans2035) wrote :

Comment #27 fixed the bug for me, but created a new one: Selected text was not shown as a different colour. It is shown as the same background colour as the unselected text. This is clearly not very useful, but led to a (hopefully) better answer - thank you Artiom .

I fixed the selected text problem by creating a new style class and allocating that class to the txtNote, and moving Artiom's fix to the new style. Then I added more style info to handle selected txt. The full details are:

1) Do not making the change to style.css suggested by #27
2) Instead add these lines at the end of style.css (creates a new css class called txtNote. Note the . before .txtNote)
    /* Fix the black background */
    background-color: $bg_start;
    color: $text_color;
    /* Fix the select background */
    background-color: #ffffff;

3) Add the class to the txtNote object: Edit and add these 3 lines at the bottom of the txtNote object (before the </object>, see below)
              <class name="txtNote"/>
(Or you can use glade to add a style class to the txtNote object)

The txtNote object in will now look like this:
          <object class="GtkSourceView" id="txtNote">
            <property name="visible">True</property>
            <property name="can_focus">True</property>
            <property name="has_focus">True</property>
            <property name="hexpand">True</property>
            <property name="vexpand">True</property>
            <property name="hscroll_policy">natural</property>
            <property name="vscroll_policy">natural</property>
            <property name="wrap_mode">word</property>
            <property name="left_margin">7</property>
            <property name="right_margin">7</property>
            <property name="tab_width">4</property>
            <property name="indent_on_tab">False</property>
              <class name="txtNote"/>


Umang Varma (umang) wrote :

Since I haven't been able to figure out why alpha does or does not work on computers with almost identical software (I haven't done a thorough controlled experiment), I have decided to remove the "shadow" feature.

In the next version, the background will be flat, like in many of the patches and workarounds, and a new set of flat icons will complement the flat background. I will also replace the "fold" icon with something "flatter".

Given that "flat" is trendy, I anticipate that not a lot of users will mind this loss of functionality. I think the loss of this feature is definitely worth the benefits of this old bug being fixed.

Changed in indicator-stickynotes:
status: Incomplete → In Progress
Umang Varma (umang) wrote :

Please test the latest code (it hasn't been released as a new version yet).

To get a copy, download and extract

Open the Terminal in the directory containing and run ./

Specifically, I want to know if the buttons have proper backgrounds. The text area should have the right background color now.

Changed in indicator-stickynotes:
status: In Progress → Fix Committed
Umang Varma (umang) on 2015-07-02
Changed in indicator-stickynotes:
milestone: none → 0.5.0
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Duplicates of this bug

Other bug subscribers