Author: nick
Date: 2008-07-18 19:43:35 +0000 (Fri, 18 Jul 2008)
New Revision: 27344

Modified:
   xfce4-settings/trunk/ChangeLog
   xfce4-settings/trunk/configure.ac.in
   xfce4-settings/trunk/dialogs/keyboard-settings/command-dialog.h
   xfce4-settings/trunk/dialogs/keyboard-settings/keyboard-dialog.glade
   xfce4-settings/trunk/dialogs/keyboard-settings/main.c
   xfce4-settings/trunk/xfce4-settings-helper/accessibility.c
   xfce4-settings/trunk/xfce4-settings-helper/keyboards.c
   xfce4-settings/trunk/xfce4-settings-helper/main.c
   xfce4-settings/trunk/xfce4-settings-helper/pointers.c
Log:
        * configure.ac.in, xfce4-settings-helper/Makefile.am,
          xfce4-settings-helper/keyboards.c: Drop libxxf86misc dependency.
          Xkb can do all this, it's not needed anymore and already
          removed from Xorg git master.
        * dialogs/keyboard-settings/keyboard-dialog.glade: Show the slider
          values, add tooltips and change the slider ranges a bit.
        * dialogs/keyboard-settings/main.c: Set default window size width to
          400px instead on in the glade code.
        * xfce4-settings-helper/pointers.c, xfce4-settings-helper/keyboards.c,
          xfce4-settings-helper/accessibility.c: Property push and trap
          x errors.

Modified: xfce4-settings/trunk/ChangeLog
===================================================================
--- xfce4-settings/trunk/ChangeLog      2008-07-18 19:19:29 UTC (rev 27343)
+++ xfce4-settings/trunk/ChangeLog      2008-07-18 19:43:35 UTC (rev 27344)
@@ -1,5 +1,19 @@
 2008-07-18     Nick Schermer <[EMAIL PROTECTED]>
 
+       * configure.ac.in, xfce4-settings-helper/Makefile.am,
+         xfce4-settings-helper/keyboards.c: Drop libxxf86misc dependency.
+         Xkb can do all this, it's not needed anymore and already
+         removed from Xorg git master.
+       * dialogs/keyboard-settings/keyboard-dialog.glade: Show the slider
+         values, add tooltips and change the slider ranges a bit.
+       * dialogs/keyboard-settings/main.c: Set default window size width to
+         400px instead on in the glade code.
+       * xfce4-settings-helper/pointers.c, xfce4-settings-helper/keyboards.c,
+         xfce4-settings-helper/accessibility.c: Property push and trap
+         x errors.
+
+2008-07-18     Nick Schermer <[EMAIL PROTECTED]>
+
        * xfce4-settings-helper/main.c, configure.ac.in: Properly quit
          the main loop when a signal is received.
 

Modified: xfce4-settings/trunk/configure.ac.in
===================================================================
--- xfce4-settings/trunk/configure.ac.in        2008-07-18 19:19:29 UTC (rev 
27343)
+++ xfce4-settings/trunk/configure.ac.in        2008-07-18 19:43:35 UTC (rev 
27344)
@@ -102,12 +102,6 @@
 XDT_CHECK_OPTIONAL_PACKAGE([XCURSOR], [xcursor], [1.1.0],
                            [xcursor], [Cursor themes support])
 
-dnl *************************************
-dnl *** Optional support for Xf86misc ***
-dnl *************************************
-XDT_CHECK_OPTIONAL_PACKAGE([XF86MISC], [libxxf86misc], [0.9.0],
-                           [xf86misc], [Support for the X Miscellaneous 
extension wire protocol])
-
 dnl ***********************************
 dnl *** Check for debugging support ***
 dnl ***********************************

