kbd stuff going threezero
December 21, 2009 1:06 pm g-a, gnome, libgnomekbdSince 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?
gdk_pixbuf_get_from_drawable
December 21st, 2009 at 4:02 pm
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.
December 21st, 2009 at 4:29 pm
@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…
December 21st, 2009 at 6:50 pm
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.
December 21st, 2009 at 8:58 pm
@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?
December 21st, 2009 at 10:33 pm
http://davyd.ucc.asn.au/projects/gtk-utils/cairo_convert_to_pixbuf.html
December 21st, 2009 at 10:49 pm
@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?
December 22nd, 2009 at 12:22 am
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? 🙂
December 22nd, 2009 at 12:27 am
@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.
December 22nd, 2009 at 3:24 am
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
December 22nd, 2009 at 8:55 am
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.
December 22nd, 2009 at 4:31 pm
@Benjamin: thanks for your efforts! Looking forward to get that functionality in cairo/gtk!
December 23rd, 2009 at 1:48 am
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.
December 23rd, 2009 at 5:50 pm
@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.
December 24th, 2009 at 10:20 pm
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.
December 24th, 2009 at 11:18 pm
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.
December 27th, 2009 at 10:05 am
[…] Libgnomekbd got a new GkbdStatus widget implementing a status icon, Sergey Udaltsov wrote about it in kbd stuff going threezero. […]