keybindings: Fix some compile-time warnings

Including missing function declaration and deprecated GDK_DISPLAY use.
This commit is contained in:
Bastien Nocera 2010-09-20 18:16:10 +01:00
parent 892e513996
commit 98c95e857d
6 changed files with 25 additions and 14 deletions

View file

@ -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 \

View file

@ -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)

View file

@ -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;
}

View file

@ -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"

View file

@ -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);

View file

@ -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);
}