Modified: xfce4-settings/trunk/dialogs/keyboard-settings/command-dialog.h
===================================================================
--- xfce4-settings/trunk/dialogs/keyboard-settings/command-dialog.h     
2008-07-18 19:19:29 UTC (rev 27343)
+++ xfce4-settings/trunk/dialogs/keyboard-settings/command-dialog.h     
2008-07-18 19:43:35 UTC (rev 27344)
@@ -24,7 +24,7 @@
 
 #include <gtk/gtk.h>
 
-G_BEGIN_DECLS;
+G_BEGIN_DECLS
 
 typedef struct _CommandDialogClass CommandDialogClass;
 typedef struct _CommandDialog      CommandDialog;
@@ -44,6 +44,6 @@
 gint        command_dialog_run          (CommandDialog *dialog,
                                          GtkWidget     *parent);
 
-G_END_DECLS;
+G_END_DECLS
 
 #endif /* !__COMMAND_DIALOG_H__ */

Modified: xfce4-settings/trunk/dialogs/keyboard-settings/keyboard-dialog.glade
===================================================================
--- xfce4-settings/trunk/dialogs/keyboard-settings/keyboard-dialog.glade        
2008-07-18 19:19:29 UTC (rev 27343)
+++ xfce4-settings/trunk/dialogs/keyboard-settings/keyboard-dialog.glade        
2008-07-18 19:43:35 UTC (rev 27344)
@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="UTF-8" standalone="no"?>
 <!DOCTYPE glade-interface SYSTEM "glade-2.0.dtd">
-<!--Generated with glade3 3.4.5 on Fri Jul 18 02:17:26 2008 -->
+<!--Generated with glade3 3.4.5 on Fri Jul 18 21:21:20 2008 -->
 <glade-interface>
   <requires lib="xfce4"/>
   <widget class="XfceTitledDialog" id="keyboard-settings-dialog">
@@ -51,6 +51,7 @@
                                       <widget class="GtkCheckButton" 
id="xkb_key_repeat_check">
                                         <property 
name="visible">True</property>
                                         <property 
name="can_focus">True</property>
+                                        <property name="tooltip" 
translatable="yes">When enabled, pressing and holding down a key emits the same 
character over and over again</property>
                                         <property name="label" 
translatable="yes">_Enable key repeat</property>
                                         <property 
name="use_underline">True</property>
                                         <property 
name="response_id">0</property>
@@ -84,48 +85,16 @@
                                               </packing>
                                             </child>
                                             <child>
-                                              <widget class="GtkHBox" 
id="hbox2">
+                                              <widget class="GtkHScale" 
id="xkb_key_repeat_delay_scale">
                                                 <property 
name="visible">True</property>
-                                                <property 
name="spacing">2</property>
-                                                <child>
-                                                  <widget class="GtkLabel" 
id="label8">
-                                                    <property 
name="visible">True</property>
-                                                    <property name="label" 
translatable="yes">&lt;small&gt;&lt;i&gt;Short&lt;/i&gt;&lt;/small&gt;</property>
-                                                    <property 
name="use_markup">True</property>
-                                                  </widget>
-                                                  <packing>
-                                                    <property 
name="expand">False</property>
-                                                    <property 
name="fill">False</property>
-                                                  </packing>
-                                                </child>
-                                                <child>
-                                                  <widget class="GtkHScale" 
id="xkb_key_repeat_delay_scale">
-                                                    <property 
name="visible">True</property>
-                                                    <property 
name="can_focus">True</property>
-                                                    <property 
name="adjustment">100 100 2000 1 10 10</property>
-                                                    <property 
name="digits">0</property>
-                                                    <property 
name="draw_value">False</property>
-                                                  </widget>
-                                                  <packing>
-                                                    <property 
name="position">1</property>
-                                                  </packing>
-                                                </child>
-                                                <child>
-                                                  <widget class="GtkLabel" 
id="label9">
-                                                    <property 
name="visible">True</property>
-                                                    <property name="label" 
translatable="yes">&lt;small&gt;&lt;i&gt;Long&lt;/i&gt;&lt;/small&gt;</property>
-                                                    <property 
name="use_markup">True</property>
-                                                  </widget>
-                                                  <packing>
-                                                    <property 
name="expand">False</property>
-                                                    <property 
name="fill">False</property>
-                                                    <property 
name="position">2</property>
-                                                  </packing>
-                                                </child>
+                                                <property 
name="can_focus">True</property>
+                                                <property name="tooltip" 
translatable="yes">The time in milliseconds before a pressed key starts 
repeating</property>
+                                                <property 
name="update_policy">GTK_UPDATE_DELAYED</property>
+                                                <property 
name="adjustment">500 10 1000 1 10 1</property>
+                                                <property 
name="digits">0</property>
+                                                <property 
name="value_pos">GTK_POS_RIGHT</property>
                                               </widget>
                                               <packing>
