ui: Adapt to GDK API changes

Some API which was only meaningful on X11 was moved to the X11
backend and renamed accordingly, so adapt to those changes.

https://bugzilla.gnome.org/show_bug.cgi?id=637802
This commit is contained in:
Florian Müllner 2010-12-22 01:20:31 +01:00 committed by Owen W. Taylor
parent 93c0620151
commit cbce4fd39d

View File

@ -129,7 +129,7 @@ maybe_redirect_mouse_event (XEvent *xevent)
if (!ui) if (!ui)
return FALSE; return FALSE;
gdk_window = gdk_window_lookup_for_display (gdisplay, window); gdk_window = gdk_x11_window_lookup_for_display (gdisplay, window);
if (gdk_window == NULL) if (gdk_window == NULL)
return FALSE; return FALSE;
@ -411,8 +411,10 @@ meta_ui_map_frame (MetaUI *ui,
Window xwindow) Window xwindow)
{ {
GdkWindow *window; GdkWindow *window;
GdkDisplay *display;
window = gdk_xid_table_lookup (xwindow); display = gdk_x11_lookup_xdisplay (ui->xdisplay);
window = gdk_x11_window_lookup_for_display (display, xwindow);
if (window) if (window)
gdk_window_show_unraised (window); gdk_window_show_unraised (window);
@ -423,8 +425,10 @@ meta_ui_unmap_frame (MetaUI *ui,
Window xwindow) Window xwindow)
{ {
GdkWindow *window; GdkWindow *window;
GdkDisplay *display;
window = gdk_xid_table_lookup (xwindow); display = gdk_x11_lookup_xdisplay (ui->xdisplay);
window = gdk_x11_window_lookup_for_display (display, xwindow);
if (window) if (window)
gdk_window_hide (window); gdk_window_hide (window);
@ -653,8 +657,10 @@ meta_ui_window_should_not_cause_focus (Display *xdisplay,
Window xwindow) Window xwindow)
{ {
GdkWindow *window; GdkWindow *window;
GdkDisplay *display;
window = gdk_xid_table_lookup (xwindow); display = gdk_x11_lookup_xdisplay (xdisplay);
window = gdk_x11_window_lookup_for_display (display, xwindow);
/* we shouldn't cause focus if we're an override redirect /* we shouldn't cause focus if we're an override redirect
* toplevel which is not foreign * toplevel which is not foreign
@ -669,17 +675,20 @@ char*
meta_text_property_to_utf8 (Display *xdisplay, meta_text_property_to_utf8 (Display *xdisplay,
const XTextProperty *prop) const XTextProperty *prop)
{ {
GdkDisplay *display;
char **list; char **list;
int count; int count;
char *retval; char *retval;
list = NULL; list = NULL;
count = gdk_text_property_to_utf8_list (gdk_x11_xatom_to_atom (prop->encoding), display = gdk_x11_lookup_xdisplay (xdisplay);
prop->format, count = gdk_text_property_to_utf8_list_for_display (display,
prop->value, gdk_x11_xatom_to_atom (prop->encoding),
prop->nitems, prop->format,
&list); prop->value,
prop->nitems,
&list);
if (count == 0) if (count == 0)
retval = NULL; retval = NULL;
@ -904,9 +913,11 @@ gboolean
meta_ui_window_is_widget (MetaUI *ui, meta_ui_window_is_widget (MetaUI *ui,
Window xwindow) Window xwindow)
{ {
GdkDisplay *display;
GdkWindow *window; GdkWindow *window;
window = gdk_xid_table_lookup (xwindow); display = gdk_x11_lookup_xdisplay (ui->xdisplay);
window = gdk_x11_window_lookup_for_display (display, xwindow);
if (window) if (window)
{ {