kbd stuff going threezero

1:06 pm g-a, gnome, libgnomekbd

Since gnome panel and applets are about to go relatively soon, I feel obliged to do something about that. Here are some unchained thoughts related to it…

The gnome keyboard indicator applet is to become deprecated. What’s instead? The only viable option, no matter how I dislike it, is the notification area icon. Or, in terms of gtk+, GtkStatusIcon. What’s important is that it cannot be a Gtk widget (there are good reasons for that). So the widget gkbd-indicator that was used by the existing applet, is getting useless – I just can reuse some of its code.

But there is an issue with gnome-screensaver. The screensaver is using gkbd-indicator widget in the unlock dialog (and it has to stay there!). That means I’ll still have to support the widget (unless, hehe, gnome-screensaver would suddenly start implementing notification area conventions). As the result, libgnomekbd will have two “layout indicating UI elements”. Somewhat ugly, on my taste…

PS The GSwitchit Plugins will not be supported by the new GtkStatusIcon-based indicator.

PPS It is still a shame that one cannot easily produce GdkPixbuf using cairo. The way through GdkPixmap does not work correctly because the transparency is lost by gdk_pixbuf_get_from_drawable (“If the specified destination pixbuf is not NULL and it contains alpha information, then the filled pixels will be set to full opacity”). The only way is using some code snippets. Why cannot that be put into gtk?


16 Responses

  1. Jason D Clinton Says:

    Arg! We talked about this at Summit and because of the width of the applet, it was agreed that it would _not_ go in to NA but rather be a full-fledged Shell plugin. http://jasondclinton.livejournal.com/76065.html

    With regard to Screensaver, it would be nice to use the same code in a St-based unlock widget.
    Read: have Shell do the unlock dialog via DBus.

  2. Sergey Udaltsov Says:

    @Jason: There is no real need to create full scale plugin. From some explanations, I got that some special status items will be “more equal than others” – and go into the top panel of the gnome shell (CMIIW). If that’s the case, I already have nearly working solution…

  3. Aigars Mahinovs Says:

    Is it possible to add more than 4 layouts? If no, then all this form over function is pretty useless as Gnome still sucks more than Windows 95 for any multi-lingual person.

  4. Sergey Udaltsov Says:

    @Aigars: no. And GNOME has nothing to do with it. It is XKB limitation. “Any multi-lingual person” is rarely using more than 2-3 layouts. Well, it depends on what your definition of “multi-lingual” is. I use Russian and English – am I “multi” or not?

  5. Danni Says:


  6. Sergey Udaltsov Says:

    @Danni: that is exactly the code provided by the link in the post. I wonder why is this code not in gtk. Do you know?

  7. Jens Petersen Says:

    I think this would be good time to talk about input method integration: we already have input-method icons in the NA (eg ibus) why not let them support xkb layout switching too? 🙂

  8. Sergey Udaltsov Says:

    @Jens: not a bad idea. From XKB side things are very simple, especially if you use libxklavier API that hides a lot of complexities. Long while ago we’ve already had discussion on IRC, but it ended nowhere. We could retry. FWIW I am available as svu on both freenode and gimpnet.

  9. iain Says:

    There is another interesting way that you could use GdkPixbuf and cairo together, and that is like how its done in ClutterCairo.

    basically you’d create a blank GdkPixbuf of the correct size and would call something like gdk_pixbuf_create and that would return a cairo_t onto which would could draw like normal. Once you destroyed the cairo_t the GdkPixbuf would be updated with the contents.

    Would make a nice way to make GdkPixbufs, and yeah, it should be in Gtk

  10. Benjamin Otte Says:

    Support for gdk_pixbuf_create() is on my list for pixman/cairo, because GStreamer and HTML5 need it. After that it’s just adding the convenience function to gtk.

    However, I have no idea if it’ll hit the March round of releases or if it’ll take longer. It’s quite an intrusive feature to support different colorspaces.

  11. Sergey Udaltsov Says:

    @Benjamin: thanks for your efforts! Looking forward to get that functionality in cairo/gtk!

  12. Aigars Mahinovs Says:

    Well, for multilingual – I need these languages more than once a week: English, Latvian, Estonian, Finnish, German. Once a month also Japanese and Lithuanian.

    People in multilingual countries in Africa and South Asia would like to have a couple dozen keyboard layouts handy.

    And don’t tell me that it is impossible. Windows does it. Even Gnome could do it in early 2.0 versions.

  13. Sergey Udaltsov Says:

    @Aigars. Again, it is impossible by XKB limitations. 4 groups. Early GNOME versions were working with XKB incorrectly.

    I realize there are _few_ people who need > 4 groups. Not too many. There is a chance one day XKB2 will become available, then I’ll do my best to support it in GNOME.

  14. Aigars Mahinovs Says:

    Then kill xkb. It has been possible in the wide computing world since 1990s, and we in Linux look like retards now that even KDE4 has this insane handicap.

    If the ‘correct’ way to use XKB involves switching between 4 layouts and an ‘incorrect’ way allows more, then the ‘correct’ way is incorrect and the ‘incorrect’ way should be used and other tools should be modified in order to make that way to be the correct one.

  15. Sergey Udaltsov Says:

    xkb can be killed not earlier than xkb2 is implemented. kde3 had issues that kde4 resolved. And the price is … 4 groups.

    The incorrect way is really incorrect. The fact that it allows >4 groups is a “side effect” of its incorrectness.

  16. GNOME Commit-Digest » Blog Archive » Issue 63 Says:

    […] Libgnomekbd got a new GkbdStatus widget implementing a status icon, Sergey Udaltsov wrote about it in kbd stuff going threezero. […]

Leave a Comment

Your comment

You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

Please note: Comment moderation is enabled and may delay your comment. There is no need to resubmit your comment.