-                                                <property 
name="expand">False</property>
-                                                <property 
name="fill">False</property>
                                                 <property 
name="position">1</property>
                                               </packing>
                                             </child>
@@ -144,47 +113,16 @@
                                               </packing>
                                             </child>
                                             <child>
-                                              <widget class="GtkHBox" 
id="hbox3">
+                                              <widget class="GtkHScale" 
id="xkb_key_repeat_rate_scale">
                                                 <property 
name="visible">True</property>
-                                                <property 
name="spacing">2</property>
-                                                <child>
-                                                  <widget class="GtkLabel" 
id="label11">
-                                                    <property 
name="visible">True</property>
-                                                    <property name="label" 
translatable="yes">&lt;small&gt;&lt;i&gt;Slow&lt;/i&gt;&lt;/small&gt;</property>
-                                                    <property 
name="use_markup">True</property>
-                                                  </widget>
-                                                  <packing>
-                                                    <property 
name="expand">False</property>
-                                                    <property 
name="fill">False</property>
-                                                  </packing>
-                                                </child>
-                                                <child>
-                                                  <widget class="GtkHScale" 
id="xkb_key_repeat_rate_scale">
-                                                    <property 
name="visible">True</property>
-                                                    <property 
name="can_focus">True</property>
-                                                    <property 
name="adjustment">10 10 500 1 10 10</property>
-                                                    <property 
name="draw_value">False</property>
-                                                  </widget>
-                                                  <packing>
-                                                    <property 
name="position">1</property>
-                                                  </packing>
-                                                </child>
-                                                <child>
-                                                  <widget class="GtkLabel" 
id="label12">
-                                                    <property 
name="visible">True</property>
-                                                    <property name="label" 
translatable="yes">&lt;small&gt;&lt;i&gt;Fast&lt;/i&gt;&lt;/small&gt;</property>
-                                                    <property 
name="use_markup">True</property>
-                                                  </widget>
-                                                  <packing>
-                                                    <property 
name="expand">False</property>
-                                                    <property 
name="fill">False</property>
-                                                    <property 
name="position">2</property>
-                                                  </packing>
-                                                </child>
+                                                <property 
name="can_focus">True</property>
+                                                <property name="tooltip" 
translatable="yes">The rate at which keycodes are generated while a key is 
pressed</property>
+                                                <property 
name="update_policy">GTK_UPDATE_DELAYED</property>
+                                                <property name="adjustment">20 
1 250 1 10 1</property>
+                                                <property 
name="digits">0</property>
+                                                <property 
name="value_pos">GTK_POS_RIGHT</property>
                                               </widget>
                                               <packing>
-                                                <property 
name="expand">False</property>
-                                                <property 
name="fill">False</property>
                                                 <property 
name="position">3</property>
                                               </packing>
                                             </child>
@@ -266,47 +204,16 @@
                                               </packing>
                                             </child>
                                             <child>
-                                              <widget class="GtkHBox" 
id="hbox4">
+                                              <widget class="GtkHScale" 
id="net_cursor_blink_time_scale">
                                                 <property 
