- Update to snapshot

- Enable profiling
This commit is contained in:
William Jon McCann 2008-03-26 15:13:00 +00:00
parent 964253372c
commit 6c32b09f69
3 changed files with 81 additions and 96 deletions

View File

@ -1,6 +1,5 @@
diff -up gnome-settings-daemon-2.21.92/plugins/xrandr/gsd-xrandr-manager.c.add-randr-12 gnome-settings-daemon-2.21.92/plugins/xrandr/gsd-xrandr-manager.c --- gnome-settings-daemon-2.22.1/plugins/xrandr/gsd-xrandr-manager.c.add-randr-12 2008-03-24 17:21:50.000000000 -0400
--- gnome-settings-daemon-2.21.92/plugins/xrandr/gsd-xrandr-manager.c.add-randr-12 2008-02-20 09:20:27.000000000 -0500 +++ gnome-settings-daemon-2.22.1/plugins/xrandr/gsd-xrandr-manager.c 2008-03-24 18:23:32.000000000 -0400
+++ gnome-settings-daemon-2.21.92/plugins/xrandr/gsd-xrandr-manager.c 2008-03-02 17:48:02.000000000 -0500
@@ -35,7 +35,10 @@ @@ -35,7 +35,10 @@
#include <gdk/gdk.h> #include <gdk/gdk.h>
#include <gdk/gdkx.h> #include <gdk/gdkx.h>
@ -13,8 +12,8 @@ diff -up gnome-settings-daemon-2.21.92/plugins/xrandr/gsd-xrandr-manager.c.add-r
#ifdef HAVE_RANDR #ifdef HAVE_RANDR
#include <X11/extensions/Xrandr.h> #include <X11/extensions/Xrandr.h>
@@ -43,6 +46,22 @@ @@ -44,6 +47,22 @@
#include "gnome-settings-profile.h"
#include "gsd-xrandr-manager.h" #include "gsd-xrandr-manager.h"
+#define GSD_XRANDR_MANAGER_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GSD_TYPE_XRANDR_MANAGER, GsdXrandrManagerPrivate)) +#define GSD_XRANDR_MANAGER_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GSD_TYPE_XRANDR_MANAGER, GsdXrandrManagerPrivate))
@ -36,7 +35,7 @@ diff -up gnome-settings-daemon-2.21.92/plugins/xrandr/gsd-xrandr-manager.c.add-r
static void gsd_xrandr_manager_class_init (GsdXrandrManagerClass *klass); static void gsd_xrandr_manager_class_init (GsdXrandrManagerClass *klass);
static void gsd_xrandr_manager_init (GsdXrandrManager *xrandr_manager); static void gsd_xrandr_manager_init (GsdXrandrManager *xrandr_manager);
static void gsd_xrandr_manager_finalize (GObject *object); static void gsd_xrandr_manager_finalize (GObject *object);
@@ -51,248 +70,74 @@ G_DEFINE_TYPE (GsdXrandrManager, gsd_xra @@ -52,252 +71,74 @@ G_DEFINE_TYPE (GsdXrandrManager, gsd_xra
static gpointer manager_object = NULL; static gpointer manager_object = NULL;
@ -95,30 +94,11 @@ diff -up gnome-settings-daemon-2.21.92/plugins/xrandr/gsd-xrandr-manager.c.add-r
- if (val == NULL) { - if (val == NULL) {
- return -1; - return -1;
- } - }
+static Atom -
+gnome_randr_xatom (void)
+{
+ return gdk_x11_atom_to_xatom (gnome_randr_atom());
+}
- if (sscanf (val, "%dx%d", &w, &h) != 2) { - if (sscanf (val, "%dx%d", &w, &h) != 2) {
- g_free (val); - g_free (val);
- return -1; - return -1;
+static GdkFilterReturn - }
+on_client_message (GdkXEvent *xevent,
+ GdkEvent *event,
+ gpointer data)
+{
+ RWScreen *screen = data;
+ XEvent *ev = (XEvent *)xevent;
+
+ if (ev->type == ClientMessage &&
+ ev->xclient.message_type == gnome_randr_xatom()) {
+
+ configuration_apply_stored (screen);
+
+ return GDK_FILTER_REMOVE;
}
- -
- g_free (val); - g_free (val);
- -
@ -126,9 +106,10 @@ diff -up gnome-settings-daemon-2.21.92/plugins/xrandr/gsd-xrandr-manager.c.add-r
- *height = h; - *height = h;
- -
- return i; - return i;
+ +static Atom
+ /* Pass the event on to GTK+ */ +gnome_randr_xatom (void)
+ return GDK_FILTER_CONTINUE; +{
+ return gdk_x11_atom_to_xatom (gnome_randr_atom());
} }
-static int -static int
@ -136,31 +117,29 @@ diff -up gnome-settings-daemon-2.21.92/plugins/xrandr/gsd-xrandr-manager.c.add-r
- char *display, - char *display,
- int screen) - int screen)
+static GdkFilterReturn +static GdkFilterReturn
+event_filter (GdkXEvent *xevent, +on_client_message (GdkXEvent *xevent,
+ GdkEvent *event, + GdkEvent *event,
+ gpointer data) + gpointer data)
{ {
- char *key; - char *key;
- int val; - int val;
- GError *error; - GError *error;
+ GsdXrandrManager *manager = data; + RWScreen *screen = data;
+ XEvent *xev = (XEvent *) xevent; + XEvent *ev = (XEvent *)xevent;
- key = g_strdup_printf ("%s/%d/rate", display, screen); - key = g_strdup_printf ("%s/%d/rate", display, screen);
- error = NULL; - error = NULL;
- val = gconf_client_get_int (client, key, &error); - val = gconf_client_get_int (client, key, &error);
- g_free (key); - g_free (key);
+ if (!manager->priv->running) + if (ev->type == ClientMessage &&
+ return GDK_FILTER_CONTINUE; + ev->xclient.message_type == gnome_randr_xatom()) {
- if (error == NULL) { - if (error == NULL) {
- return val; - return val;
- } - }
- -
- g_error_free (error); - g_error_free (error);
+ /* verify we have a key event */ + configuration_apply_stored (screen);
+ if (xev->xany.type != KeyPress && xev->xany.type != KeyRelease)
+ return GDK_FILTER_CONTINUE;
- return 0; - return 0;
-} -}
@ -187,23 +166,21 @@ diff -up gnome-settings-daemon-2.21.92/plugins/xrandr/gsd-xrandr-manager.c.add-r
- closest_width = sizes[i].width; - closest_width = sizes[i].width;
- closest_height = sizes[i].height; - closest_height = sizes[i].height;
- } - }
+ if (xev->xkey.keycode == manager->priv->keycode) { + return GDK_FILTER_REMOVE;
+ /* FIXME: here we should cycle between valid
+ * configurations, and save them
+ */
+ configuration_apply_stored (manager->priv->rw_screen);
+
+ return GDK_FILTER_CONTINUE;
} }
- return closest; - return closest;
+ /* Pass the event on to GTK+ */
+ return GDK_FILTER_CONTINUE; + return GDK_FILTER_CONTINUE;
} }
-#endif /* HAVE_RANDR */ -#endif /* HAVE_RANDR */
static void -static void
-apply_settings (GsdXrandrManager *manager) -apply_settings (GsdXrandrManager *manager)
+on_randr_event (RWScreen *screen, gpointer data) +static GdkFilterReturn
+event_filter (GdkXEvent *xevent,
+ GdkEvent *event,
+ gpointer data)
{ {
-#ifdef HAVE_RANDR -#ifdef HAVE_RANDR
- GdkDisplay *display; - GdkDisplay *display;
@ -230,24 +207,28 @@ diff -up gnome-settings-daemon-2.21.92/plugins/xrandr/gsd-xrandr-manager.c.add-r
- int i; - int i;
- int residx; - int residx;
- -
- gnome_settings_profile_start (NULL);
-
- display = gdk_display_get_default (); - display = gdk_display_get_default ();
- xdisplay = gdk_x11_display_get_xdisplay (display); - xdisplay = gdk_x11_display_get_xdisplay (display);
- -
- /* Check if XRandR is supported on the display */ - /* Check if XRandR is supported on the display */
- if (!XRRQueryExtension (xdisplay, &event_base, &error_base) - if (!XRRQueryExtension (xdisplay, &event_base, &error_base)
- || XRRQueryVersion (xdisplay, &major, &minor) == 0) { - || XRRQueryVersion (xdisplay, &major, &minor) == 0) {
- return; - goto out;
- } - }
+ GsdXrandrManager *manager = data; -
- if (major != 1 || minor < 1) { - if (major != 1 || minor < 1) {
- g_message ("Display has unsupported version of XRandR (%d.%d), not setting resolution.", major, minor); - g_message ("Display has unsupported version of XRandR (%d.%d), not setting resolution.", major, minor);
+ if (!manager->priv->running) - goto out;
return;
- } - }
- + GsdXrandrManager *manager = data;
+ XEvent *xev = (XEvent *) xevent;
- client = gconf_client_get_default (); - client = gconf_client_get_default ();
- + if (!manager->priv->running)
+ return GDK_FILTER_CONTINUE;
- i = 0; - i = 0;
- specific_path = NULL; - specific_path = NULL;
- if (gethostname (hostname, sizeof (hostname)) == 0) { - if (gethostname (hostname, sizeof (hostname)) == 0) {
@ -256,7 +237,10 @@ diff -up gnome-settings-daemon-2.21.92/plugins/xrandr/gsd-xrandr-manager.c.add-r
- } - }
- keys[i++] = "/desktop/gnome/screen/default"; - keys[i++] = "/desktop/gnome/screen/default";
- keys[i++] = NULL; - keys[i++] = NULL;
- + /* verify we have a key event */
+ if (xev->xany.type != KeyPress && xev->xany.type != KeyRelease)
+ return GDK_FILTER_CONTINUE;
- n_screens = gdk_display_get_n_screens (display); - n_screens = gdk_display_get_n_screens (display);
- for (i = 0; i < n_screens; i++) { - for (i = 0; i < n_screens; i++) {
- screen = gdk_display_get_screen (display, i); - screen = gdk_display_get_screen (display, i);
@ -311,36 +295,50 @@ diff -up gnome-settings-daemon-2.21.92/plugins/xrandr/gsd-xrandr-manager.c.add-r
- rate, - rate,
- GDK_CURRENT_TIME); - GDK_CURRENT_TIME);
- } - }
- + if (xev->xkey.keycode == manager->priv->keycode) {
+ /* FIXME: here we should cycle between valid
+ * configurations, and save them
+ */
+ configuration_apply_stored (manager->priv->rw_screen);
- XRRFreeScreenConfigInfo (config); - XRRFreeScreenConfigInfo (config);
- } - }
- } + return GDK_FILTER_CONTINUE;
- }
- g_free (specific_path); - g_free (specific_path);
- -
- /* We need to make sure we process the screen resize event. */ - /* We need to make sure we process the screen resize event. */
- gdk_display_sync (display); - gdk_display_sync (display);
- + return GDK_FILTER_CONTINUE;
+}
- while (gtk_events_pending ()) { - while (gtk_events_pending ()) {
- gtk_main_iteration (); - gtk_main_iteration ();
- } - }
- +static void
+on_randr_event (RWScreen *screen, gpointer data)
+{
+ GsdXrandrManager *manager = data;
- if (client != NULL) { - if (client != NULL) {
- g_object_unref (client); - g_object_unref (client);
- } - }
- - out:
- gnome_settings_profile_end (NULL);
+ if (!manager->priv->running)
+ return;
-#endif /* HAVE_RANDR */ -#endif /* HAVE_RANDR */
+
+ /* FIXME: Set up any new screens here */ + /* FIXME: Set up any new screens here */
} }
gboolean gboolean
@@ -301,8 +146,25 @@ gsd_xrandr_manager_start (GsdXrandrManag @@ -306,7 +147,24 @@ gsd_xrandr_manager_start (GsdXrandrManag
{ {
g_debug ("Starting xrandr manager"); g_debug ("Starting xrandr manager");
- apply_settings (manager); - apply_settings (manager);
-
+ manager->priv->running = TRUE; + manager->priv->running = TRUE;
+ +
+ if (manager->priv->keycode) { + if (manager->priv->keycode) {
@ -359,11 +357,10 @@ diff -up gnome-settings-daemon-2.21.92/plugins/xrandr/gsd-xrandr-manager.c.add-r
+ gdk_add_client_message_filter (gnome_randr_atom(), + gdk_add_client_message_filter (gnome_randr_atom(),
+ on_client_message, + on_client_message,
+ manager->priv->rw_screen); + manager->priv->rw_screen);
+
return TRUE; return TRUE;
} }
@@ -315,6 +173,12 @@ void
@@ -310,6 +172,12 @@ void
gsd_xrandr_manager_stop (GsdXrandrManager *manager) gsd_xrandr_manager_stop (GsdXrandrManager *manager)
{ {
g_debug ("Stopping xrandr manager"); g_debug ("Stopping xrandr manager");
@ -376,7 +373,7 @@ diff -up gnome-settings-daemon-2.21.92/plugins/xrandr/gsd-xrandr-manager.c.add-r
} }
static void static void
@@ -383,11 +251,22 @@ gsd_xrandr_manager_class_init (GsdXrandr @@ -388,11 +252,22 @@ gsd_xrandr_manager_class_init (GsdXrandr
object_class->constructor = gsd_xrandr_manager_constructor; object_class->constructor = gsd_xrandr_manager_constructor;
object_class->dispose = gsd_xrandr_manager_dispose; object_class->dispose = gsd_xrandr_manager_dispose;
object_class->finalize = gsd_xrandr_manager_finalize; object_class->finalize = gsd_xrandr_manager_finalize;
@ -399,7 +396,7 @@ diff -up gnome-settings-daemon-2.21.92/plugins/xrandr/gsd-xrandr-manager.c.add-r
} }
static void static void
@@ -400,6 +279,8 @@ gsd_xrandr_manager_finalize (GObject *ob @@ -405,6 +280,8 @@ gsd_xrandr_manager_finalize (GObject *ob
xrandr_manager = GSD_XRANDR_MANAGER (object); xrandr_manager = GSD_XRANDR_MANAGER (object);

View File

@ -1,6 +1,6 @@
Name: gnome-settings-daemon Name: gnome-settings-daemon
Version: 2.22.0 Version: 2.22.1
Release: 3%{?dist} Release: 0.2008.03.26.1%{?dist}
Summary: The daemon sharing settings from GNOME to GTK+/KDE applications Summary: The daemon sharing settings from GNOME to GTK+/KDE applications
Group: System Environment/Daemons Group: System Environment/Daemons
@ -30,8 +30,6 @@ BuildRequires: perl(XML::Parser)
Patch1: add-randr-12.patch Patch1: add-randr-12.patch
Patch2: gnome-settings-daemon-2.21.91-ignore-model-if-evdev.patch Patch2: gnome-settings-daemon-2.21.91-ignore-model-if-evdev.patch
# http://bugzilla.gnome.org/show_bug.cgi?id=523676
Patch3: mouse-no-eat-keys.patch
%description %description
A daemon to share settings from GNOME to other applications. It also A daemon to share settings from GNOME to other applications. It also
@ -53,10 +51,9 @@ developing applications that use %{name}.
%patch1 -p1 -b .add-randr-12 %patch1 -p1 -b .add-randr-12
%patch2 -p1 -b .ignore-layout-if-using-evdev %patch2 -p1 -b .ignore-layout-if-using-evdev
%patch3 -p1 -b .mouse-no-eat-keys
%build %build
%configure --enable-static=no %configure --enable-static=no --enable-profiling
make %{?_smp_mflags} make %{?_smp_mflags}
cd po cd po
@ -135,6 +132,10 @@ fi
%{_libdir}/pkgconfig/gnome-settings-daemon.pc %{_libdir}/pkgconfig/gnome-settings-daemon.pc
%changelog %changelog
* Wed Mar 26 2008 Jon McCann <jmccann@redhat.com> - 2.22.1-0.2008.03.26.1
- Update to snapshot
- Enable profiling
* Wed Mar 26 2008 - Bastien Nocera <bnocera@redhat.com> - 2.22.0-3 * Wed Mar 26 2008 - Bastien Nocera <bnocera@redhat.com> - 2.22.0-3
- apps_gnome_settings_daemon_default_editor.schemas is obsolete (#438937) - apps_gnome_settings_daemon_default_editor.schemas is obsolete (#438937)

View File

@ -1,13 +0,0 @@
Index: gnome-settings-daemon-2.22.0/plugins/mouse/gsd-mouse-manager.c
===================================================================
--- gnome-settings-daemon-2.22.0/plugins/mouse/gsd-mouse-manager.c (revision 224)
+++ gnome-settings-daemon-2.22.0/plugins/mouse/gsd-mouse-manager.c (working copy)
@@ -439,8 +439,6 @@
XUngrabKeyboard (gdk_x11_get_default_xdisplay (),
xev->xkey.time);
}
-
- return GDK_FILTER_REMOVE;
}
return GDK_FILTER_CONTINUE;
}