[gnome-control-center] keybindings: Fix some compile-time warnings
- From: Bastien Nocera <hadess src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-control-center] keybindings: Fix some compile-time warnings
- Date: Mon, 20 Sep 2010 17:25:43 +0000 (UTC)
commit 98c95e857d343f65c8b6d846c538a4d288113b40
Author: Bastien Nocera <hadess hadess net>
Date: Mon Sep 20 18:16:10 2010 +0100
keybindings: Fix some compile-time warnings
Including missing function declaration and deprecated GDK_DISPLAY use.
panels/keybindings/Makefile.am | 1 +
panels/keybindings/cc-keybindings-panel.c | 1 +
panels/keybindings/eggaccelerators.c | 2 +-
panels/keybindings/gnome-keybinding-properties.c | 1 +
panels/keybindings/gnome-keybinding-properties.h | 8 ++++++
panels/keybindings/wm-common.c | 26 +++++++++++-----------
6 files changed, 25 insertions(+), 14 deletions(-)
---
diff --git a/panels/keybindings/Makefile.am b/panels/keybindings/Makefile.am
index e475646..764b107 100644
--- a/panels/keybindings/Makefile.am
+++ b/panels/keybindings/Makefile.am
@@ -11,6 +11,7 @@ libkeybinding_properties_la_SOURCES = \
wm-common.c \
wm-common.h \
gnome-keybinding-properties.c \
+ gnome-keybinding-properties.h \
eggcellrendererkeys.c \
eggcellrendererkeys.h \
eggaccelerators.c \
diff --git a/panels/keybindings/cc-keybindings-panel.c b/panels/keybindings/cc-keybindings-panel.c
index a128fba..3a98163 100644
--- a/panels/keybindings/cc-keybindings-panel.c
+++ b/panels/keybindings/cc-keybindings-panel.c
@@ -20,6 +20,7 @@
*/
#include "cc-keybindings-panel.h"
+#include "gnome-keybinding-properties.h"
G_DEFINE_DYNAMIC_TYPE (CcKeybindingsPanel, cc_keybindings_panel, CC_TYPE_PANEL)
diff --git a/panels/keybindings/eggaccelerators.c b/panels/keybindings/eggaccelerators.c
index 80c06c5..5a672ba 100644
--- a/panels/keybindings/eggaccelerators.c
+++ b/panels/keybindings/eggaccelerators.c
@@ -356,7 +356,7 @@ egg_accelerator_parse_virtual (const gchar *accelerator,
}
else if (keycode != NULL)
{
- *keycode = XKeysymToKeycode (GDK_DISPLAY(), keyval);
+ *keycode = XKeysymToKeycode (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()), keyval);
if (*keycode == 0)
bad_keyval = TRUE;
}
diff --git a/panels/keybindings/gnome-keybinding-properties.c b/panels/keybindings/gnome-keybinding-properties.c
index 6c9a633..11fb811 100644
--- a/panels/keybindings/gnome-keybinding-properties.c
+++ b/panels/keybindings/gnome-keybinding-properties.c
@@ -14,6 +14,7 @@
#include <gdk/gdkkeysyms.h>
#include "wm-common.h"
+#include "gnome-keybinding-properties.h"
#include "eggcellrendererkeys.h"
#define GCONF_BINDING_DIR "/desktop/gnome/keybindings"
diff --git a/panels/keybindings/gnome-keybinding-properties.h b/panels/keybindings/gnome-keybinding-properties.h
new file mode 100644
index 0000000..0203308
--- /dev/null
+++ b/panels/keybindings/gnome-keybinding-properties.h
@@ -0,0 +1,8 @@
+/* This program was written with lots of love under the GPL by Jonathan
+ * Blandford <jrb gnome org>
+ */
+
+#include <gtk/gtk.h>
+
+void gnome_keybinding_properties_init (GtkBuilder *builder);
+
diff --git a/panels/keybindings/wm-common.c b/panels/keybindings/wm-common.c
index 6ffc6be..203dec9 100644
--- a/panels/keybindings/wm-common.c
+++ b/panels/keybindings/wm-common.c
@@ -29,12 +29,12 @@ wm_common_get_window_manager_property (Atom atom)
if (wm_window == None)
return NULL;
- utf8_string = XInternAtom (GDK_DISPLAY (), "UTF8_STRING", False);
+ utf8_string = XInternAtom (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()), "UTF8_STRING", False);
gdk_error_trap_push ();
val = NULL;
- result = XGetWindowProperty (GDK_DISPLAY (),
+ result = XGetWindowProperty (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()),
wm_window,
atom,
0, G_MAXLONG,
@@ -62,7 +62,7 @@ wm_common_get_window_manager_property (Atom atom)
char*
wm_common_get_current_window_manager (void)
{
- Atom atom = XInternAtom (GDK_DISPLAY (), "_NET_WM_NAME", False);
+ Atom atom = XInternAtom (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()), "_NET_WM_NAME", False);
char *result;
result = wm_common_get_window_manager_property (atom);
@@ -75,7 +75,7 @@ wm_common_get_current_window_manager (void)
char**
wm_common_get_current_keybindings (void)
{
- Atom keybindings_atom = XInternAtom (GDK_DISPLAY (), "_GNOME_WM_KEYBINDINGS", False);
+ Atom keybindings_atom = XInternAtom (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()), "_GNOME_WM_KEYBINDINGS", False);
char *keybindings = wm_common_get_window_manager_property (keybindings_atom);
char **results;
@@ -89,7 +89,7 @@ wm_common_get_current_keybindings (void)
}
else
{
- Atom wm_atom = XInternAtom (GDK_DISPLAY (), "_NET_WM_NAME", False);
+ Atom wm_atom = XInternAtom (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()), "_NET_WM_NAME", False);
char *wm_name = wm_common_get_window_manager_property (wm_atom);
char *to_copy[] = { NULL, NULL };
@@ -111,8 +111,8 @@ update_wm_window (void)
gulong nitems;
gulong bytes_after;
- XGetWindowProperty (GDK_DISPLAY (), GDK_ROOT_WINDOW (),
- XInternAtom (GDK_DISPLAY (), "_NET_SUPPORTING_WM_CHECK", False),
+ XGetWindowProperty (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()), GDK_ROOT_WINDOW (),
+ XInternAtom (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()), "_NET_SUPPORTING_WM_CHECK", False),
0, G_MAXLONG, False, XA_WINDOW, &type, &format,
&nitems, &bytes_after, (guchar **) &xwindow);
@@ -123,8 +123,8 @@ update_wm_window (void)
}
gdk_error_trap_push ();
- XSelectInput (GDK_DISPLAY (), *xwindow, StructureNotifyMask | PropertyChangeMask);
- XSync (GDK_DISPLAY (), False);
+ XSelectInput (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()), *xwindow, StructureNotifyMask | PropertyChangeMask);
+ XSync (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()), False);
if (gdk_error_trap_pop ())
{
@@ -149,10 +149,10 @@ wm_window_event_filter (GdkXEvent *xev,
wm_window != None && xevent->xany.window == wm_window) ||
(xevent->type == PropertyNotify &&
xevent->xany.window == GDK_ROOT_WINDOW () &&
- xevent->xproperty.atom == (XInternAtom (GDK_DISPLAY (), "_NET_SUPPORTING_WM_CHECK", False))) ||
+ xevent->xproperty.atom == (XInternAtom (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()), "_NET_SUPPORTING_WM_CHECK", False))) ||
(xevent->type == PropertyNotify &&
wm_window != None && xevent->xany.window == wm_window &&
- xevent->xproperty.atom == (XInternAtom (GDK_DISPLAY (), "_NET_WM_NAME", False))))
+ xevent->xproperty.atom == (XInternAtom (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()), "_NET_WM_NAME", False))))
{
update_wm_window ();
(* ncb_data->func) ((gpointer)wm_common_get_current_window_manager(),
@@ -177,8 +177,8 @@ wm_common_register_window_manager_change (GFunc func,
update_wm_window ();
- XSelectInput (GDK_DISPLAY (), GDK_ROOT_WINDOW (), PropertyChangeMask);
- XSync (GDK_DISPLAY (), False);
+ XSelectInput (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()), GDK_ROOT_WINDOW (), PropertyChangeMask);
+ XSync (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()), False);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]