name="visible">True</property>
-                                                <property 
name="spacing">2</property>
-                                                <child>
-                                                  <widget class="GtkLabel" 
id="label14">
-                                                    <property 
name="visible">True</property>
-                                                    <property name="label" 
translatable="yes">&lt;small&gt;&lt;i&gt;Short&lt;/i&gt;&lt;/small&gt;</property>
-                                                    <property 
name="use_markup">True</property>
-                                                  </widget>
-                                                  <packing>
-                                                    <property 
name="expand">False</property>
-                                                    <property 
name="fill">False</property>
-                                                  </packing>
-                                                </child>
-                                                <child>
-                                                  <widget class="GtkHScale" 
id="net_cursor_blink_time_scale">
-                                                    <property 
name="visible">True</property>
-                                                    <property 
name="can_focus">True</property>
-                                                    <property 
name="adjustment">100 100 2000 100 10 10</property>
-                                                    <property 
name="draw_value">False</property>
-                                                  </widget>
-                                                  <packing>
-                                                    <property 
name="position">1</property>
-                                                  </packing>
-                                                </child>
-                                                <child>
-                                                  <widget class="GtkLabel" 
id="label15">
-                                                    <property 
name="visible">True</property>
-                                                    <property name="label" 
translatable="yes">&lt;small&gt;&lt;i&gt;Long&lt;/i&gt;&lt;/small&gt;</property>
-                                                    <property 
name="use_markup">True</property>
-                                                  </widget>
-                                                  <packing>
-                                                    <property 
name="expand">False</property>
-                                                    <property 
name="fill">False</property>
-                                                    <property 
name="position">2</property>
-                                                  </packing>
-                                                </child>
+                                                <property 
name="can_focus">True</property>
+                                                <property name="tooltip" 
translatable="yes">The length of the cursor blink cycle in 
milliseconds</property>
+                                                <property 
name="update_policy">GTK_UPDATE_DELAYED</property>
+                                                <property 
name="adjustment">1000 100 2000 1 10 1</property>
+                                                <property 
name="digits">0</property>
+                                                <property 
name="value_pos">GTK_POS_RIGHT</property>
                                               </widget>
                                               <packing>
-                                                <property 
name="expand">False</property>
-                                                <property 
name="fill">False</property>
                                                 <property 
name="position">1</property>
                                               </packing>
                                             </child>
@@ -411,7 +318,6 @@
                         <property name="shadow_type">GTK_SHADOW_IN</property>
                         <child>
                           <widget class="GtkTreeView" id="kbd_shortcuts_view">
-                            <property name="width_request">400</property>
                             <property name="visible">True</property>
                             <property name="can_focus">True</property>
                             <property name="search_column">0</property>

Modified: xfce4-settings/trunk/dialogs/keyboard-settings/main.c
===================================================================
--- xfce4-settings/trunk/dialogs/keyboard-settings/main.c       2008-07-18 
19:19:29 UTC (rev 27343)
+++ xfce4-settings/trunk/dialogs/keyboard-settings/main.c       2008-07-18 
19:43:35 UTC (rev 27344)
@@ -620,6 +620,7 @@
 
   /* Create settings dialog and run it */
   dialog = keyboard_settings_dialog_new_from_xml (gxml);
+  gtk_window_set_default_size (GTK_WINDOW (dialog), 400, -1);
   gtk_dialog_run (GTK_DIALOG (dialog));
   gtk_widget_destroy (dialog);
 

Modified: xfce4-settings/trunk/xfce4-settings-helper/accessibility.c
===================================================================
--- xfce4-settings/trunk/xfce4-settings-helper/accessibility.c  2008-07-18 
19:19:29 UTC (rev 27343)
+++ xfce4-settings/trunk/xfce4-settings-helper/accessibility.c  2008-07-18 
19:43:35 UTC (rev 27344)
@@ -180,16 +180,15 @@
     XkbDescPtr xkb;
     gint       delay, interval, time_to_max;
     gint       max_speed, curve;
+    
+    /* flush x and trap errors */
+    gdk_flush ();
+    gdk_error_trap_push ();
 
     /* allocate */
     xkb = XkbAllocKeyboard ();
