wok-6.x rev 11955

lxpanel: Patch cpu applet for smaller size and clean pkg
author Christophe Lincoln <pankso@slitaz.org>
date Thu Mar 01 17:05:30 2012 +0100 (2012-03-01)
parents 9602efab8068
children 1680166a543f
files lxpanel/receipt lxpanel/stuff/Fix-failure-to-react-to-keyboard-map-changes-initiat.patch lxpanel/stuff/configure_desktop_number.patch lxpanel/stuff/cpu-color.patch lxpanel/stuff/cpu-size-color.patch lxpanel/stuff/fr.patch lxpanel/stuff/ptk-app-menu.patch
line diff
     1.1 --- a/lxpanel/receipt	Thu Mar 01 07:31:38 2012 -0800
     1.2 +++ b/lxpanel/receipt	Thu Mar 01 17:05:30 2012 +0100
     1.3 @@ -19,11 +19,9 @@
     1.4  compile_rules()
     1.5  {
     1.6  	cd $src
     1.7 -	#patch -p1 -i $stuff/Fix-failure-to-react-to-keyboard-map-changes-initiat.patch
     1.8 -	# Devnote : this patch shouldn't be necessary in next release of lxpanel (current : 0.5.8).
     1.9  	patch -p1 -i $stuff/configure_desktop_number.patch
    1.10  	patch -p1 -i $stuff/fix_position.patch
    1.11 -	patch -p0 -i $stuff/cpu-color.patch || exit 1
    1.12 +	patch -p0 -i $stuff/cpu-size-color.patch || exit 1
    1.13  	./configure --with-plugins=all $CONFIGURE_ARGS &&
    1.14  	make && make install
    1.15  }
     2.1 --- a/lxpanel/stuff/Fix-failure-to-react-to-keyboard-map-changes-initiat.patch	Thu Mar 01 07:31:38 2012 -0800
     2.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.3 @@ -1,555 +0,0 @@
     2.4 -From 438d9fdbd3e0be04de933705917d508a02b7c04b Mon Sep 17 00:00:00 2001
     2.5 -From: Marty Jack <martyj@linux.local>
     2.6 -Date: Sat, 20 Feb 2010 16:23:57 -0500
     2.7 -Subject: [PATCH 4/5] Fix failure to react to keyboard map changes initiated outside the plugin
     2.8 - - Occurred when setxkbmap was run, or when HAL configured the keyboard at X startup
     2.9 - - Caused by failure to process the NewKeyboard event
    2.10 - - Caused by dropping events due to faulty code to read them
    2.11 - - Cosmetic change, the tooltip now the Xkb Group name rather than Xkb Symbol name
    2.12 -
    2.13 ----
    2.14 - src/plugins/xkb/xkb-plugin.c |   92 +++++++++--------
    2.15 - src/plugins/xkb/xkb.c        |  236 +++++++++++++++++++++--------------------
    2.16 - src/plugins/xkb/xkb.h        |    7 +-
    2.17 - 3 files changed, 173 insertions(+), 162 deletions(-)
    2.18 -
    2.19 -diff --git a/src/plugins/xkb/xkb-plugin.c b/src/plugins/xkb/xkb-plugin.c
    2.20 -index f49a77d..80a14ba 100644
    2.21 ---- a/src/plugins/xkb/xkb-plugin.c
    2.22 -+++ b/src/plugins/xkb/xkb-plugin.c
    2.23 -@@ -1,18 +1,23 @@
    2.24 --/*
    2.25 --//====================================================================
    2.26 --//  xfce4-xkb-plugin - XFCE4 Xkb Layout Indicator panel plugin
    2.27 --// -------------------------------------------------------------------
    2.28 --//  Alexander Iliev <sasoiliev@mamul.org>
    2.29 --//  20-Feb-04
    2.30 --// -------------------------------------------------------------------
    2.31 --//  Parts of this code belong to Michael Glickman <wmalms@yahooo.com>
    2.32 --//  and his program wmxkb.
    2.33 --//  WARNING: DO NOT BOTHER Michael Glickman WITH QUESTIONS ABOUT THIS
    2.34 --//           PROGRAM!!! SEND INSTEAD EMAILS TO <sasoiliev@mamul.org>
    2.35 --//====================================================================
    2.36 --*/
    2.37 --
    2.38 --/* Modified by Hong Jen Yee (PCMan) <pcman.tw@gmail.com> on 2008-04-06 for lxpanel */
    2.39 -+/**
    2.40 -+ * Copyright (c) 2010 LxDE Developers, see the file AUTHORS for details.
    2.41 -+ *
    2.42 -+ * This program is free software; you can redistribute it and/or modify
    2.43 -+ * it under the terms of the GNU General Public License as published by
    2.44 -+ * the Free Software Foundation; either version 2 of the License, or
    2.45 -+ * (at your option) any later version.
    2.46 -+ *
    2.47 -+ * This program is distributed in the hope that it will be useful,
    2.48 -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
    2.49 -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    2.50 -+ * GNU General Public License for more details.
    2.51 -+ *
    2.52 -+ * You should have received a copy of the GNU General Public License
    2.53 -+ * along with this program; if not, write to the Free Software Foundation,
    2.54 -+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
    2.55 -+ */
    2.56 -+
    2.57 -+/* Originally derived from xfce4-xkb-plugin, Copyright 2004 Alexander Iliev,
    2.58 -+ * which credits Michael Glickman. */
    2.59 - 
    2.60 - #ifdef HAVE_CONFIG_H
    2.61 - #include <config.h>
    2.62 -@@ -49,38 +54,45 @@ void xkb_redraw(XkbPlugin * xkb)
    2.63 -     if (xkb->display_type == IMAGE)
    2.64 -     {
    2.65 -         int size = xkb->plugin->panel->icon_size;
    2.66 --        char * group_name = (char *) xkb_get_current_group_name_lowercase(xkb);
    2.67 --        char * filename = g_strdup_printf("%s/%s.png", FLAGSDIR, group_name);
    2.68 --        GdkPixbuf * unscaled_pixbuf = gdk_pixbuf_new_from_file(filename, NULL);
    2.69 --        g_free(filename);
    2.70 --        g_free(group_name);
    2.71 --
    2.72 --        if (unscaled_pixbuf != NULL)
    2.73 -+        char * group_name = (char *) xkb_get_current_symbol_name_lowercase(xkb);
    2.74 -+        if (group_name != NULL)
    2.75 -         {
    2.76 --            /* Loaded successfully. */
    2.77 --            int width = gdk_pixbuf_get_width(unscaled_pixbuf);
    2.78 --            int height = gdk_pixbuf_get_height(unscaled_pixbuf);
    2.79 --            GdkPixbuf * pixbuf = gdk_pixbuf_scale_simple(unscaled_pixbuf, size * width / height, size, GDK_INTERP_BILINEAR);
    2.80 --            if (pixbuf != NULL)
    2.81 -+            char * filename = g_strdup_printf("%s/%s.png", FLAGSDIR, group_name);
    2.82 -+            GdkPixbuf * unscaled_pixbuf = gdk_pixbuf_new_from_file(filename, NULL);
    2.83 -+            g_free(filename);
    2.84 -+            g_free(group_name);
    2.85 -+
    2.86 -+            if (unscaled_pixbuf != NULL)
    2.87 -             {
    2.88 --                gtk_image_set_from_pixbuf(GTK_IMAGE(xkb->image), pixbuf);
    2.89 --                g_object_unref(G_OBJECT(pixbuf));
    2.90 --                gtk_widget_hide(xkb->label);
    2.91 --                gtk_widget_show(xkb->image);
    2.92 --                gtk_widget_set_tooltip_text(xkb->btn, xkb_get_current_group_name(xkb));
    2.93 --                valid_image = TRUE;
    2.94 -+                /* Loaded successfully. */
    2.95 -+                int width = gdk_pixbuf_get_width(unscaled_pixbuf);
    2.96 -+                int height = gdk_pixbuf_get_height(unscaled_pixbuf);
    2.97 -+                GdkPixbuf * pixbuf = gdk_pixbuf_scale_simple(unscaled_pixbuf, size * width / height, size, GDK_INTERP_BILINEAR);
    2.98 -+                if (pixbuf != NULL)
    2.99 -+                {
   2.100 -+                    gtk_image_set_from_pixbuf(GTK_IMAGE(xkb->image), pixbuf);
   2.101 -+                    g_object_unref(G_OBJECT(pixbuf));
   2.102 -+                    gtk_widget_hide(xkb->label);
   2.103 -+                    gtk_widget_show(xkb->image);
   2.104 -+                    gtk_widget_set_tooltip_text(xkb->btn, xkb_get_current_group_name(xkb));
   2.105 -+                    valid_image = TRUE;
   2.106 -+                }
   2.107 -+                g_object_unref(unscaled_pixbuf);
   2.108 -             }
   2.109 --            g_object_unref(unscaled_pixbuf);
   2.110 -         }
   2.111 -     }
   2.112 - 
   2.113 -     /* Set the label. */
   2.114 -     if ((xkb->display_type == TEXT) || ( ! valid_image))
   2.115 -     {
   2.116 --        panel_draw_label_text(xkb->plugin->panel, xkb->label, (char *) xkb_get_current_group_name(xkb), TRUE, TRUE);
   2.117 --        gtk_widget_hide(xkb->image);
   2.118 --        gtk_widget_show(xkb->label);
   2.119 --        gtk_widget_set_tooltip_text(xkb->btn, NULL);
   2.120 -+        char * group_name = (char *) xkb_get_current_symbol_name(xkb);
   2.121 -+        if (group_name != NULL)
   2.122 -+        {
   2.123 -+            panel_draw_label_text(xkb->plugin->panel, xkb->label, (char *) group_name, TRUE, TRUE);
   2.124 -+            gtk_widget_hide(xkb->image);
   2.125 -+            gtk_widget_show(xkb->label);
   2.126 -+            gtk_widget_set_tooltip_text(xkb->btn, xkb_get_current_group_name(xkb));
   2.127 -+        }
   2.128 -     }
   2.129 - }
   2.130 - 
   2.131 -@@ -196,10 +208,6 @@ static int xkb_constructor(Plugin * plugin, char ** fp)
   2.132 -     /* Initialize the XKB interface. */
   2.133 -     xkb_mechanism_constructor(xkb);
   2.134 - 
   2.135 --    /* Initialize a channel to listen for XKB events. */
   2.136 --    GIOChannel * channel = g_io_channel_unix_new(xkb_get_connection_number(xkb));
   2.137 --    xkb->source_id = g_io_add_watch(channel, G_IO_IN | G_IO_PRI, (GIOFunc) xkb_gio_callback, (gpointer) xkb);
   2.138 --
   2.139 -     /* Connect signals. */
   2.140 -     g_signal_connect(xkb->btn, "button-press-event", G_CALLBACK(xkb_button_press_event), xkb);
   2.141 -     g_signal_connect(xkb->btn, "scroll-event", G_CALLBACK(xkb_scroll_event), xkb);
   2.142 -diff --git a/src/plugins/xkb/xkb.c b/src/plugins/xkb/xkb.c
   2.143 -index 5bb0c39..898a931 100644
   2.144 ---- a/src/plugins/xkb/xkb.c
   2.145 -+++ b/src/plugins/xkb/xkb.c
   2.146 -@@ -1,18 +1,23 @@
   2.147 --/*
   2.148 --// ====================================================================
   2.149 --//  xfce4-xkb-plugin - XFCE4 Xkb Layout Indicator panel plugin
   2.150 --// -------------------------------------------------------------------
   2.151 --//  Alexander Iliev <sasoiliev@mamul.org>
   2.152 --//  20-Feb-04
   2.153 --// -------------------------------------------------------------------
   2.154 --//  Parts of this code belong to Michael Glickman <wmalms@yahooo.com>
   2.155 --//  and his program wmxkb.
   2.156 --//  WARNING: DO NOT BOTHER Michael Glickman WITH QUESTIONS ABOUT THIS
   2.157 --//           PROGRAM!!! SEND INSTEAD EMAILS TO <sasoiliev@mamul.org>
   2.158 --//====================================================================
   2.159 --*/
   2.160 --
   2.161 --/* Modified by Hong Jen Yee (PCMan) <pcman.tw@gmail.com> on 2008-04-06 for lxpanel */
   2.162 -+/**
   2.163 -+ * Copyright (c) 2010 LxDE Developers, see the file AUTHORS for details.
   2.164 -+ *
   2.165 -+ * This program is free software; you can redistribute it and/or modify
   2.166 -+ * it under the terms of the GNU General Public License as published by
   2.167 -+ * the Free Software Foundation; either version 2 of the License, or
   2.168 -+ * (at your option) any later version.
   2.169 -+ *
   2.170 -+ * This program is distributed in the hope that it will be useful,
   2.171 -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
   2.172 -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   2.173 -+ * GNU General Public License for more details.
   2.174 -+ *
   2.175 -+ * You should have received a copy of the GNU General Public License
   2.176 -+ * along with this program; if not, write to the Free Software Foundation,
   2.177 -+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
   2.178 -+ */
   2.179 -+
   2.180 -+/* Originally derived from xfce4-xkb-plugin, Copyright 2004 Alexander Iliev,
   2.181 -+ * which credits Michael Glickman. */
   2.182 - 
   2.183 - #include "xkb.h"
   2.184 - 
   2.185 -@@ -26,9 +31,13 @@
   2.186 - #include <gdk-pixbuf/gdk-pixbuf.h>
   2.187 - #include <glib.h>
   2.188 - 
   2.189 -+/* The X Keyboard Extension: Library Specification
   2.190 -+ * http://www.xfree86.org/current/XKBlib.pdf */
   2.191 -+
   2.192 - static void xkb_enter_locale_by_process(XkbPlugin * xkb);
   2.193 - static void refresh_group_xkb(XkbPlugin * xkb);
   2.194 --static int do_init_xkb(XkbPlugin * xkb);
   2.195 -+static int initialize_keyboard_description(XkbPlugin * xkb);
   2.196 -+static GdkFilterReturn xkb_event_filter(GdkXEvent * xevent, GdkEvent * event, XkbPlugin * xkb);
   2.197 - 
   2.198 - /* Insert a process and its layout into the hash table. */
   2.199 - static void xkb_enter_locale_by_process(XkbPlugin * xkb)
   2.200 -@@ -56,60 +65,65 @@ int xkb_get_group_count(XkbPlugin * xkb)
   2.201 -   return xkb->group_count;
   2.202 - }
   2.203 - 
   2.204 -+/* Get the current group name. */
   2.205 -+const char * xkb_get_current_group_name(XkbPlugin * xkb) 
   2.206 -+{
   2.207 -+    return xkb->group_names[xkb->current_group_xkb_no];
   2.208 -+}
   2.209 -+
   2.210 - /* Convert a group number to a symbol name. */
   2.211 - const char * xkb_get_symbol_name_by_res_no(XkbPlugin * xkb, int n) 
   2.212 - {
   2.213 -     return xkb->symbol_names[n];
   2.214 - }
   2.215 - 
   2.216 --/* Get the current group name. */
   2.217 --const char * xkb_get_current_group_name(XkbPlugin * xkb) 
   2.218 -+/* Get the current symbol name. */
   2.219 -+const char * xkb_get_current_symbol_name(XkbPlugin * xkb) 
   2.220 - {
   2.221 -     return xkb_get_symbol_name_by_res_no(xkb, xkb->current_group_xkb_no);
   2.222 - }
   2.223 - 
   2.224 --/* Get the current group name converted to lowercase. */
   2.225 --const char * xkb_get_current_group_name_lowercase(XkbPlugin * xkb) 
   2.226 -+/* Get the current symbol name converted to lowercase. */
   2.227 -+const char * xkb_get_current_symbol_name_lowercase(XkbPlugin * xkb) 
   2.228 - {
   2.229 --    const char * tmp = xkb_get_current_group_name(xkb);
   2.230 --    return g_utf8_strdown(tmp, -1);
   2.231 -+    const char * tmp = xkb_get_current_symbol_name(xkb);
   2.232 -+    return ((tmp != NULL) ? g_utf8_strdown(tmp, -1) : NULL);
   2.233 - }
   2.234 - 
   2.235 - /* Refresh current group number from Xkb state. */
   2.236 - static void refresh_group_xkb(XkbPlugin * xkb) 
   2.237 - {
   2.238 -     XkbStateRec xkb_state;
   2.239 --    XkbGetState(xkb->dsp, xkb->device_id, &xkb_state);
   2.240 -+    XkbGetState(GDK_DISPLAY(), XkbUseCoreKbd, &xkb_state);
   2.241 -     xkb->current_group_xkb_no = xkb_state.group;
   2.242 - }
   2.243 - 
   2.244 --/* Initialize the Xkb structures. */
   2.245 --static int do_init_xkb(XkbPlugin * xkb) 
   2.246 -+/* Initialize the keyboard description initially or after a NewKeyboard event. */
   2.247 -+static int initialize_keyboard_description(XkbPlugin * xkb)
   2.248 - {
   2.249 --    /* Create hash table. */
   2.250 --    xkb->group_hash_table = g_hash_table_new(g_direct_hash, NULL);
   2.251 --
   2.252 --    /* Initialize the Xkb extension. */
   2.253 --    int major, minor, opcode;
   2.254 --    Bool status = XkbQueryExtension(xkb->dsp, &opcode,
   2.255 --        &xkb->base_event_code, &xkb->base_error_code, &major, &minor);
   2.256 --
   2.257 --    /* Use the core keyboard. */
   2.258 --    xkb->device_id = XkbUseCoreKbd;
   2.259 -+    /* Free the strings. */
   2.260 -+    int i;
   2.261 -+    for (i = 0; i < XkbNumKbdGroups; i += 1)
   2.262 -+    {
   2.263 -+        g_free(xkb->group_names[i]);
   2.264 -+        g_free(xkb->symbol_names[i]);
   2.265 -+        xkb->group_names[i] = NULL;
   2.266 -+        xkb->symbol_names[i] = NULL;
   2.267 -+    }
   2.268 - 
   2.269 -     /* Allocate a keyboard description structure. */
   2.270 -+    int status = False;
   2.271 -     XkbDescRec * kbd_desc_ptr = XkbAllocKeyboard();
   2.272 -     if (kbd_desc_ptr == NULL)
   2.273 -     {
   2.274 -         ERR("Failed to get keyboard description\n");
   2.275 -         goto HastaLaVista;
   2.276 -     }
   2.277 --    kbd_desc_ptr->dpy = xkb->dsp;
   2.278 - 
   2.279 -     /* Fetch information into the keyboard description. */
   2.280 --    XkbGetControls(xkb->dsp, XkbAllControlsMask, kbd_desc_ptr);
   2.281 --    XkbGetNames(xkb->dsp, XkbSymbolsNameMask, kbd_desc_ptr);
   2.282 --    XkbGetNames(xkb->dsp, XkbGroupNamesMask, kbd_desc_ptr);
   2.283 -+    XkbGetControls(GDK_DISPLAY(), XkbAllControlsMask, kbd_desc_ptr);
   2.284 -+    XkbGetNames(GDK_DISPLAY(), XkbSymbolsNameMask, kbd_desc_ptr);
   2.285 -+    XkbGetNames(GDK_DISPLAY(), XkbGroupNamesMask, kbd_desc_ptr);
   2.286 - 
   2.287 -     if (kbd_desc_ptr->names == NULL)
   2.288 -     {
   2.289 -@@ -137,12 +151,11 @@ static int do_init_xkb(XkbPlugin * xkb)
   2.290 - 
   2.291 -     /* Determine the group names.  Trim off text beginning at a '('. */
   2.292 -     const Atom * tmp_group_source = kbd_desc_ptr->names->groups;
   2.293 --    int i;
   2.294 -     for (i = 0; i < xkb->group_count; i++)
   2.295 -     {
   2.296 -         if (tmp_group_source[i] != None)
   2.297 -         {
   2.298 --            char * ptr = XGetAtomName(xkb->dsp, tmp_group_source[i]);
   2.299 -+            char * ptr = XGetAtomName(GDK_DISPLAY(), tmp_group_source[i]);
   2.300 -             xkb->group_names[i] = ptr;
   2.301 -             if ((ptr != NULL) && ((ptr = strchr(ptr, '('))) != NULL)
   2.302 -                 *ptr = '\0';
   2.303 -@@ -153,7 +166,7 @@ static int do_init_xkb(XkbPlugin * xkb)
   2.304 -     Atom sym_name_atom = kbd_desc_ptr->names->symbols;
   2.305 -     char * sym_name;
   2.306 -     if ((sym_name_atom == None)
   2.307 --    || ((sym_name = XGetAtomName(xkb->dsp, sym_name_atom)) == NULL))
   2.308 -+    || ((sym_name = XGetAtomName(GDK_DISPLAY(), sym_name_atom)) == NULL))
   2.309 -         goto HastaLaVista;
   2.310 - 
   2.311 -     /* Parse and store symbol names. */
   2.312 -@@ -190,83 +203,106 @@ static int do_init_xkb(XkbPlugin * xkb)
   2.313 -     {
   2.314 -         xkb->group_count = 2;
   2.315 -         xkb->symbol_names[1] = xkb->symbol_names[0];
   2.316 --        xkb->symbol_names[0] = strdup("us");
   2.317 --        xkb->group_names[0] = strdup("US/ASCII");
   2.318 --        xkb->group_names[1] = strdup("Japanese");
   2.319 -+        xkb->symbol_names[0] = g_strdup("us");
   2.320 -+        xkb->group_names[0] = g_strdup("US/ASCII");
   2.321 -+        xkb->group_names[1] = g_strdup("Japanese");
   2.322 -     }
   2.323 -     else if (count < xkb->group_count)
   2.324 -     {
   2.325 -         /* Ensure that the names are fully initialized. */
   2.326 -         int j = count, k = xkb->group_count;
   2.327 -         while(--j >= 0) xkb->symbol_names[--k] = xkb->symbol_names[j];
   2.328 --        while(--k >= 0) xkb->symbol_names[k] = strdup("en_US");
   2.329 -+        while(--k >= 0) xkb->symbol_names[k] = g_strdup("en_US");
   2.330 -     }
   2.331 - 
   2.332 --    /* Enxure that the names are fully initialized. */
   2.333 -+    /* Ensure that the names are fully initialized. */
   2.334 -     for (i = 0; i < xkb->group_count; i++)
   2.335 -     {
   2.336 -         if (xkb->symbol_names[i] == NULL)
   2.337 -         {
   2.338 -             ERR("\nGroup Symbol %i is undefined, set to 'U/A' !\n", i+1);
   2.339 --            xkb->symbol_names[i] = strdup("U/A");
   2.340 -+            xkb->symbol_names[i] = g_strdup("U/A");
   2.341 -         }
   2.342 -     }
   2.343 - 
   2.344 -+    /* Create or recreate hash table.
   2.345 -+     * The layout that was associated to the windows may or may not be at the same group number,
   2.346 -+     * and worse, may no longer exist, which there is no meaningful way to deal with. */
   2.347 -+    if (xkb->group_hash_table != NULL)
   2.348 -+        g_hash_table_destroy(xkb->group_hash_table);
   2.349 -+    xkb->group_hash_table = g_hash_table_new(g_direct_hash, NULL);
   2.350 -+
   2.351 -     status = True;
   2.352 - 
   2.353 - HastaLaVista:
   2.354 -     if (kbd_desc_ptr != NULL)
   2.355 -         XkbFreeKeyboard(kbd_desc_ptr, 0, True);
   2.356 -+
   2.357 -     return status;
   2.358 - }
   2.359 - 
   2.360 -+/* GDK event filter that receives events from all windows and the Xkb extension. */
   2.361 -+static GdkFilterReturn xkb_event_filter(GdkXEvent * xevent, GdkEvent * event, XkbPlugin * xkb)
   2.362 -+{
   2.363 -+    XEvent * ev = (XEvent *) xevent;
   2.364 -+
   2.365 -+    if (ev->xany.type == xkb->base_event_code + XkbEventCode)
   2.366 -+    {
   2.367 -+        /* Xkb event. */
   2.368 -+        XkbEvent * xkbev = (XkbEvent *) ev;
   2.369 -+        if (xkbev->any.xkb_type == XkbNewKeyboardNotify)
   2.370 -+        {
   2.371 -+            initialize_keyboard_description(xkb);
   2.372 -+            refresh_group_xkb(xkb);
   2.373 -+            xkb_redraw(xkb);
   2.374 -+            xkb_enter_locale_by_process(xkb);
   2.375 -+        }
   2.376 -+        else if (xkbev->any.xkb_type == XkbStateNotify)
   2.377 -+        {
   2.378 -+            if (xkbev->state.group != xkb->current_group_xkb_no)
   2.379 -+            {
   2.380 -+                /* Switch to the new group and redraw the display. */
   2.381 -+                xkb->current_group_xkb_no = xkbev->state.group;
   2.382 -+                refresh_group_xkb(xkb);
   2.383 -+                xkb_redraw(xkb);
   2.384 -+                xkb_enter_locale_by_process(xkb);
   2.385 -+            }
   2.386 -+        }
   2.387 -+    }
   2.388 -+    return GDK_FILTER_CONTINUE;
   2.389 -+}
   2.390 -+
   2.391 - /* Initialize the Xkb interface. */
   2.392 - void xkb_mechanism_constructor(XkbPlugin * xkb)
   2.393 - {
   2.394 --    /* Enable the Xkb extension on all clients. */
   2.395 --    XkbIgnoreExtension(False);
   2.396 --
   2.397 --    /* Open the display. */
   2.398 --    int major = XkbMajorVersion;
   2.399 --    int minor = XkbMinorVersion;
   2.400 --    char * display_name = "";
   2.401 --    int event_code;
   2.402 --    int error_rtrn;
   2.403 --    int reason_rtrn;
   2.404 --    xkb->dsp = XkbOpenDisplay(display_name, &event_code, &error_rtrn, &major, &minor, &reason_rtrn);
   2.405 --
   2.406 --    switch (reason_rtrn)
   2.407 -+    /* Initialize Xkb extension. */
   2.408 -+    int opcode;
   2.409 -+    int maj = XkbMajorVersion;
   2.410 -+    int min = XkbMinorVersion;
   2.411 -+    if ((XkbLibraryVersion(&maj, &min))
   2.412 -+    && (XkbQueryExtension(GDK_DISPLAY(), &opcode, &xkb->base_event_code, &xkb->base_error_code, &maj, &min)))
   2.413 -     {
   2.414 --        case XkbOD_BadLibraryVersion:
   2.415 --            ERR("Bad XKB library version.\n");
   2.416 --            return;
   2.417 --        case XkbOD_ConnectionRefused:
   2.418 --            ERR("Connection to X server refused.\n");
   2.419 --            return;
   2.420 --        case XkbOD_BadServerVersion:
   2.421 --            ERR("Bad X server version.\n");
   2.422 --            return;
   2.423 --        case XkbOD_NonXkbServer:
   2.424 --            ERR("XKB not present.\n");
   2.425 --            return;
   2.426 --        case XkbOD_Success:
   2.427 --            break;
   2.428 --    }
   2.429 -+        /* Read the keyboard description. */
   2.430 -+        initialize_keyboard_description(xkb);
   2.431 - 
   2.432 --    /* Initialize our mechanism. */
   2.433 --    if (do_init_xkb(xkb) != True)
   2.434 --        return;
   2.435 -+        /* Establish GDK event filter. */
   2.436 -+        gdk_window_add_filter(NULL, (GdkFilterFunc) xkb_event_filter, (gpointer) xkb);
   2.437 - 
   2.438 --    /* Specify events we will receive. */
   2.439 --    XkbSelectEventDetails(xkb->dsp, xkb->device_id, XkbStateNotify, XkbAllStateComponentsMask, XkbGroupStateMask);
   2.440 -+        /* Specify events we will receive. */
   2.441 -+        XkbSelectEvents(GDK_DISPLAY(), XkbUseCoreKbd, XkbNewKeyboardNotifyMask, XkbNewKeyboardNotifyMask);
   2.442 -+        XkbSelectEventDetails(GDK_DISPLAY(), XkbUseCoreKbd, XkbStateNotify, XkbAllStateComponentsMask, XkbGroupStateMask);
   2.443 - 
   2.444 --    /* Get current state. */
   2.445 --    refresh_group_xkb(xkb);
   2.446 -+        /* Get current state. */
   2.447 -+        refresh_group_xkb(xkb);
   2.448 -+    }
   2.449 - }
   2.450 - 
   2.451 - /* Deallocate resources associated with Xkb interface. */
   2.452 - void xkb_mechanism_destructor(XkbPlugin * xkb) 
   2.453 - {
   2.454 -+    /* Remove event filter. */
   2.455 -+    gdk_window_remove_filter(NULL, (GdkFilterFunc) xkb_event_filter, xkb);
   2.456 -+
   2.457 -     /* Free group and symbol name memory. */
   2.458 -     int i;
   2.459 -     for (i = 0; i < xkb->group_count; i++)
   2.460 -@@ -283,21 +319,11 @@ void xkb_mechanism_destructor(XkbPlugin * xkb)
   2.461 -         }
   2.462 -     }
   2.463 - 
   2.464 --    /* Close the display. */
   2.465 --    XCloseDisplay(xkb->dsp);
   2.466 --    xkb->dsp = NULL;
   2.467 --
   2.468 -     /* Destroy the hash table. */
   2.469 -     g_hash_table_destroy(xkb->group_hash_table);
   2.470 -     xkb->group_hash_table = NULL;
   2.471 - }
   2.472 - 
   2.473 --/* Return the connection number for the display. */
   2.474 --int xkb_get_connection_number(XkbPlugin * xkb)
   2.475 --{
   2.476 --    return ConnectionNumber(xkb->dsp);
   2.477 --}
   2.478 --
   2.479 - /* Set the layout to the next layout. */
   2.480 - int xkb_change_group(XkbPlugin * xkb, int increment) 
   2.481 - {
   2.482 -@@ -307,33 +333,13 @@ int xkb_change_group(XkbPlugin * xkb, int increment)
   2.483 -     if (next_group >= xkb->group_count) next_group = 0;
   2.484 - 
   2.485 -     /* Execute the change. */
   2.486 --    XkbLockGroup(xkb->dsp, xkb->device_id, next_group);
   2.487 -+    XkbLockGroup(GDK_DISPLAY(), XkbUseCoreKbd, next_group);
   2.488 -     refresh_group_xkb(xkb);
   2.489 -     xkb_redraw(xkb);
   2.490 -     xkb_enter_locale_by_process(xkb);
   2.491 -     return 1;
   2.492 - }
   2.493 - 
   2.494 --/* Callback when activity detected on the Xkb channel. */
   2.495 --gboolean xkb_gio_callback(GIOChannel * source, GIOCondition condition, gpointer data) 
   2.496 --{
   2.497 --    XkbPlugin * xkb = (XkbPlugin *) data;
   2.498 --
   2.499 --    XkbEvent evnt;
   2.500 --    XNextEvent(xkb->dsp, &evnt.core);
   2.501 --    if ((evnt.type == xkb->base_event_code)
   2.502 --    && (evnt.any.xkb_type == XkbStateNotify)
   2.503 --    && (evnt.state.group != xkb->current_group_xkb_no))
   2.504 --    {
   2.505 --        /* Switch to the new group and redraw the display. */
   2.506 --        xkb->current_group_xkb_no = evnt.state.group;
   2.507 --        refresh_group_xkb(xkb);
   2.508 --        xkb_redraw(xkb);
   2.509 --        xkb_enter_locale_by_process(xkb);
   2.510 --    }
   2.511 --    return TRUE;
   2.512 --}
   2.513 --
   2.514 - /* React to change of focus by switching to the application's layout or the default layout. */
   2.515 - void xkb_active_window_changed(XkbPlugin * xkb, gint pid)
   2.516 - {
   2.517 -@@ -345,7 +351,7 @@ void xkb_active_window_changed(XkbPlugin * xkb, gint pid)
   2.518 - 
   2.519 -     if (new_group_xkb_no < xkb->group_count)
   2.520 -     {
   2.521 --        XkbLockGroup(xkb->dsp, xkb->device_id, new_group_xkb_no);
   2.522 -+        XkbLockGroup(GDK_DISPLAY(), XkbUseCoreKbd, new_group_xkb_no);
   2.523 -         refresh_group_xkb(xkb);
   2.524 -     }
   2.525 - }
   2.526 -diff --git a/src/plugins/xkb/xkb.h b/src/plugins/xkb/xkb.h
   2.527 -index 9265198..20c7ed3 100644
   2.528 ---- a/src/plugins/xkb/xkb.h
   2.529 -+++ b/src/plugins/xkb/xkb.h
   2.530 -@@ -49,10 +49,8 @@ typedef struct {
   2.531 -     GtkWidget * per_app_default_layout_menu;	/* Combo box of all available layouts */
   2.532 - 
   2.533 -     /* Mechanism. */
   2.534 --    Display * dsp;				/* Handle to X display */
   2.535 -     int base_event_code;			/* Result of initializing Xkb extension */
   2.536 -     int base_error_code;
   2.537 --    int device_id;				/* Keyboard device ID (always "core keyboard") */
   2.538 -     int current_group_xkb_no;			/* Current layout */
   2.539 -     int group_count;				/* Count of groups as returned by Xkb */
   2.540 -     char * group_names[XkbNumKbdGroups];	/* Group names as returned by Xkb */
   2.541 -@@ -67,12 +65,11 @@ extern int xkb_get_current_group_xkb_no(XkbPlugin * xkb);
   2.542 - extern int xkb_get_group_count(XkbPlugin * xkb);
   2.543 - extern const char * xkb_get_symbol_name_by_res_no(XkbPlugin * xkb, int group_res_no);
   2.544 - extern const char * xkb_get_current_group_name(XkbPlugin * xkb);
   2.545 --extern const char * xkb_get_current_group_name_lowercase(XkbPlugin * xkb);
   2.546 -+extern const char * xkb_get_current_symbol_name(XkbPlugin * xkb);
   2.547 -+extern const char * xkb_get_current_symbol_name_lowercase(XkbPlugin * xkb);
   2.548 - extern void xkb_mechanism_constructor(XkbPlugin * xkb);
   2.549 - extern void xkb_mechanism_destructor(XkbPlugin * xkb);
   2.550 --extern int xkb_get_connection_number(XkbPlugin * xkb);
   2.551 - extern int xkb_change_group(XkbPlugin * xkb, int increment);
   2.552 --extern gboolean xkb_gio_callback(GIOChannel * source, GIOCondition condition, gpointer data);
   2.553 - extern void xkb_active_window_changed(XkbPlugin * xkb, GPid pid);
   2.554 - 
   2.555 - #endif
   2.556 --- 
   2.557 -1.7.0
   2.558 -
     3.1 --- a/lxpanel/stuff/configure_desktop_number.patch	Thu Mar 01 07:31:38 2012 -0800
     3.2 +++ b/lxpanel/stuff/configure_desktop_number.patch	Thu Mar 01 17:05:30 2012 +0100
     3.3 @@ -20,7 +20,7 @@
     3.4  +    {
     3.5  +        if (g_find_program_in_path("obconf"))
     3.6  +        {
     3.7 -+            command_line = "obconf --tab 6";
     3.8 ++            command_line = "obconf";
     3.9  +        }
    3.10  +    }
    3.11  +    else if (g_strcmp0(wm_name, "compiz") == 0)
     4.1 --- a/lxpanel/stuff/cpu-color.patch	Thu Mar 01 07:31:38 2012 -0800
     4.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     4.3 @@ -1,11 +0,0 @@
     4.4 ---- src/plugins/cpu/cpu.c
     4.5 -+++ src/plugins/cpu/cpu.c.taz
     4.6 -@@ -229,7 +229,7 @@
     4.7 -     /* Clone a graphics context and set "green" as its foreground color.
     4.8 -      * We will use this to draw the graph. */
     4.9 -     c->graphics_context = gdk_gc_new(p->panel->topgwin->window);
    4.10 --    gdk_color_parse("green",  &c->foreground_color);
    4.11 -+    gdk_color_parse("#cfcfcf",  &c->foreground_color);
    4.12 -     gdk_colormap_alloc_color(gdk_drawable_get_colormap(p->panel->topgwin->window), &c->foreground_color, FALSE, TRUE);
    4.13 -     gdk_gc_set_foreground(c->graphics_context, &c->foreground_color);
    4.14 - 
     5.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     5.2 +++ b/lxpanel/stuff/cpu-size-color.patch	Thu Mar 01 17:05:30 2012 +0100
     5.3 @@ -0,0 +1,19 @@
     5.4 +--- src/plugins/cpu/cpu.c
     5.5 ++++ src/plugins/cpu/cpu.c.taz
     5.6 +@@ -222,14 +222,14 @@
     5.7 + 
     5.8 +     /* Allocate drawing area as a child of top level widget.  Enable button press events. */
     5.9 +     c->da = gtk_drawing_area_new();
    5.10 +-    gtk_widget_set_size_request(c->da, 40, PANEL_HEIGHT_DEFAULT);
    5.11 ++    gtk_widget_set_size_request(c->da, 26, PANEL_HEIGHT_DEFAULT);
    5.12 +     gtk_widget_add_events(c->da, GDK_BUTTON_PRESS_MASK);
    5.13 +     gtk_container_add(GTK_CONTAINER(p->pwid), c->da);
    5.14 + 
    5.15 +     /* Clone a graphics context and set "green" as its foreground color.
    5.16 +      * We will use this to draw the graph. */
    5.17 +     c->graphics_context = gdk_gc_new(p->panel->topgwin->window);
    5.18 +-    gdk_color_parse("green",  &c->foreground_color);
    5.19 ++    gdk_color_parse("#cfcfcf",  &c->foreground_color);
    5.20 +     gdk_colormap_alloc_color(gdk_drawable_get_colormap(p->panel->topgwin->window), &c->foreground_color, FALSE, TRUE);
    5.21 +     gdk_gc_set_foreground(c->graphics_context, &c->foreground_color);
    5.22 + 
     6.1 --- a/lxpanel/stuff/fr.patch	Thu Mar 01 07:31:38 2012 -0800
     6.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     6.3 @@ -1,29 +0,0 @@
     6.4 ---- po/fr.po	Sun Apr 20 14:13:34 2008
     6.5 -+++ po/fr.po	Sun Apr 20 14:15:33 2008
     6.6 -@@ -390,7 +390,7 @@
     6.7 - 
     6.8 - #: ../src/plugins/ptk-app-menu.c:157
     6.9 - msgid "Other"
    6.10 --msgstr "Autres"
    6.11 -+msgstr "Divers"
    6.12 - 
    6.13 - #: ../src/plugins/ptk-app-menu.c:158
    6.14 - msgid "Game"
    6.15 -@@ -406,7 +406,7 @@
    6.16 - 
    6.17 - #: ../src/plugins/ptk-app-menu.c:161
    6.18 - msgid "Audio & Video"
    6.19 --msgstr "Audio & Vidéo"
    6.20 -+msgstr "Multimedia"
    6.21 - 
    6.22 - #: ../src/plugins/ptk-app-menu.c:162
    6.23 - msgid "Graphics"
    6.24 -@@ -430,7 +430,7 @@
    6.25 - 
    6.26 - #: ../src/plugins/ptk-app-menu.c:167
    6.27 - msgid "Accessories"
    6.28 --msgstr "Accessoires"
    6.29 -+msgstr "Utilitaires"
    6.30 - 
    6.31 - #: ../src/plugins/taskbar.c:1224
    6.32 - msgid "Raise"
     7.1 --- a/lxpanel/stuff/ptk-app-menu.patch	Thu Mar 01 07:31:38 2012 -0800
     7.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     7.3 @@ -1,23 +0,0 @@
     7.4 ---- src/plugins/ptk-app-menu.c	Fri Apr 18 15:16:04 2008
     7.5 -+++ src/plugins/ptk-app-menu.c	Fri Apr 18 15:15:02 2008
     7.6 -@@ -154,17 +154,17 @@
     7.7 - 
     7.8 - static const CatInfo known_cats[]=
     7.9 - {
    7.10 --    {N_("Other"), "Other", "gnome-other", NULL},
    7.11 -+    {N_("Other"), "Misc", "gnome-other", NULL},
    7.12 -     {N_("Game"), "Games", "gnome-joystick", game_cats},
    7.13 -     {N_("Education"), "Education", "gnome-amusements", education_cats},
    7.14 -     {N_("Development"), "Development", "gnome-devel", development_cats},
    7.15 -     {N_("Audio & Video"), "Multimedia", "gnome-multimedia", audiovideo_cats},
    7.16 -     {N_("Graphics"), "Graphics", "gnome-graphics", graphics_cats},
    7.17 -     {N_("Settings"), "Settings", "gnome-settings", settings_cats},
    7.18 --    {N_("System Tools"), "System-Tools", "gnome-system", system_cats},
    7.19 -+    {N_("System Tools"), "System Tools", "gnome-system", system_cats},
    7.20 -     {N_("Network"), "Internet", "gnome-globe", network_cats},
    7.21 -     {N_("Office"), "Office", "gnome-applications", office_cats},
    7.22 --    {N_("Accessories"), "Accessories", "gnome-util", utility_cats}
    7.23 -+    {N_("Accessories"), "Utilities", "gnome-util", utility_cats}
    7.24 - };
    7.25 - 
    7.26 - static int find_cat( char** cats )