-
     if (G_LIKELY (xkb))
     {
-        /* flush and avoid crashes on x errors */
-        gdk_flush ();
-        gdk_error_trap_push ();
-        
         /* we always change this, so add it to the mask */
         SET_FLAG (mask, XkbControlsEnabledMask);
         
@@ -300,16 +299,16 @@
         /* free the structure */
         XkbFreeControls (xkb, mask, True);
         XFree (xkb);
-
-        /* flush errors and pop trap */
-        gdk_flush ();
-        gdk_error_trap_pop ();
     }
     else
     {
         /* warning */
         g_error ("XkbAllocKeyboard() returned a null pointer");
     }
+    
+    /* flush and remove the x error trap */
+    gdk_flush ();
+    gdk_error_trap_pop ();
 }
 
 

Modified: xfce4-settings/trunk/xfce4-settings-helper/keyboards.c
===================================================================
--- xfce4-settings/trunk/xfce4-settings-helper/keyboards.c      2008-07-18 
19:19:29 UTC (rev 27343)
+++ xfce4-settings/trunk/xfce4-settings-helper/keyboards.c      2008-07-18 
19:43:35 UTC (rev 27344)
@@ -34,10 +34,6 @@
 #include <X11/Xlib.h>
 #include <X11/XKBlib.h>
 
-#ifdef HAVE_XF86MISC
-#include <X11/extensions/xf86misc.h>
-#endif
-
 #include <glib.h>
 #include <gtk/gtk.h>
 #include <gdk/gdkx.h>
@@ -71,9 +67,6 @@
 
     /* xfconf channel */
     XfconfChannel *channel;
-
-    /* if xf86misc is present */
-    guint          has_xf86misc : 1;
 };
 
 
@@ -100,15 +93,9 @@
 
     /* init */
     helper->channel = NULL;
-    helper->has_xf86misc = FALSE;
 
     if (XkbQueryExtension (GDK_DISPLAY (), &dummy, &dummy, &dummy, &dummy, 
&dummy))
     {
-#ifdef HAVE_XF86MISC
-        /* chek for xf86misc */
-        helper->has_xf86misc = XF86MiscQueryVersion (GDK_DISPLAY (), &dummy, 
&dummy);
-#endif
-
         /* open the channel */
         helper->channel = xfconf_channel_new ("keyboards");
 
@@ -151,7 +138,7 @@
     /* load setting */
     repeat = xfconf_channel_get_bool (helper->channel, "/Default/KeyRepeat", 
FALSE);
 
-    /* flush and avoid crashes on x errors */
+    /* flush x and trap errors */
     gdk_flush ();
     gdk_error_trap_push ();
 
@@ -161,7 +148,7 @@
     /* set key repeat */
     XChangeKeyboardControl (GDK_DISPLAY (), KBAutoRepeatMode, &values);
 
-    /* flush errors and pop trap */
+    /* flush and remove the x error trap */
     gdk_flush ();
     gdk_error_trap_pop ();
 }
@@ -171,38 +158,24 @@
 static void
 xfce_keyboards_helper_set_repeat_rate (XfceKeyboardsHelper *helper)
 {
-#ifdef HAVE_XF86MISC
-    XF86MiscKbdSettings values;
-#endif
-    XkbDescPtr          xkb;
-    gint                delay, rate;
+    XkbDescPtr xkb;
+    gint       delay, rate;
 
     /* load settings */
     delay = xfconf_channel_get_int (helper->channel, 
"/Default/KeyRepeat/Delay", 0);
     rate = xfconf_channel_get_int (helper->channel, "/Default/KeyRepeat/Rate", 
0);
-
-    /* flush and avoid crashes on x errors */
+    
+    /* flush x and trap errors */
     gdk_flush ();
     gdk_error_trap_push ();
 
-#ifdef HAVE_XF86MISC
-    /* update the xkb misc keyboard delay and rate */
-    if (G_LIKELY (helper->has_xf86misc ))
-    {
-        XF86MiscGetKbdSettings (GDK_DISPLAY (), &values);
-        values.delay = delay;
-        values.rate = rate;
-        XF86MiscSetKbdSettings (GDK_DISPLAY (), &values);
-    }
-#endif
-
     /* allocate xkb structure */
     xkb = XkbAllocKeyboard ();
     if (G_LIKELY (xkb))
     {
         /* load controls */
         XkbGetControls (GDK_DISPLAY (), XkbRepeatKeysMask, xkb);
-
+        
         /* set new values */
         xkb->ctrls->repeat_delay = delay;
         xkb->ctrls->repeat_interval = rate != 0 ? 1000 / rate : 0;
@@ -214,8 +187,8 @@
         XkbFreeControls (xkb, XkbRepeatKeysMask, True);
         XFree (xkb);
     }
-
-    /* flush errors and pop trap */
+    
+    /* flush and remove the x error trap */
     gdk_flush ();
     gdk_error_trap_pop ();
 }

Modified: xfce4-settings/trunk/xfce4-settings-helper/main.c
===================================================================
--- xfce4-settings/trunk/xfce4-settings-helper/main.c   2008-07-18 19:19:29 UTC 
(rev 27343)
+++ xfce4-settings/trunk/xfce4-settings-helper/main.c   2008-07-18 19:43:35 UTC 
(rev 27344)
@@ -26,6 +26,9 @@
 #ifdef HAVE_STDLIB_H
 #include <stdlib.h>
 #endif
+#ifdef HAVE_STDIO_H
+#include <stdio.h>
+#endif
 #ifdef HAVE_UNISTD_H
 #include <unistd.h>
 #endif

Modified: xfce4-settings/trunk/xfce4-settings-helper/pointers.c
===================================================================
--- xfce4-settings/trunk/xfce4-settings-helper/pointers.c       2008-07-18 
19:19:29 UTC (rev 27343)
+++ xfce4-settings/trunk/xfce4-settings-helper/pointers.c       2008-07-18 
19:43:35 UTC (rev 27344)
@@ -341,7 +341,7 @@
     {
         /* allocate the button map */
         buttonmap = g_new0 (guchar, num_buttons);
-
+        
         /* get the button mapping */
         XGetDeviceButtonMapping (xdisplay, device, buttonmap, num_buttons);
 
@@ -392,7 +392,7 @@
     gint                 n;
     gulong               mask = 0;
     gint                 num = -1, denom = -1, gcd;
-
+    
     /* get the feedback states for this device */
     states = XGetFeedbackControl (xdisplay, device, &num_feedbacks);
 
@@ -492,6 +492,10 @@
     gchar       *acceleration_str;
     gchar       *device_name;
     gchar       *reverse_scrolling_str;
+    
+    /* flush x and trap errors */
+    gdk_flush ();
+    gdk_error_trap_push ();
 
     /* get all the registered devices */
     device_list = XListInputDevices (xdisplay, &ndevices);
@@ -550,6 +554,10 @@
 
     /* cleanup */
     XFreeDeviceList (device_list);
+    
+    /* flush and remove the x error trap */
+    gdk_flush ();
+    gdk_error_trap_pop ();
 }
 
 
@@ -565,6 +573,10 @@
     gint          n, ndevices;
     gchar       **names;
     gchar        *device_name;
+    
+    /* flush x and trap errors */
+    gdk_flush ();
+    gdk_error_trap_push ();
 
     /* split the property name (+1 so skip the first slash in the name) */
     names = g_strsplit (property_name + 1, "/", -1);
@@ -622,6 +634,10 @@
 
     /* cleanup */
     g_strfreev (names);
+    
+    /* flush and remove the x error trap */
+    gdk_flush ();
+    gdk_error_trap_pop ();
 }
 
 

_______________________________________________
Xfce4-commits mailing list
[email protected]
http://foo-projects.org/mailman/listinfo/xfce4-commits

Reply via email to